Skip to content

Commit

Permalink
#27 refactor: Comment컨트롤러 이름 오타 수정, Comment swagger ApiResponse 누락 된 …
Browse files Browse the repository at this point in the history
…응답 추가 반영, Req에 빠진 필드값 추가
  • Loading branch information
xhaktmchl committed Nov 9, 2022
1 parent 26a869b commit bb2e885
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import com.yogit.server.board.dto.response.comment.DeleteCommentRes;
import com.yogit.server.board.service.comment.CommentService;
import com.yogit.server.global.dto.ApplicationResponse;
import com.yogit.server.user.entity.Gender;
import com.yogit.server.user.entity.Nationality;
import io.swagger.annotations.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -21,7 +19,7 @@
@RestController
@RequiredArgsConstructor // private final DI의존주입
@RequestMapping("/comments")
public class CommenrController {
public class CommentController {

private final CommentService commentService;
/**
Expand Down Expand Up @@ -66,11 +64,11 @@ public ApplicationResponse<List<CommentRes>> findAllComments(@PathVariable("clip
@ApiResponses({
@ApiResponse(code= 201, message = "요청에 성공하였습니다."),
@ApiResponse(code= 404, message = "존재하지 않는 유저입니다."),
@ApiResponse(code= 404, message = "존재하지 않는 클립보드입니다."),
@ApiResponse(code= 404, message = "존재하지 않는 코멘트입니다."),
@ApiResponse(code= 404, message = "요청한 유저가 코멘트의 호스트가 아닙니다"),
@ApiResponse(code = 4000 , message = "서버 오류입니다.")
})
@PatchMapping("/{commentId}")
@PatchMapping("/{commentId}/status")
public ApplicationResponse<DeleteCommentRes> deleteComment(@PathVariable("commentId") Long commentId, @RequestBody @Validated DeleteCommentReq deleteCommentReq){
return commentService.deleteComment(deleteCommentReq, commentId);
}
Expand All @@ -84,11 +82,11 @@ public ApplicationResponse<DeleteCommentRes> deleteComment(@PathVariable("commen
@ApiResponses({
@ApiResponse(code= 201, message = "요청에 성공하였습니다."),
@ApiResponse(code= 404, message = "존재하지 않는 유저입니다."),
@ApiResponse(code= 404, message = "존재하지 않는 클립보드입니다."),
@ApiResponse(code= 404, message = "존재하지 않는 코멘트입니다."),
@ApiResponse(code= 404, message = "요청한 유저가 코멘트의 호스트가 아닙니다"),
@ApiResponse(code = 4000 , message = "서버 오류입니다.")
})
@PatchMapping("/{commentId}/content")
@PatchMapping("/{commentId}")
public ApplicationResponse<CommentRes> updateComment(@PathVariable("commentId") Long commentId, @RequestBody @Validated PatchCommentReq patchCommentReq){
return commentService.updateComment(patchCommentReq, commentId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ public class DeleteCommentReq {
@ApiModelProperty(example = "1")
@ApiParam(value = "유저 ID", required = true)
private Long userId;

@ApiModelProperty(example = "1")
@ApiParam(value = "코멘트 ID", required = true)
private Long commentId;
}

0 comments on commit bb2e885

Please sign in to comment.