|
@@ -1,24 +1,22 @@
|
|
|
-package com.css.simulation.resource.common.controller;
|
|
|
+package com.css.simulation.resource.common.acl.algorithm;
|
|
|
|
|
|
import api.common.pojo.common.ResponseBodyVO;
|
|
|
import api.common.pojo.param.RedisParameter;
|
|
|
import api.common.util.HttpUtil;
|
|
|
import api.common.util.JsonUtil;
|
|
|
import api.common.util.ObjectUtil;
|
|
|
-import com.css.simulation.resource.common.configuration.algPlatform.ClientDetail;
|
|
|
+import com.css.simulation.resource.common.api.controller.RedisController;
|
|
|
+import com.css.simulation.resource.common.infrastructure.configuration.algPlatform.ClientDetail;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import lombok.SneakyThrows;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
-@RestController
|
|
|
-@RequestMapping("/algPlatform")
|
|
|
-public class AlgorithmPlatformController {
|
|
|
-
|
|
|
+@Service
|
|
|
+public class AlgorithmExpandAcl {
|
|
|
private static final String TOKEN_KEY = "ALGPLATFORM:TOKEN";
|
|
|
|
|
|
@Resource
|
|
@@ -27,7 +25,28 @@ public class AlgorithmPlatformController {
|
|
|
@Resource
|
|
|
private ClientDetail clientDetail;
|
|
|
|
|
|
- @RequestMapping("/getAlgorithmList")
|
|
|
+ /**
|
|
|
+ * String urlParam = "";
|
|
|
+ * if (StringUtil.isNotEmpty(algorithmId)) {
|
|
|
+ * urlParam = urlParam + "&algorithmId=" + algorithmId;
|
|
|
+ * }
|
|
|
+ * if (StringUtil.isNotEmpty(algorithmName)) {
|
|
|
+ * urlParam = urlParam + "&algorithmName=" + algorithmName;
|
|
|
+ * }
|
|
|
+ * if (StringUtil.isNotEmpty(description)) {
|
|
|
+ * urlParam = urlParam + "&description=" + description;
|
|
|
+ * }
|
|
|
+ * if (StringUtil.isNotEmpty(page)) {
|
|
|
+ * urlParam = urlParam + "&page=" + page;
|
|
|
+ * }
|
|
|
+ * if (StringUtil.isNotEmpty(size)) {
|
|
|
+ * urlParam = urlParam + "&size=" + size;
|
|
|
+ * }
|
|
|
+ * urlParam = urlParam + "&sort=" + sort;
|
|
|
+ *
|
|
|
+ * @param param 参数
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
public ResponseBodyVO<String> getAlgorithmList(@RequestBody String param) {
|
|
|
//取得token
|
|
|
String token = getToken();
|
|
@@ -36,16 +55,17 @@ public class AlgorithmPlatformController {
|
|
|
}
|
|
|
String algorithmListUri = clientDetail.getAlgorithmListUri() + "?access_token=" + token + param;
|
|
|
String result = HttpUtil.get(HttpUtil.getHttpClient(), HttpUtil.getRequestConfig(), algorithmListUri);
|
|
|
+
|
|
|
+
|
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, "请求成功!", result);
|
|
|
}
|
|
|
|
|
|
- @RequestMapping("/selectAlgorithmNameByAlgorithmId")
|
|
|
@SneakyThrows
|
|
|
public ResponseBodyVO<String> selectAlgorithmNameByAlgorithmId(@RequestBody String algorithmId) {
|
|
|
//取得token
|
|
|
String token = getToken();
|
|
|
if (ObjectUtil.isNull(token)) {
|
|
|
- return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE, "AlgPlatformCtrl--selectAlgorithmNameByAlgorithmId 获取算法平台token失败。");
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE, "获取算法平台token失败。");
|
|
|
}
|
|
|
String algorithmListUri = clientDetail.getAlgorithmListUri()
|
|
|
+ "?algorithmId=" + algorithmId
|