Skip to content

Commit

Permalink
🔊 Bug/271 레시피, 댓글 서버에서 삭제 안될 경우의 로그 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanvp committed Nov 4, 2023
1 parent 800bea0 commit 1e1534f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public ResponseDto<RecipeResponseDto.TempRecipeInfoDto> 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),
Expand All @@ -173,7 +174,7 @@ public ResponseDto<String> 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입니다. ")
Expand Down Expand Up @@ -269,6 +270,7 @@ public ResponseDto<RecipeResponseDto.RecipeInfoDto> 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),
Expand All @@ -280,7 +282,7 @@ public ResponseDto<String> 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입니다.")
Expand Down Expand Up @@ -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),
Expand All @@ -848,7 +852,7 @@ public ResponseDto<String> 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입니다.")
Expand Down

0 comments on commit 1e1534f

Please sign in to comment.