@@ -27,10 +27,10 @@ public class BoardController {
2727 // 게시글 목록 조회(게시판)
2828 @ GetMapping ("/posts" )
2929 public ResponseEntity <BoardPostListResponse > getPostList (
30- @ RequestParam (defaultValue = "0" ) int page ,
31- @ RequestParam (defaultValue = "20" ) int size ,
32- @ RequestParam (defaultValue = "createdAt,desc" ) String sort ,
33- @ RequestParam (required = false ) String filter
30+ @ RequestParam (defaultValue = "0" , value = "page" ) int page ,
31+ @ RequestParam (defaultValue = "20" , value = "size" ) int size ,
32+ @ RequestParam (defaultValue = "createdAt,desc" , value = "sort" ) String sort ,
33+ @ RequestParam (required = false , value = "filter" ) String filter
3434 ) {
3535 BoardPostListResponse response = boardService .getPostList (page , size , sort , filter );
3636 return ResponseEntity .ok (response );
@@ -55,10 +55,10 @@ public ResponseEntity<Map<String, String>> createPost(
5555 // 게시글 조회
5656 @ GetMapping ("/post/{postId}" )
5757 public ResponseEntity <BoardPostResponse > getPostDetail (
58- @ PathVariable Long postId ,
59- @ RequestParam (defaultValue = "0" ) int page ,
60- @ RequestParam (defaultValue = "20" ) int size ,
61- @ RequestParam (defaultValue = "createdAt,asc" ) String sort
58+ @ PathVariable ( "postId" ) Long postId ,
59+ @ RequestParam (defaultValue = "0" , value = "page" ) int page ,
60+ @ RequestParam (defaultValue = "20" , value = "size" ) int size ,
61+ @ RequestParam (defaultValue = "createdAt,asc" , value = "sort" ) String sort
6262 ) {
6363 try {
6464 BoardPostResponse response = boardService .getPostDetail (postId , page , size , sort );
@@ -71,7 +71,7 @@ public ResponseEntity<BoardPostResponse> getPostDetail(
7171 // 댓글 작성
7272 @ PostMapping ("/post/{postId}/comment" )
7373 public ResponseEntity <Map <String , String >> createComment (
74- @ PathVariable Long postId ,
74+ @ PathVariable ( "postId" ) Long postId ,
7575 @ RequestBody BoardCommentRequest requestDto ,
7676 @ AuthenticationPrincipal UserDetails userDetails
7777 ) {
@@ -91,10 +91,10 @@ public ResponseEntity<Map<String, String>> createComment(
9191 // 대댓글 조회
9292 @ GetMapping ("/comments/{commentId}/replies" )
9393 public ResponseEntity <CommentReplyListResponse > getReplies (
94- @ PathVariable Long commentId ,
95- @ RequestParam (defaultValue = "0" ) int page ,
96- @ RequestParam (defaultValue = "20 " ) int size ,
97- @ RequestParam (defaultValue = "createdAt,asc" ) String sort
94+ @ PathVariable ( "commentId" ) Long commentId ,
95+ @ RequestParam (defaultValue = "0" , value = "page" ) int page ,
96+ @ RequestParam (defaultValue = "10" , value = "size " ) int size ,
97+ @ RequestParam (defaultValue = "createdAt,asc" , value = "sort" ) String sort
9898 ) {
9999 try {
100100 CommentReplyListResponse response = boardService .getReplies (commentId , page , size , sort );
@@ -107,7 +107,7 @@ public ResponseEntity<CommentReplyListResponse> getReplies(
107107 // 게시글 수정
108108 @ PutMapping ("/post/{postId}" )
109109 public ResponseEntity <Map <String , String >> updatePost (
110- @ PathVariable Long postId ,
110+ @ PathVariable ( "postId" ) Long postId ,
111111 @ RequestBody BoardPostRequest requestDto ,
112112 @ AuthenticationPrincipal UserDetails userDetails
113113 ) {
@@ -133,7 +133,7 @@ public ResponseEntity<Map<String, String>> updatePost(
133133 // 게시글 삭제
134134 @ DeleteMapping ("/post/{postId}" )
135135 public ResponseEntity <Map <String , String >> deletePost (
136- @ PathVariable Long postId ,
136+ @ PathVariable ( "postId" ) Long postId ,
137137 @ AuthenticationPrincipal UserDetails userDetails
138138 ) {
139139 if (userDetails == null ) {
0 commit comments