From d01abda1741c7f75d7efe4c62b0c0547dc5fcccb Mon Sep 17 00:00:00 2001 From: AreSain Date: Thu, 7 Mar 2024 19:25:59 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EC=95=84=EC=A7=81=20=EA=B3=A0=EC=B9=98?= =?UTF-8?q?=EB=8A=94=20=EC=A4=91=20=EC=9E=85=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/room/controller/RoomAdminController.java | 5 ++--- .../api/admin/room/controller/request/PageReqDto.java | 11 +++++++++-- .../user/comment/controller/CommentController.java | 2 +- .../gg/pingpong/api/global/dto/PageRequestDto.java | 1 - 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gg-pingpong-api/src/main/java/gg/party/api/admin/room/controller/RoomAdminController.java b/gg-pingpong-api/src/main/java/gg/party/api/admin/room/controller/RoomAdminController.java index 67ba7c74f..24af483d3 100644 --- a/gg-pingpong-api/src/main/java/gg/party/api/admin/room/controller/RoomAdminController.java +++ b/gg-pingpong-api/src/main/java/gg/party/api/admin/room/controller/RoomAdminController.java @@ -5,11 +5,11 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import gg.data.party.type.RoomType; @@ -25,7 +25,6 @@ @RequiredArgsConstructor @RequestMapping("/party/admin/rooms") public class RoomAdminController { - private final RoomAdminService roomAdminService; /** @@ -54,7 +53,7 @@ public ResponseEntity changeRoomVisibility(@PathVariable Long roomId, * @return 방 정보 dto */ @GetMapping - public ResponseEntity adminAllRoomList(@ModelAttribute @Valid PageReqDto pageReqDto) { + public ResponseEntity adminAllRoomList(@RequestParam @Valid PageReqDto pageReqDto) { AdminRoomListResDto adminRoomListResDto = roomAdminService.findAllRoomList(pageReqDto); return ResponseEntity.status(HttpStatus.OK).body(adminRoomListResDto); } diff --git a/gg-pingpong-api/src/main/java/gg/party/api/admin/room/controller/request/PageReqDto.java b/gg-pingpong-api/src/main/java/gg/party/api/admin/room/controller/request/PageReqDto.java index f37fc2f69..08d6a6409 100644 --- a/gg-pingpong-api/src/main/java/gg/party/api/admin/room/controller/request/PageReqDto.java +++ b/gg-pingpong-api/src/main/java/gg/party/api/admin/room/controller/request/PageReqDto.java @@ -1,11 +1,18 @@ package gg.party.api.admin.room.controller.request; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; + import lombok.Getter; import lombok.NoArgsConstructor; @Getter @NoArgsConstructor public class PageReqDto { - private int page; - private int size; + @Min(value = 1) + @NotNull(message = "page 는 필수 값입니다.") + private Integer page; + + @Min(value = 1) + private Integer size = 20; } diff --git a/gg-pingpong-api/src/main/java/gg/party/api/user/comment/controller/CommentController.java b/gg-pingpong-api/src/main/java/gg/party/api/user/comment/controller/CommentController.java index 1b017f658..503bce24e 100644 --- a/gg-pingpong-api/src/main/java/gg/party/api/user/comment/controller/CommentController.java +++ b/gg-pingpong-api/src/main/java/gg/party/api/user/comment/controller/CommentController.java @@ -30,7 +30,7 @@ public class CommentController { * @return 생성 성공 여부 */ @PostMapping - public ResponseEntity createComment(@PathVariable Long roomId, @Valid @RequestBody CommentCreateReqDto reqDto, + public ResponseEntity createComment(@PathVariable Long roomId, @RequestBody @Valid CommentCreateReqDto reqDto, @Login UserDto user) { commentService.addCreateComment(roomId, reqDto, user.getId()); return ResponseEntity.status(HttpStatus.CREATED).build(); diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/dto/PageRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/dto/PageRequestDto.java index 868992210..47d737a29 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/dto/PageRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/dto/PageRequestDto.java @@ -10,7 +10,6 @@ @Getter @Setter public class PageRequestDto { - @Min(value = 1, message = "page must be greater than 0") @NotNull(message = "page 는 필수 값입니다.") private Integer page;