|
@@ -4,6 +4,7 @@ import api.common.pojo.param.algorithm.AlgorithmParameter;
|
|
import api.common.pojo.param.system.DictParam;
|
|
import api.common.pojo.param.system.DictParam;
|
|
import api.common.pojo.po.algorithm.AlgorithmPO;
|
|
import api.common.pojo.po.algorithm.AlgorithmPO;
|
|
import api.common.pojo.constants.DictConstants;
|
|
import api.common.pojo.constants.DictConstants;
|
|
|
|
+import api.common.util.JgitUtil;
|
|
import api.common.util.StringUtil;
|
|
import api.common.util.StringUtil;
|
|
import api.common.pojo.vo.algorithm.AlgorithmVO;
|
|
import api.common.pojo.vo.algorithm.AlgorithmVO;
|
|
import api.common.pojo.vo.algorithm.RunningProjectVO;
|
|
import api.common.pojo.vo.algorithm.RunningProjectVO;
|
|
@@ -12,13 +13,12 @@ import com.css.simulation.resource.common.utils.AuthUtil;
|
|
import com.css.simulation.resource.common.utils.PageUtil;
|
|
import com.css.simulation.resource.common.utils.PageUtil;
|
|
import com.css.simulation.resource.algorithm.mapper.AlgorithmMapper;
|
|
import com.css.simulation.resource.algorithm.mapper.AlgorithmMapper;
|
|
import com.css.simulation.resource.algorithm.service.AlgorithmService;
|
|
import com.css.simulation.resource.algorithm.service.AlgorithmService;
|
|
-import com.css.simulation.resource.feign.FileDownService;
|
|
|
|
import com.css.simulation.resource.system.service.DictService;
|
|
import com.css.simulation.resource.system.service.DictService;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
+import org.eclipse.jgit.lib.Ref;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -31,9 +31,6 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
DictService dictService;
|
|
DictService dictService;
|
|
-
|
|
|
|
- @Resource
|
|
|
|
- FileDownService fileDownService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ResponseBodyVO addOrUpdate(AlgorithmParameter param) {
|
|
public ResponseBodyVO addOrUpdate(AlgorithmParameter param) {
|
|
@@ -117,7 +114,12 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ResponseBodyVO testConnection(AlgorithmParameter param) {
|
|
public ResponseBodyVO testConnection(AlgorithmParameter param) {
|
|
- return null;
|
|
|
|
|
|
+ try{
|
|
|
|
+ Map<String, Ref> asMap = JgitUtil.testConnectionByToken(param.getGitUrl(),param.getGitToken());
|
|
|
|
+ } catch (Exception e){
|
|
|
|
+ return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE,"连接失败!");
|
|
|
|
+ }
|
|
|
|
+ return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,"连接成功");
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|