|
|
|
@@ -578,7 +578,7 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
|
// 拼接project |
|
|
|
GitProjectVo gitProjectVo = new GitProjectVo(); |
|
|
|
gitProjectVo.setRepositoryName(repositoryName); |
|
|
|
gitProjectVo.setName("model" + modelsVo.getName()); |
|
|
|
gitProjectVo.setName(Constant.Topic_model + "-" + modelsVo.getName()); |
|
|
|
gitProjectVo.setDescription(modelsVo.getDescription()); |
|
|
|
gitProjectVo.setPrivate(!modelsVo.getIsPublic()); |
|
|
|
gitProjectVo.setUserId(userId); |
|
|
|
@@ -604,7 +604,7 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
|
// 创建分支 |
|
|
|
gitService.createBranch(token, (String) userInfo.get("login"), repositoryName, branchName, "master"); |
|
|
|
// 定义标签 标签1:ci4s-model 标签2:ModelTag 标签3:ModelType |
|
|
|
gitService.createTopic(token, gitlinIid, "ci4s-model"); |
|
|
|
gitService.createTopic(token, gitlinIid, Constant.Topic_model); |
|
|
|
if (StringUtils.isNotEmpty(modelsVo.getModelTag())) { |
|
|
|
gitService.createTopic(token, gitlinIid, "modeltag-" + modelsVo.getModelTag()); |
|
|
|
} |
|
|
|
@@ -943,7 +943,7 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
|
String req = httpUtils.sendGetWithToken(url, null, token); |
|
|
|
Map<String, Object> stringObjectMap = JacksonUtil.parseJSONStr2Map(req); |
|
|
|
List<Map<String, Object>> projects = (List<Map<String, Object>>) stringObjectMap.get("projects"); |
|
|
|
List<ModelsVo> collect = convert(projects, "ci4s-model", modelTagName, modelTypeName); |
|
|
|
List<ModelsVo> collect = convert(projects, Constant.Topic_model, modelTagName, modelTypeName); |
|
|
|
List<ModelsVo> result = collect.stream().skip((pageRequest.getPageNumber()) * pageRequest.getPageSize()).limit(pageRequest.getPageSize()). |
|
|
|
collect(Collectors.toList()); |
|
|
|
return new PageImpl<>(result, pageRequest, collect.size()); |
|
|
|
@@ -957,7 +957,6 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
|
String gitLinkPassword = loginUser.getSysUser().getGitLinkPassword(); |
|
|
|
|
|
|
|
Map<String, Object> userInfo = getUserInfo(ci4sUsername, gitLinkUsername, gitLinkPassword); |
|
|
|
Integer userId = (Integer) userInfo.get("user_id"); |
|
|
|
String token = (String) userInfo.get("token"); |
|
|
|
|
|
|
|
//拼接查询url |
|
|
|
@@ -974,7 +973,7 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
|
String req = httpUtils.sendGetWithToken(url, null, token); |
|
|
|
Map<String, Object> stringObjectMap = JacksonUtil.parseJSONStr2Map(req); |
|
|
|
List<Map<String, Object>> projects = (List<Map<String, Object>>) stringObjectMap.get("projects"); |
|
|
|
List<ModelsVo> collect = convert(projects, "ci4s-model", modelTagName, modelTypeName); |
|
|
|
List<ModelsVo> collect = convert(projects, Constant.Topic_model, modelTagName, modelTypeName); |
|
|
|
List<ModelsVo> result = collect.stream().skip((pageRequest.getPageNumber()) * pageRequest.getPageSize()).limit(pageRequest.getPageSize()). |
|
|
|
collect(Collectors.toList()); |
|
|
|
return new PageImpl<>(result, pageRequest, collect.size()); |
|
|
|
@@ -1219,6 +1218,8 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
|
Map<String, Object> author = (Map<String, Object>) map.get("author"); |
|
|
|
newModelVo.setCreateBy((String) author.get("name")); |
|
|
|
newModelVo.setOwner((String) author.get("login")); |
|
|
|
String name = (String) map.get("name"); |
|
|
|
newModelVo.setName(name.substring((modelTopic + "-").length())); |
|
|
|
result.add(newModelVo); |
|
|
|
} |
|
|
|
} |
|
|
|
|