|
@@ -1,14 +1,22 @@
|
|
|
package seecoder.devcloud.web.controller.pipeline;
|
|
package seecoder.devcloud.web.controller.pipeline;
|
|
|
|
|
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.ibatis.annotations.Delete;
|
|
import org.apache.ibatis.annotations.Delete;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import seecoder.devcloud.web.model.vo.Response;
|
|
import seecoder.devcloud.web.model.vo.Response;
|
|
|
|
|
+import seecoder.devcloud.web.model.vo.pipeline.PipelineConfigVO;
|
|
|
import seecoder.devcloud.web.model.vo.pipeline.PipelineCreateVO;
|
|
import seecoder.devcloud.web.model.vo.pipeline.PipelineCreateVO;
|
|
|
|
|
+import seecoder.devcloud.web.model.vo.pipeline.PipelineHistoryVO;
|
|
|
|
|
+import seecoder.devcloud.web.model.vo.pipeline.PipelineInfoVO;
|
|
|
import seecoder.devcloud.web.service.pipeline.PipelineService;
|
|
import seecoder.devcloud.web.service.pipeline.PipelineService;
|
|
|
|
|
|
|
|
import javax.ws.rs.GET;
|
|
import javax.ws.rs.GET;
|
|
|
import javax.ws.rs.PUT;
|
|
import javax.ws.rs.PUT;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author PuHong Weng
|
|
* @author PuHong Weng
|
|
@@ -17,6 +25,7 @@ import javax.ws.rs.PUT;
|
|
|
*/
|
|
*/
|
|
|
@RestController("/pipelines")
|
|
@RestController("/pipelines")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
|
|
+@Api(value = "流水线配置")
|
|
|
public class PipelineController {
|
|
public class PipelineController {
|
|
|
|
|
|
|
|
private final PipelineService pipelineService;
|
|
private final PipelineService pipelineService;
|
|
@@ -30,42 +39,51 @@ public class PipelineController {
|
|
|
* 获取一个项目所有的流水线信息
|
|
* 获取一个项目所有的流水线信息
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
- public Response retrievePipelineInfos(@RequestParam("projectId") Integer projectId){
|
|
|
|
|
|
|
+ @ApiOperation(value = "获取指定一条流水线的配置json信息", httpMethod = "GET")
|
|
|
|
|
+ @ApiImplicitParam(name = "projectId", dataType = "int")
|
|
|
|
|
+ public Response<List<PipelineInfoVO>> retrievePipelineInfos(@RequestParam("projectId") Integer projectId){
|
|
|
return Response.buildSuccess(pipelineService.retrievePipelineInfos(projectId));
|
|
return Response.buildSuccess(pipelineService.retrievePipelineInfos(projectId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 获取指定一条流水线的配置json信息
|
|
|
|
|
- */
|
|
|
|
|
@GetMapping
|
|
@GetMapping
|
|
|
- public Response retrievePipelineConfig(@RequestParam("projectId")Integer projectId,
|
|
|
|
|
- @RequestParam("pipelineId")Integer pipelineId){
|
|
|
|
|
|
|
+ @ApiOperation(value = "获取指定一条流水线的配置json信息", httpMethod = "GET")
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
|
+ @ApiImplicitParam(name = "projectId", dataType = "int"),
|
|
|
|
|
+ @ApiImplicitParam(name = "pipelineId", dataType = "int")
|
|
|
|
|
+ })
|
|
|
|
|
+ public Response<PipelineConfigVO> retrievePipelineConfig(@RequestParam("projectId")Integer projectId,
|
|
|
|
|
+ @RequestParam("pipelineId")Integer pipelineId){
|
|
|
|
|
|
|
|
return Response.buildSuccess(pipelineService.retrievePipelineConfig(projectId, pipelineId));
|
|
return Response.buildSuccess(pipelineService.retrievePipelineConfig(projectId, pipelineId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 获取指定一条流水线的历史构建信息
|
|
|
|
|
- */
|
|
|
|
|
@GetMapping("/history/list")
|
|
@GetMapping("/history/list")
|
|
|
- public Response retrievePipelineHistory(@RequestParam("projectId")Integer projectId,
|
|
|
|
|
- @RequestParam("pipelineId")Integer pipelineId){
|
|
|
|
|
|
|
+ @ApiOperation(value = "获取指定一条流水线的历史构建信息列表", httpMethod = "GET")
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
|
+ @ApiImplicitParam(name = "projectId", dataType = "int"),
|
|
|
|
|
+ @ApiImplicitParam(name = "pipelineId", dataType = "int")
|
|
|
|
|
+ })
|
|
|
|
|
+ public Response<List<PipelineHistoryVO>> retrievePipelineHistory(@RequestParam("projectId")Integer projectId,
|
|
|
|
|
+ @RequestParam("pipelineId")Integer pipelineId){
|
|
|
return Response.buildSuccess(pipelineService.retrievePipelineHistory(projectId,pipelineId));
|
|
return Response.buildSuccess(pipelineService.retrievePipelineHistory(projectId,pipelineId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 依据模板创建一个流水线配置
|
|
|
|
|
- */
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "依据模板创建一个流水线配置", httpMethod = "POST")
|
|
|
|
|
+ @ApiImplicitParam(name = "pipelineCreateVO", value = "流水线创建配置信息",dataType = "PipelineCreateVO")
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
public Response createPipelineConfig(@RequestBody PipelineCreateVO pipelineCreateVO){
|
|
public Response createPipelineConfig(@RequestBody PipelineCreateVO pipelineCreateVO){
|
|
|
pipelineService.createPipelineConfig(pipelineCreateVO);
|
|
pipelineService.createPipelineConfig(pipelineCreateVO);
|
|
|
return Response.buildSuccess();
|
|
return Response.buildSuccess();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 保存一条流水线的配置json信息
|
|
|
|
|
- */
|
|
|
|
|
@PutMapping("/config")
|
|
@PutMapping("/config")
|
|
|
|
|
+ @ApiOperation(value = "保存修改一条流水线的json配置信息", httpMethod = "PUT")
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
|
+ @ApiImplicitParam(name = "projectId", dataType = "int"),
|
|
|
|
|
+ @ApiImplicitParam(name = "pipelineId", dataType = "int"),
|
|
|
|
|
+ @ApiImplicitParam(name = "configJson", dataType = "String")
|
|
|
|
|
+ })
|
|
|
public Response savePipelineConfig(@RequestParam("projectId")Integer projectId,
|
|
public Response savePipelineConfig(@RequestParam("projectId")Integer projectId,
|
|
|
@RequestParam("pipelineId")Integer pipelineId,
|
|
@RequestParam("pipelineId")Integer pipelineId,
|
|
|
@RequestParam("configJson")String configJson){
|
|
@RequestParam("configJson")String configJson){
|
|
@@ -74,9 +92,11 @@ public class PipelineController {
|
|
|
return Response.buildSuccess();
|
|
return Response.buildSuccess();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 删除一条流水线
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ @ApiOperation(value = "删除一条流水线", httpMethod = "PUT")
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
|
+ @ApiImplicitParam(name = "projectId", dataType = "int"),
|
|
|
|
|
+ @ApiImplicitParam(name = "pipelineId", dataType = "int"),
|
|
|
|
|
+ })
|
|
|
@DeleteMapping
|
|
@DeleteMapping
|
|
|
public Response deletePipelineInfo(Integer projectId,Integer pipelineId){
|
|
public Response deletePipelineInfo(Integer projectId,Integer pipelineId){
|
|
|
pipelineService.deletePipelineConfig(projectId, pipelineId);
|
|
pipelineService.deletePipelineConfig(projectId, pipelineId);
|