|
|
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import seecoder.devcloud.common.exceptions.AccessDeniedException;
|
|
|
import seecoder.devcloud.web.model.vo.Response;
|
|
|
import seecoder.devcloud.web.model.vo.pipeline.DeploymentInfoVO;
|
|
|
import seecoder.devcloud.web.service.pipeline.DeploymentService;
|
|
|
@@ -32,7 +33,7 @@ public class DeploymentController {
|
|
|
@ApiOperation(value = "获取项目所有部署的实例信息", httpMethod = "GET")
|
|
|
@ApiImplicitParam(name = "projectId", dataType ="int", paramType = "query")
|
|
|
@GetMapping("/list")
|
|
|
- public Response<List<DeploymentInfoVO>> retrieveDeploymentInfos(@RequestParam("projectId")Integer projectId){
|
|
|
+ public Response<List<DeploymentInfoVO>> retrieveDeploymentInfos(@RequestParam("projectId")Integer projectId) throws AccessDeniedException {
|
|
|
return Response.buildSuccess(deploymentService.retrieveDeploymentInfos(projectId));
|
|
|
}
|
|
|
|
|
|
@@ -44,7 +45,7 @@ public class DeploymentController {
|
|
|
})
|
|
|
@PostMapping
|
|
|
public Response deploy(@RequestParam("projectId")Integer projectId,
|
|
|
- @RequestParam("pipelineId")Integer pipelineId){
|
|
|
+ @RequestParam("pipelineId")Integer pipelineId) throws AccessDeniedException {
|
|
|
deploymentService.deploy(projectId,pipelineId);
|
|
|
return Response.buildSuccess();
|
|
|
}
|
|
|
@@ -56,7 +57,7 @@ public class DeploymentController {
|
|
|
})
|
|
|
@DeleteMapping
|
|
|
public Response delete(@RequestParam("projectId")Integer projectId,
|
|
|
- @RequestParam("pipelineId")Integer pipelineId){
|
|
|
+ @RequestParam("pipelineId")Integer pipelineId) throws AccessDeniedException {
|
|
|
deploymentService.deploy(projectId,pipelineId);
|
|
|
return Response.buildSuccess();
|
|
|
}
|