|
@@ -66,7 +66,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
- public ResponseBodyVO<Void> addOrUpdate(AlgorithmParameter param) {
|
|
|
|
|
|
+ public ResponseBodyVO<Object> addOrUpdate(AlgorithmParameter param) {
|
|
String currentUserId = AuthUtil.getCurrentUserId();
|
|
String currentUserId = AuthUtil.getCurrentUserId();
|
|
param.setCreateUserId(currentUserId);
|
|
param.setCreateUserId(currentUserId);
|
|
|
|
|
|
@@ -100,7 +100,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
return doAddOrUpdate(param);
|
|
return doAddOrUpdate(param);
|
|
}
|
|
}
|
|
|
|
|
|
- private ResponseBodyVO<Void> doAddOrUpdate(AlgorithmParameter param) {
|
|
|
|
|
|
+ private ResponseBodyVO<Object> doAddOrUpdate(AlgorithmParameter param) {
|
|
if (isEmpty(param.getId())) {
|
|
if (isEmpty(param.getId())) {
|
|
// 添加
|
|
// 添加
|
|
String algorithmId = StringUtil.getRandomUUID();
|
|
String algorithmId = StringUtil.getRandomUUID();
|
|
@@ -130,7 +130,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ResponseBodyVO selectAlgorithmList(AlgorithmParameter param) {
|
|
|
|
|
|
+ public ResponseBodyVO<Object> selectAlgorithmList(AlgorithmParameter param) {
|
|
param.setIsDeleted("0");
|
|
param.setIsDeleted("0");
|
|
param.setCreateUserId(AuthUtil.getCurrentUserId());
|
|
param.setCreateUserId(AuthUtil.getCurrentUserId());
|
|
PageUtil.setPageInfo(param);
|
|
PageUtil.setPageInfo(param);
|
|
@@ -142,7 +142,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ResponseBodyVO selectAlgoPlatformList(AlgorithmParameter param) {
|
|
|
|
|
|
+ public ResponseBodyVO<Object> selectAlgoPlatformList(AlgorithmParameter param) {
|
|
//获取参数
|
|
//获取参数
|
|
String algorithmId = param.getAlgorithmCode();
|
|
String algorithmId = param.getAlgorithmCode();
|
|
String algorithmName = param.getAlgorithmName();
|
|
String algorithmName = param.getAlgorithmName();
|
|
@@ -209,7 +209,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ResponseBodyVO selectSharedAlgorithmList(AlgorithmParameter param) {
|
|
|
|
|
|
+ public ResponseBodyVO<Object> selectSharedAlgorithmList(AlgorithmParameter param) {
|
|
param.setShare("1");
|
|
param.setShare("1");
|
|
PageUtil.setPageInfo(param);
|
|
PageUtil.setPageInfo(param);
|
|
List<AlgorithmVO> vos = algorithmMapper.selectSharedAlgorithmList(param);
|
|
List<AlgorithmVO> vos = algorithmMapper.selectSharedAlgorithmList(param);
|
|
@@ -220,7 +220,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ResponseBodyVO<String> shareAlgorithm(AlgorithmParameter param) {
|
|
|
|
|
|
+ public ResponseBodyVO<Object> shareAlgorithm(AlgorithmParameter param) {
|
|
if (isEmpty(param.getId())) {
|
|
if (isEmpty(param.getId())) {
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE);
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE);
|
|
} else {
|
|
} else {
|
|
@@ -255,35 +255,6 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-// @Override
|
|
|
|
-// public String getGitVersion(String algorithmId) {
|
|
|
|
-// AlgorithmPO algorithmPO = algorithmMapper.selectDetailsById(algorithmId);
|
|
|
|
-// String gitUrl = algorithmPO.getGitUrl();
|
|
|
|
-// String gitUserName = algorithmPO.getGitUserName();
|
|
|
|
-// String gitPassword = algorithmPO.getGitPassword();
|
|
|
|
-// if (StringUtil.isEmpty(gitUrl)) {
|
|
|
|
-// return "";
|
|
|
|
-// }
|
|
|
|
-// //拼接get请求地址
|
|
|
|
-//// String prefix = "https://api.github.com/repos/";
|
|
|
|
-// String prefix = "https://api.github.com/repos/";
|
|
|
|
-// String suffix = "/commits?page=1&per_page=1";
|
|
|
|
-// String gitInfo = gitUrl.substring(19, gitUrl.length() - 4);
|
|
|
|
-// String requestUrl = prefix + gitInfo + suffix;
|
|
|
|
-// try {
|
|
|
|
-// String result = HttpUtil.get(HttpUtil.getHttpClient(), HttpUtil.getRequestConfig(), requestUrl);
|
|
|
|
-// List<HashMap> hashMaps = JsonUtil.jsonToList(result, HashMap.class);
|
|
|
|
-// if (hashMaps.size() > 0) {
|
|
|
|
-// HashMap hashMap = hashMaps.get(0);
|
|
|
|
-// String version = hashMap.get("sha").toString();
|
|
|
|
-// return version;
|
|
|
|
-// }
|
|
|
|
-// } catch (Exception e) {
|
|
|
|
-// e.printStackTrace();
|
|
|
|
-// }
|
|
|
|
-// return StringUtil.getRandomCode();
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public String getGitVersion(String algorithmId) {
|
|
public String getGitVersion(String algorithmId) {
|
|
AlgorithmPO algorithmPO = algorithmMapper.selectDetailsById(algorithmId);
|
|
AlgorithmPO algorithmPO = algorithmMapper.selectDetailsById(algorithmId);
|
|
@@ -291,7 +262,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
String replace = gitUrl.replace(gitConfiguration.getName(), gitConfiguration.getUrl());
|
|
String replace = gitUrl.replace(gitConfiguration.getName(), gitConfiguration.getUrl());
|
|
String gitUserName = algorithmPO.getGitUserName();
|
|
String gitUserName = algorithmPO.getGitUserName();
|
|
String gitPassword = algorithmPO.getGitPassword();
|
|
String gitPassword = algorithmPO.getGitPassword();
|
|
- return GitLabUtil.getLastCommitTimestamp(replace, gitUserName, gitPassword) + "";
|
|
|
|
|
|
+ return String.valueOf(GitLabUtil.getLastCommitTimestamp(replace, gitUserName, gitPassword));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -356,9 +327,9 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ResponseBodyVO selectDetailsById(String algorithmId) {
|
|
|
|
|
|
+ public ResponseBodyVO<Object> selectDetailsById(String algorithmId) {
|
|
if (isEmpty(algorithmId)) {
|
|
if (isEmpty(algorithmId)) {
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE);
|
|
|
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE);
|
|
} else {
|
|
} else {
|
|
AlgorithmPO po = algorithmMapper.selectDetailsById(algorithmId);
|
|
AlgorithmPO po = algorithmMapper.selectDetailsById(algorithmId);
|
|
po.setValidationStatus(getDictName(DictConstants.VALIDATION_STATUS, po.getValidationStatus()));
|
|
po.setValidationStatus(getDictName(DictConstants.VALIDATION_STATUS, po.getValidationStatus()));
|
|
@@ -373,10 +344,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
value = value.trim();
|
|
value = value.trim();
|
|
- if (value.length() == 0) {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- return false;
|
|
|
|
|
|
+ return value.length() == 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|