|
|
@@ -87,9 +87,17 @@ public class ProjectController {
|
|
|
@ApiOperation(value = "删除项目", httpMethod = "DELETE")
|
|
|
@ApiImplicitParam(name = "projectId", dataType = "int", paramType = "query")
|
|
|
@DeleteMapping
|
|
|
- public Response<String> deleteProject(@RequestParam("projectId") Integer projectId) throws ServiceException {
|
|
|
- projectService.deleteProject(projectId);
|
|
|
- return Response.buildSuccess("Delete project successfully");
|
|
|
+ public Response<Object> deleteProject(@RequestParam("projectId") Integer projectId, @RequestParam("userId") Long userId) {
|
|
|
+ try{
|
|
|
+ boolean res = projectService.deleteProject(projectId);
|
|
|
+ if(res){
|
|
|
+ return Response.buildSuccess("Delete project successfully");
|
|
|
+ }else{
|
|
|
+ return Response.buildFailure(503,"Delete project failed");
|
|
|
+ }
|
|
|
+ } catch (ServiceException e){
|
|
|
+ return Response.buildFailure(505, String.format("User: %s try to delete failed", userId));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "生成项目关联邀请码", httpMethod = "POST")
|