Commit b8e118ce authored by 黎博's avatar 黎博

修改从qaapi获取分支,去掉gitlabservice的@Compoment

parent eb9c3c09
......@@ -3,6 +3,7 @@ package cn.qg.holmes.controller.gitlab;
import cn.qg.holmes.common.JsonResult;
import cn.qg.holmes.utils.GitlabService;
import cn.qg.holmes.utils.HttpClientUtils;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.CrossOrigin;
......@@ -62,7 +63,9 @@ public class GitlabController {
*/
@GetMapping("/branches")
public JsonResult getBranchesByProject(String projectName) {
List<String> branches = gitlabService.getBranchesByProjectName(projectName);
return JsonResult.buildSuccessResult(branches);
String url = "https://qaapi.liangkebang.com/pipeline/getGitBranch?name=" + projectName;
return JsonResult.buildSuccessResult(JSON.parseObject(HttpClientUtils.doGet(url), Map.class));
// List<String> branches = gitlabService.getBranchesByProjectName(projectName);
// return JsonResult.buildSuccessResult(branches);
}
}
......@@ -28,6 +28,7 @@ public class PipelineServiceImpl extends ServiceImpl<PipelineMapper, Pipeline> i
@Autowired
DingRobotService dingRobotService;
/**
* 构建pipeline
* @param gitlabData gitlab发送过来的推送事件
......
......@@ -10,7 +10,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component
public class GitlabService {
private static final String URL = "http://git.quantgroup.cn/";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment