Skip to content

Commit

Permalink
[fix] 아직 고치는 중 입니다.
Browse files Browse the repository at this point in the history
  • Loading branch information
AreSain committed Mar 7, 2024
1 parent 20425ca commit d01abda
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -25,7 +25,6 @@
@RequiredArgsConstructor
@RequestMapping("/party/admin/rooms")
public class RoomAdminController {

private final RoomAdminService roomAdminService;

/**
Expand Down Expand Up @@ -54,7 +53,7 @@ public ResponseEntity<Void> changeRoomVisibility(@PathVariable Long roomId,
* @return 방 정보 dto
*/
@GetMapping
public ResponseEntity<AdminRoomListResDto> adminAllRoomList(@ModelAttribute @Valid PageReqDto pageReqDto) {
public ResponseEntity<AdminRoomListResDto> adminAllRoomList(@RequestParam @Valid PageReqDto pageReqDto) {
AdminRoomListResDto adminRoomListResDto = roomAdminService.findAllRoomList(pageReqDto);
return ResponseEntity.status(HttpStatus.OK).body(adminRoomListResDto);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class CommentController {
* @return 생성 성공 여부
*/
@PostMapping
public ResponseEntity<Void> createComment(@PathVariable Long roomId, @Valid @RequestBody CommentCreateReqDto reqDto,
public ResponseEntity<Void> createComment(@PathVariable Long roomId, @RequestBody @Valid CommentCreateReqDto reqDto,
@Login UserDto user) {
commentService.addCreateComment(roomId, reqDto, user.getId());
return ResponseEntity.status(HttpStatus.CREATED).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d01abda

Please sign in to comment.