Sfoglia il codice sorgente

修改打分命令

root 2 anni fa
parent
commit
853d511d59

+ 5 - 5
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/manager/TaskManager.java

@@ -452,11 +452,11 @@ public class TaskManager {
 
 
         // 删除 kafka topic
-        SshClient clientKafka = SshUtil.getClient();
-        ClientSession sessionKafka = SshUtil.getSession(clientKafka, hostnameKafka, usernameKafka, passwordKafka);
-        String topicDeleteCommand = StringUtil.replace(kafkaDeleteCommand, "topicName", projectId);
-        SshUtil.execute(sessionKafka, topicDeleteCommand);
-        SshUtil.stop(clientKafka, sessionKafka);
+//        SshClient clientKafka = SshUtil.getClient();
+//        ClientSession sessionKafka = SshUtil.getSession(clientKafka, hostnameKafka, usernameKafka, passwordKafka);
+//        String topicDeleteCommand = StringUtil.replace(kafkaDeleteCommand, "topicName", projectId);
+//        SshUtil.execute(sessionKafka, topicDeleteCommand);
+//        SshUtil.stop(clientKafka, sessionKafka);
 
 
         // 归还并行度

+ 2 - 1
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/service/ProjectService.java

@@ -437,7 +437,8 @@ public class ProjectService {
                 String tempReplace4 = podTemplateStringOfProject.replace("pod-name", podName); // pod 名称包括 projectId 和 随机字符串
                 String tempReplace5 = tempReplace4.replace("namespace-name", kubernetesConfiguration.getNamespace()); // pod 名称包括 projectId 和 随机字符串
                 String tempPodString = tempReplace5.replace("node-name", nodeName);     // 指定 pod 运行节点
-                log.info("ProjectService--createPod 在节点 " + nodeName + " 开始执行 pod:" + tempPodString);
+//                log.info("ProjectService--createPod 在节点 " + nodeName + " 开始执行 pod:" + tempPodString);
+                log.info("ProjectService--createPod 在节点 " + nodeName + " 开始执行 pod。");
                 projectUtil.createPod(nodeName, podName, tempPodString);
             }
         });

+ 1 - 5
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/ctrl/AlgorithmCtrl.java

@@ -107,19 +107,15 @@ public class AlgorithmCtrl {
 
     /**
      * git测试连接
-     * @param param
-     * @return
      */
     @RequestMapping("testConnection")
     @ResponseBody
-    public ResponseBodyVO testConnection(@RequestBody AlgorithmParameter param){
+    public ResponseBodyVO<String> testConnection(@RequestBody AlgorithmParameter param){
         return service.testConnection(param);
     }
 
     /**
      * 根据git仓库地址获取版本号
-     * @param param
-     * @return
      */
     @RequestMapping("getGitVersion")
     @ResponseBody

+ 1 - 4
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/service/AlgorithmService.java

@@ -4,9 +4,6 @@ import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.param.algorithm.AlgorithmParameter;
 
 import java.io.IOException;
-import java.security.KeyManagementException;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
 import java.util.Map;
 
 
@@ -26,7 +23,7 @@ public interface AlgorithmService {
 
     ResponseBodyVO shareAlgorithm(AlgorithmParameter param);
 
-    ResponseBodyVO testConnection(AlgorithmParameter param);
+    ResponseBodyVO<String> testConnection(AlgorithmParameter param);
 
     String getGitVersion(String algorithmId);
 

+ 95 - 84
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/serviceImpl/AlgorithmServiceImpl.java

@@ -14,16 +14,16 @@ import com.css.simulation.resource.algorithm.service.AlgorithmService;
 import com.css.simulation.resource.common.utils.AuthUtil;
 import com.css.simulation.resource.common.utils.PageUtil;
 import com.css.simulation.resource.common.utils.PoUtil;
+import com.css.simulation.resource.configuration.git.GitConfiguration;
 import com.css.simulation.resource.feign.AlgoPlatformService;
 import com.css.simulation.resource.feign.FileDownService;
 import com.css.simulation.resource.feign.SchedulerService;
 import com.css.simulation.resource.system.service.DictService;
 import com.github.pagehelper.PageInfo;
-import org.eclipse.jgit.lib.Ref;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -32,20 +32,31 @@ import java.util.Map;
 @Service
 public class AlgorithmServiceImpl implements AlgorithmService {
 
-    @Resource
     AlgoPlatformService algoPlatformService;
-
-    @Resource
     SchedulerService schedulerService;
-
-    @Resource
     FileDownService fileDownService;
+    AlgorithmMapper algorithmMapper;
+    DictService dictService;
+    GitConfiguration gitConfiguration;
 
     @Autowired
-    private AlgorithmMapper algorithmMapper;
+    public AlgorithmServiceImpl(AlgoPlatformService algoPlatformService,
+                                SchedulerService schedulerService,
+                                @Qualifier("com.css.simulation.resource.feign.FileDownService") FileDownService fileDownService,
+                                AlgorithmMapper algorithmMapper,
+                                DictService dictService,
+                                GitConfiguration gitConfiguration
+    ) {
+        this.algoPlatformService = algoPlatformService;
+        this.schedulerService = schedulerService;
+        this.fileDownService = fileDownService;
+        this.algorithmMapper = algorithmMapper;
+        this.dictService = dictService;
+        this.gitConfiguration = gitConfiguration;
+    }
+
+    //* -------------------------------- Comment --------------------------------
 
-    @Autowired
-    DictService dictService;
 
     @Override
     public ResponseBodyVO addOrUpdate(AlgorithmParameter param) {
@@ -53,21 +64,21 @@ public class AlgorithmServiceImpl implements AlgorithmService {
         String currentUserId = AuthUtil.getCurrentUserId();
         param.setCreateUserId(currentUserId);
         List<AlgorithmPO> algorithmPOS = algorithmMapper.selectAlgorithmName(param);
-        if(algorithmPOS != null && algorithmPOS.size() > 0){
-            return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"该算法名称已存在!");
-        }else {
+        if (algorithmPOS != null && algorithmPOS.size() > 0) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "该算法名称已存在!");
+        } else {
             String uploadMode = param.getUploadMode();
-            if(DictConstants.FILE.equals(uploadMode)){
+            if (DictConstants.FILE.equals(uploadMode)) {
                 String minioPath = param.getMinioPath();
                 ResponseBodyVO<String> checkRes = schedulerService.check(minioPath);
-                if(ObjectUtil.isNull(checkRes)){
-                    return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"算法校验服务异常,请联系管理人员!");
+                if (ObjectUtil.isNull(checkRes)) {
+                    return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "算法校验服务异常,请联系管理人员!");
                 }
-                if(!checkRes.isStatus()){//校验失败
+                if (!checkRes.isStatus()) {//校验失败
                     MinioParameter minioParameter = new MinioParameter();
                     minioParameter.setObjectName(minioPath);
                     fileDownService.remove(minioParameter);
-                    return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"该算法经校验不可用,无法保存!");
+                    return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "该算法经校验不可用,无法保存!");
                 }
             }
             return doAddOrUpdate(param);
@@ -75,7 +86,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
     }
 
     private ResponseBodyVO doAddOrUpdate(AlgorithmParameter param) {
-        if(isEmpty(param.getId())){
+        if (isEmpty(param.getId())) {
             //添加
             String algorithmId = StringUtil.getRandomUUID();
             param.setId(algorithmId);
@@ -83,20 +94,20 @@ public class AlgorithmServiceImpl implements AlgorithmService {
             param.setAlgorithmCode(algorithmCode);
             AlgorithmPO po = setPo(param, false);
             int add = algorithmMapper.add(po);
-            if(add > 0){
+            if (add > 0) {
                 LogUtil.insert();
                 return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
-            }else {
-                return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"添加失败");
+            } else {
+                return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "添加失败");
             }
-        }else {
+        } else {
             //编辑
             AlgorithmPO po = setPo(param, true);
             int add = algorithmMapper.update(po);
             if (add > 0) {
                 LogUtil.update();
                 return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
-            }else {
+            } else {
                 return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "编辑失败");
             }
         }
@@ -104,19 +115,19 @@ public class AlgorithmServiceImpl implements AlgorithmService {
     }
 
     @Override
-    public ResponseBodyVO selectAlgorithmList(AlgorithmParameter param){
+    public ResponseBodyVO selectAlgorithmList(AlgorithmParameter param) {
         param.setIsDeleted("0");
         param.setCreateUserId(AuthUtil.getCurrentUserId());
         PageUtil.setPageInfo(param);
         List<AlgorithmVO> vos = algorithmMapper.selectAlgorithmList(param);
-        for (AlgorithmVO vo:vos){
+        for (AlgorithmVO vo : vos) {
             vo.setValidationStatus(getDictName(DictConstants.VALIDATION_STATUS, vo.getValidationStatus()));
         }
-        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS,new PageInfo<>(vos));
+        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, new PageInfo<>(vos));
     }
 
     @Override
-    public ResponseBodyVO selectAlgoPlatformList(AlgorithmParameter param){
+    public ResponseBodyVO selectAlgoPlatformList(AlgorithmParameter param) {
         //获取参数
         String algorithmId = param.getAlgorithmCode();
         String algorithmName = param.getAlgorithmName();
@@ -125,19 +136,19 @@ public class AlgorithmServiceImpl implements AlgorithmService {
         Integer size = param.getPageSize();
         String sort = "algorithmId-desc";
         String urlParam = "";
-        if (StringUtil.isNotEmpty(algorithmId)){
+        if (StringUtil.isNotEmpty(algorithmId)) {
             urlParam = urlParam + "&algorithmId=" + algorithmId;
         }
-        if (StringUtil.isNotEmpty(algorithmName)){
+        if (StringUtil.isNotEmpty(algorithmName)) {
             urlParam = urlParam + "&algorithmName=" + algorithmName;
         }
-        if (StringUtil.isNotEmpty(description)){
+        if (StringUtil.isNotEmpty(description)) {
             urlParam = urlParam + "&description=" + description;
         }
-        if (StringUtil.isNotEmpty(page)){
+        if (StringUtil.isNotEmpty(page)) {
             urlParam = urlParam + "&page=" + page;
         }
-        if (StringUtil.isNotEmpty(size)){
+        if (StringUtil.isNotEmpty(size)) {
             urlParam = urlParam + "&size=" + size;
         }
         urlParam = urlParam + "&sort=" + sort;
@@ -150,8 +161,8 @@ public class AlgorithmServiceImpl implements AlgorithmService {
         List<Map<String, String>> contentList = (List<Map<String, String>>) dataMap.get("content");
         Integer totalElements = (Integer) dataMap.get("totalElements");
         List<AlgorithmVO> vos = new ArrayList<>();
-        if(totalElements > 0){
-            for (Map<String, String> content: contentList) {
+        if (totalElements > 0) {
+            for (Map<String, String> content : contentList) {
                 AlgorithmVO vo = new AlgorithmVO();
                 vo.setId(content.get("id"));
                 vo.setAlgorithmCode(content.get("algorithmId"));
@@ -163,7 +174,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
         PageInfo<AlgorithmVO> objectPageInfo = new PageInfo<>(vos);
         objectPageInfo.setTotal(totalElements);
 
-        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS,objectPageInfo);
+        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, objectPageInfo);
     }
 
 
@@ -172,63 +183,63 @@ public class AlgorithmServiceImpl implements AlgorithmService {
         param.setShare("1");
         PageUtil.setPageInfo(param);
         List<AlgorithmVO> vos = algorithmMapper.selectSharedAlgorithmList(param);
-        for (AlgorithmVO vo:vos){
+        for (AlgorithmVO vo : vos) {
             vo.setValidationStatus(getDictName(DictConstants.VALIDATION_STATUS, vo.getValidationStatus()));
         }
-        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS,new PageInfo<>(vos));
+        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, new PageInfo<>(vos));
     }
 
     @Override
     public ResponseBodyVO shareAlgorithm(AlgorithmParameter param) {
-        if(isEmpty(param.getId())){
+        if (isEmpty(param.getId())) {
             return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE);
-        }else {
+        } else {
             String algorithmId = param.getId();
             AlgorithmPO po = algorithmMapper.selectDetailsById(algorithmId);
             List<AlgorithmPO> algorithmPOS = algorithmMapper.selectSharedAlgorithmName(po.getAlgorithmName());
-            if(algorithmPOS != null && algorithmPOS.size() > 0){
-                return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"该算法名称已存在, 无法分享!");
-            }else {
+            if (algorithmPOS != null && algorithmPOS.size() > 0) {
+                return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "该算法名称已存在, 无法分享!");
+            } else {
                 po.setShare("1");
                 po.setId(StringUtil.getRandomUUID());
                 po.setAlgorithmCode(StringUtil.getRandomCode());
                 int add = algorithmMapper.add(po);
-                if(add > 0){
+                if (add > 0) {
                     LogUtil.share();
-                    return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,"分享成功");
+                    return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, "分享成功");
                 }
-                return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"分享失败");
+                return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "分享失败");
 
             }
         }
     }
 
     @Override
-    public ResponseBodyVO testConnection(AlgorithmParameter param) {
-        try{
-            Map<String, Ref> asMap = JgitUtil.testConnection(param.getGitUrl(), param.getGitUserName(), param.getGitPassword());
-        } catch (Exception e){
-            return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"连接失败!");
+    public ResponseBodyVO<String> testConnection(AlgorithmParameter param) {
+        try {
+            JgitUtil.testConnection(param.getGitUrl().replace(gitConfiguration.getName(), gitConfiguration.getUrl()), param.getGitUserName(), param.getGitPassword());
+            return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, "连接成功");
+        } catch (Exception e) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "连接失败!");
         }
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,"连接成功");
     }
 
     @Override
-    public String getGitVersion(String algorithmId)  {
+    public String getGitVersion(String algorithmId) {
         AlgorithmPO po = algorithmMapper.selectDetailsById(algorithmId);
         String gitUrl = po.getGitUrl();
-        if(StringUtil.isEmpty(gitUrl)){
+        if (StringUtil.isEmpty(gitUrl)) {
             return "";
         }
         //拼接get请求地址
         String prefix = "https://api.github.com/repos/";
         String suffix = "/commits?page=1&per_page=1";
-        String gitInfo = gitUrl.substring(19, gitUrl.length()-4);
+        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){
+            if (hashMaps.size() > 0) {
                 HashMap hashMap = hashMaps.get(0);
                 String version = hashMap.get("sha").toString();
                 return version;
@@ -242,26 +253,26 @@ public class AlgorithmServiceImpl implements AlgorithmService {
 
     @Override
     public ResponseBodyVO deleteByid(AlgorithmParameter param) {
-        if(isEmpty(param.getId())){
+        if (isEmpty(param.getId())) {
             return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE);
-        }else {
+        } else {
             String algorithmId = param.getId();
             List<RunningProjectVO> runningProjectVos = algorithmMapper.selectRunningProject(algorithmId);
-            if(runningProjectVos != null && runningProjectVos.size() > 0){
+            if (runningProjectVos != null && runningProjectVos.size() > 0) {
                 StringBuffer stringBuffer = new StringBuffer("");
-                for (RunningProjectVO vo:runningProjectVos){
+                for (RunningProjectVO vo : runningProjectVos) {
                     String projectId = vo.getProjectId();
-                    stringBuffer.append(projectId+",");
+                    stringBuffer.append(projectId + ",");
                 }
                 String substring = stringBuffer.substring(0, stringBuffer.lastIndexOf(","));
-                return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"已被工作ID:"+ substring +" 应用,无法删除!");
-            }else {
+                return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "已被工作ID:" + substring + " 应用,无法删除!");
+            } else {
                 int i = algorithmMapper.deleteByid(param);
-                if(i > 0){
+                if (i > 0) {
                     LogUtil.delete();
                     return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
                 }
-                return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"删除失败");
+                return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "删除失败");
             }
         }
 
@@ -269,44 +280,44 @@ public class AlgorithmServiceImpl implements AlgorithmService {
 
     @Override
     public ResponseBodyVO selectDetailsById(String algorithmId) {
-        if(isEmpty(algorithmId)){
+        if (isEmpty(algorithmId)) {
             return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE);
-        }else {
+        } else {
             AlgorithmPO po = algorithmMapper.selectDetailsById(algorithmId);
             po.setValidationStatus(getDictName(DictConstants.VALIDATION_STATUS, po.getValidationStatus()));
-            return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS,po);
+            return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, po);
         }
 
     }
 
 
-    private boolean isEmpty(String value){
-        if(value == null){
+    private boolean isEmpty(String value) {
+        if (value == null) {
             return true;
         }
         value = value.trim();
-        if(value.length() == 0){
+        if (value.length() == 0) {
             return true;
         }
         return false;
     }
 
 
-    private AlgorithmPO setPo(AlgorithmParameter param,  Boolean isEdit) {
+    private AlgorithmPO setPo(AlgorithmParameter param, Boolean isEdit) {
 
         AlgorithmPO po = new AlgorithmPO();
         //设置po信息
-        if(DictConstants.GIT.equals(param.getUploadMode())){ //使用仓库地址上传
+        if (DictConstants.GIT.equals(param.getUploadMode())) { //使用仓库地址上传
             String gitUrl = param.getGitUrl();
             String gitUserName = param.getGitUserName();
             String gitPassword = param.getGitPassword();
             po.setGitUrl(gitUrl);
             po.setGitUserName(gitUserName);
             po.setGitPassword(gitPassword);
-        }else {
+        } else {
             String minioPath = param.getMinioPath();
             String[] splits = minioPath.split("/");
-            String fileName = splits[splits.length-1];
+            String fileName = splits[splits.length - 1];
             po.setMinioPath(param.getMinioPath());
             po.setFileName(fileName);
         }
@@ -318,9 +329,9 @@ public class AlgorithmServiceImpl implements AlgorithmService {
         po.setShare(DictConstants.NO);
         po.setId(param.getId());
 
-        if(isEdit){
+        if (isEdit) {
             PoUtil.initUpdatePo(po);
-        }else {
+        } else {
             PoUtil.initAddPo(po);
         }
         return po;
@@ -332,7 +343,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
         dictParam.setDictTypes(type);
         Map<String, Map<String, String>> dictMapsByTypes = dictService.getDictMapsByTypes(dictParam);
         Map<String, String> stringStringMap = dictMapsByTypes.get(type);
-        if(stringStringMap != null && stringStringMap.size() > 0){
+        if (stringStringMap != null && stringStringMap.size() > 0) {
             return stringStringMap.get(code);
         }
         return "";
@@ -340,16 +351,16 @@ public class AlgorithmServiceImpl implements AlgorithmService {
 
     @Override
     public Map selectDetailsBySy() {
-        AlgorithmParameter param=new AlgorithmParameter();
+        AlgorithmParameter param = new AlgorithmParameter();
         param.setUploadMode("1");
         param.setShare("0");
         param.setCreateUserId(AuthUtil.getCurrentUserId());
-        int fileNum= algorithmMapper.selectDetailsBySy(param);
+        int fileNum = algorithmMapper.selectDetailsBySy(param);
         param.setUploadMode("2");
-        int pathNum= algorithmMapper.selectDetailsBySy(param);
-        Map map=new HashMap();
-        map.put("fileNum",fileNum);
-        map.put("pathNum",pathNum);
+        int pathNum = algorithmMapper.selectDetailsBySy(param);
+        Map map = new HashMap();
+        map.put("fileNum", fileNum);
+        map.put("pathNum", pathNum);
         return map;
     }
 

+ 13 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/configuration/git/GitConfiguration.java

@@ -0,0 +1,13 @@
+package com.css.simulation.resource.configuration.git;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@ConfigurationProperties(prefix = "git")
+@Data
+public class GitConfiguration {
+    private String name;
+    private String url;
+}

+ 1 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -1380,7 +1380,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
     private void setAlgorithmDropDown(List<DropDownTypeVo> result, String algorithmType) {
 
         List<DropDownVo> algorithmList = new ArrayList<>();
-        if (DictConstants.FILE.equals(algorithmType)) {
+        if (DictConstants.FILE.equals(algorithmType) || DictConstants.GIT.equals(algorithmType)) {
             AlgorithmPO algorithmPO = new AlgorithmPO();
             algorithmPO.setCreateUserId(AuthUtil.getCurrentUserId());   // 获取当前用户 id
             if (StringUtil.isEmpty(algorithmType)) {