From 1e1534fdefc56f414914a8a8fc7dd85ace6d144d Mon Sep 17 00:00:00 2001 From: Hanvp Date: Sat, 4 Nov 2023 18:24:03 +0900 Subject: [PATCH] =?UTF-8?q?:loud=5Fsound:=20Bug/271=20=EB=A0=88=EC=8B=9C?= =?UTF-8?q?=ED=94=BC,=20=EB=8C=93=EA=B8=80=20=EC=84=9C=EB=B2=84=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=82=AD=EC=A0=9C=20=EC=95=88=EB=90=A0=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=EC=9D=98=20=EB=A1=9C=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zipdabang/server/apiPayload/code/CommonStatus.java | 6 +++++- .../server/web/controller/RecipeRestController.java | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/zipdabang/server/apiPayload/code/CommonStatus.java b/src/main/java/zipdabang/server/apiPayload/code/CommonStatus.java index 79d1f9a..e57b06a 100644 --- a/src/main/java/zipdabang/server/apiPayload/code/CommonStatus.java +++ b/src/main/java/zipdabang/server/apiPayload/code/CommonStatus.java @@ -149,7 +149,11 @@ public enum CommonStatus implements BaseCode { //INTERNAL_SERVER_ERROR INTERNAL_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, 5000, "Internal server Error"), //INTERNAL_SERVER_ERROR - FEIGN_CLIENT_ERROR_500(HttpStatus.INTERNAL_SERVER_ERROR, 5001, "Inter server Error in feign client"); + FEIGN_CLIENT_ERROR_500(HttpStatus.INTERNAL_SERVER_ERROR, 5001, "Inter server Error in feign client"), + + RECIPE_NOT_DELETED(HttpStatus.INTERNAL_SERVER_ERROR, 5100, "레시피가 삭제되지 않았습니다."), + COMMENT_NOT_DELETED(HttpStatus.INTERNAL_SERVER_ERROR, 5101, "댓글이 삭제되지 않았습니다."), + TEMP_RECIPE_NOT_DELETED(HttpStatus.INTERNAL_SERVER_ERROR, 5102, "임시저장 레시피가 삭제되지 않았습니다."); private final HttpStatus httpStatus; private final Integer code; diff --git a/src/main/java/zipdabang/server/web/controller/RecipeRestController.java b/src/main/java/zipdabang/server/web/controller/RecipeRestController.java index b38df48..333b80c 100644 --- a/src/main/java/zipdabang/server/web/controller/RecipeRestController.java +++ b/src/main/java/zipdabang/server/web/controller/RecipeRestController.java @@ -160,6 +160,7 @@ public ResponseDto getTempRecipe(@PathVaria @ApiResponse(responseCode = "4052", description = "BAD_REQUEST, 사용자가 없습니다. 이 api에서 이거 생기면 백앤드 개발자 호출", content = @Content(schema = @Schema(implementation = ResponseDto.class))), @ApiResponse(responseCode = "4111", description = "BAD_REQUEST, 해당 임시저장 Id가 존재하지 않습니다.", content = @Content(schema = @Schema(implementation = ResponseDto.class))), @ApiResponse(responseCode = "5000", description = "SERVER ERROR, 백앤드 개발자에게 알려주세요", content = @Content(schema = @Schema(implementation = ResponseDto.class))), + @ApiResponse(responseCode = "5102", description = "SERVER ERROR, 임시저장 레시피가 삭제되지 않았습니다.", content = @Content(schema = @Schema(implementation = ResponseDto.class))), }) @Parameters({ @Parameter(name = "member", hidden = true), @@ -173,7 +174,7 @@ public ResponseDto deleteTempRecipe( if (recipeDeleteBoolean) return ResponseDto.of(tempId + " 임시저장 레시피 삭제 완료"); else - throw new RecipeException(CommonStatus.INTERNAL_ERROR); + throw new RecipeException(CommonStatus.TEMP_RECIPE_NOT_DELETED); } @Operation(summary = "레시피 임시저장 ➡ 최종 저장 API 🔑 ✔", description = "\"레시피 임시저장 ➡ 최종 저장 API입니다. ") @@ -269,6 +270,7 @@ public ResponseDto recipeDetail(@PathVariable(n @ApiResponse(responseCode = "4101", description = "BAD_REQUEST, 해당 recipeId를 가진 recipe가 없어요", content = @Content(schema = @Schema(implementation = ResponseDto.class))), @ApiResponse(responseCode = "4106", description = "BAD_REQUEST, 본인이 작성한 레시피가 아닙니다. 삭제할 수 없습니다", content = @Content(schema = @Schema(implementation = ResponseDto.class))), @ApiResponse(responseCode = "5000", description = "SERVER ERROR, 백앤드 개발자에게 알려주세요", content = @Content(schema = @Schema(implementation = ResponseDto.class))), + @ApiResponse(responseCode = "5100", description = "SERVER ERROR, 레시피가 삭제되지 않았습니다.", content = @Content(schema = @Schema(implementation = ResponseDto.class))), }) @Parameters({ @Parameter(name = "member", hidden = true), @@ -280,7 +282,7 @@ public ResponseDto deleteRecipe(@PathVariable(name = "recipeId") Long re if (recipeDeleteBoolean) return ResponseDto.of(recipeId + " 레시피 삭제 완료"); else - throw new RecipeException(CommonStatus.INTERNAL_ERROR); + throw new RecipeException(CommonStatus.RECIPE_NOT_DELETED); } @Operation(summary = "🍹figma 레시피2, 레시피 검색 카테고리 별 preview 화면 API 🔑 ✔", description = "검색한 레시피 카테고리별 조회 화면 API입니다.") @@ -837,6 +839,8 @@ else if (pageIndex < 1) @ApiResponse(responseCode = "4108", description = "BAD_REQUEST, 본인이 작성한 댓글이 아닙니다. 삭제할 수 없습니다", content = @Content(schema = @Schema(implementation = ResponseDto.class))), @ApiResponse(responseCode = "4112", description = "BAD_REQUEST, 해당 댓글은 넘겨준 레시피 Id에 존재하지 않습니다. 레시피 Id를 올바르게 보내주세요", content = @Content(schema = @Schema(implementation = ResponseDto.class))), @ApiResponse(responseCode = "5000", description = "SERVER ERROR, 백앤드 개발자에게 알려주세요", content = @Content(schema = @Schema(implementation = ResponseDto.class))), + @ApiResponse(responseCode = "5101", description = "SERVER ERROR, 댓글이 삭제되지 않았습니다.", content = @Content(schema = @Schema(implementation = ResponseDto.class))), + }) @Parameters({ @Parameter(name = "member", hidden = true), @@ -848,7 +852,7 @@ public ResponseDto deleteComment(@PathVariable(name = "recipeId") Long r if (commentDeleteBoolean) return ResponseDto.of(commentId + " 댓글 삭제 완료"); else - throw new RecipeException(CommonStatus.INTERNAL_ERROR); + throw new RecipeException(CommonStatus.COMMENT_NOT_DELETED); } @Operation(summary = "댓글 수정 API 🔑 ✔", description = "댓글 수정 API입니다.")