|
@@ -1,5 +1,10 @@
|
|
|
package cn.seecoder.web.controller.pipeline;
|
|
package cn.seecoder.web.controller.pipeline;
|
|
|
|
|
|
|
|
|
|
+import cn.seecoder.common.exceptions.AccessDeniedException;
|
|
|
|
|
+import cn.seecoder.common.exceptions.ServiceException;
|
|
|
|
|
+import cn.seecoder.web.model.vo.Response;
|
|
|
|
|
+import cn.seecoder.web.model.vo.pipeline.DeploymentInfoVO;
|
|
|
|
|
+import cn.seecoder.web.service.pipeline.DeploymentService;
|
|
|
import cn.seecoder.web.service.user.UserService;
|
|
import cn.seecoder.web.service.user.UserService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
@@ -7,11 +12,6 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
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 cn.seecoder.common.exceptions.AccessDeniedException;
|
|
|
|
|
-import cn.seecoder.common.exceptions.ServiceException;
|
|
|
|
|
-import cn.seecoder.web.model.vo.Response;
|
|
|
|
|
-import cn.seecoder.web.model.vo.pipeline.DeploymentInfoVO;
|
|
|
|
|
-import cn.seecoder.web.service.pipeline.DeploymentService;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
@@ -33,45 +33,45 @@ public class DeploymentController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "获取项目所有部署的实例信息", httpMethod = "GET")
|
|
@ApiOperation(value = "获取项目所有部署的实例信息", httpMethod = "GET")
|
|
|
- @ApiImplicitParam(name = "projectId", dataType ="int", paramType = "query")
|
|
|
|
|
|
|
+ @ApiImplicitParam(name = "projectId", dataType = "int", paramType = "query")
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
- public Response<List<DeploymentInfoVO>> retrieveDeploymentInfos(@RequestParam("projectId")Integer projectId) throws AccessDeniedException {
|
|
|
|
|
|
|
+ public Response<List<DeploymentInfoVO>> retrieveDeploymentInfos(@RequestParam("projectId") Integer projectId) throws AccessDeniedException {
|
|
|
return Response.buildSuccess(deploymentService.retrieveDeploymentInfos(projectId));
|
|
return Response.buildSuccess(deploymentService.retrieveDeploymentInfos(projectId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "执行流水线构建实例", httpMethod = "POST")
|
|
@ApiOperation(value = "执行流水线构建实例", httpMethod = "POST")
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "projectId", dataType ="int",paramType = "query"),
|
|
|
|
|
- @ApiImplicitParam(name = "pipelineId", dataType ="int",paramType = "query")
|
|
|
|
|
|
|
+ @ApiImplicitParam(name = "projectId", dataType = "int", paramType = "query"),
|
|
|
|
|
+ @ApiImplicitParam(name = "pipelineId", dataType = "int", paramType = "query")
|
|
|
})
|
|
})
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
- public Response deploy(@RequestParam("projectId")Integer projectId,
|
|
|
|
|
- @RequestParam("pipelineId")Integer pipelineId) throws ServiceException {
|
|
|
|
|
- deploymentService.deploy(projectId,pipelineId, UserService.loginUser().getId());
|
|
|
|
|
|
|
+ public Response deploy(@RequestParam("projectId") Integer projectId,
|
|
|
|
|
+ @RequestParam("pipelineId") Integer pipelineId) throws ServiceException {
|
|
|
|
|
+ deploymentService.deploy(projectId, pipelineId, UserService.loginUser().getId());
|
|
|
return Response.buildSuccess();
|
|
return Response.buildSuccess();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "删除一个部署的实例", httpMethod = "DELETE")
|
|
@ApiOperation(value = "删除一个部署的实例", httpMethod = "DELETE")
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "projectId", dataType ="int",paramType = "query"),
|
|
|
|
|
- @ApiImplicitParam(name = "pipelineId", dataType ="int",paramType = "query")
|
|
|
|
|
|
|
+ @ApiImplicitParam(name = "projectId", dataType = "int", paramType = "query"),
|
|
|
|
|
+ @ApiImplicitParam(name = "pipelineId", dataType = "int", paramType = "query")
|
|
|
})
|
|
})
|
|
|
@DeleteMapping
|
|
@DeleteMapping
|
|
|
- public Response delete(@RequestParam("projectId")Integer projectId,
|
|
|
|
|
- @RequestParam("pipelineId")Integer pipelineId) throws ServiceException {
|
|
|
|
|
- deploymentService.delete(projectId,pipelineId);
|
|
|
|
|
|
|
+ public Response delete(@RequestParam("projectId") Integer projectId,
|
|
|
|
|
+ @RequestParam("pipelineId") Integer pipelineId) throws ServiceException {
|
|
|
|
|
+ deploymentService.delete(projectId, pipelineId);
|
|
|
return Response.buildSuccess();
|
|
return Response.buildSuccess();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "获取一个部署的实例的日志", httpMethod = "GET")
|
|
@ApiOperation(value = "获取一个部署的实例的日志", httpMethod = "GET")
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "projectId", dataType ="int",paramType = "query"),
|
|
|
|
|
- @ApiImplicitParam(name = "pipelineId", dataType ="int",paramType = "query")
|
|
|
|
|
|
|
+ @ApiImplicitParam(name = "projectId", dataType = "int", paramType = "query"),
|
|
|
|
|
+ @ApiImplicitParam(name = "pipelineId", dataType = "int", paramType = "query")
|
|
|
})
|
|
})
|
|
|
@GetMapping("/log")
|
|
@GetMapping("/log")
|
|
|
- public Response log(@RequestParam("projectId")Integer projectId,
|
|
|
|
|
- @RequestParam("pipelineId")Integer pipelineId) throws ServiceException {
|
|
|
|
|
- return Response.buildSuccess(deploymentService.log(projectId,pipelineId));
|
|
|
|
|
|
|
+ public Response log(@RequestParam("projectId") Integer projectId,
|
|
|
|
|
+ @RequestParam("pipelineId") Integer pipelineId) throws ServiceException {
|
|
|
|
|
+ return Response.buildSuccess(deploymentService.log(projectId, pipelineId));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|