From f60aea75daa173d7f16193f403b639f51e617cb4 Mon Sep 17 00:00:00 2001 From: jjuny7712 Date: Wed, 18 Oct 2023 21:58:50 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20cursor=20=EB=94=94=ED=8F=B4=ED=8A=B8?= =?UTF-8?q?=20-1=EB=A1=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/post/controller/PostController.java | 5 +---- .../ssafsound/domain/post/dto/GetPostReqDto.java | 11 ++++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/ssafy/ssafsound/domain/post/controller/PostController.java b/src/main/java/com/ssafy/ssafsound/domain/post/controller/PostController.java index 7be4b48c8..ba2f5e7dd 100644 --- a/src/main/java/com/ssafy/ssafsound/domain/post/controller/PostController.java +++ b/src/main/java/com/ssafy/ssafsound/domain/post/controller/PostController.java @@ -2,9 +2,6 @@ import com.ssafy.ssafsound.domain.auth.dto.AuthenticatedMember; import com.ssafy.ssafsound.domain.auth.validator.Authentication; -import com.ssafy.ssafsound.domain.post.dto.GetPostDetailResDto; -import com.ssafy.ssafsound.domain.post.dto.GetPostResDto; -import com.ssafy.ssafsound.domain.post.dto.PostPostWriteReqDto; import com.ssafy.ssafsound.domain.post.dto.*; import com.ssafy.ssafsound.domain.post.service.PostService; import com.ssafy.ssafsound.global.common.response.EnvelopeResponse; @@ -23,7 +20,7 @@ public class PostController { private final PostService postService; @GetMapping - public EnvelopeResponse findPosts(@Valid GetPostReqDto getPostReqDto) { + public EnvelopeResponse findPosts(@Valid @ModelAttribute GetPostReqDto getPostReqDto) { return EnvelopeResponse.builder() .data(postService.findPosts(getPostReqDto)) .build(); diff --git a/src/main/java/com/ssafy/ssafsound/domain/post/dto/GetPostReqDto.java b/src/main/java/com/ssafy/ssafsound/domain/post/dto/GetPostReqDto.java index ae7150abe..5dd7adbbf 100644 --- a/src/main/java/com/ssafy/ssafsound/domain/post/dto/GetPostReqDto.java +++ b/src/main/java/com/ssafy/ssafsound/domain/post/dto/GetPostReqDto.java @@ -1,19 +1,20 @@ package com.ssafy.ssafsound.domain.post.dto; -import lombok.Builder; -import lombok.Getter; -import lombok.Setter; +import com.ssafy.ssafsound.domain.post.validator.CheckCursor; +import lombok.*; import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; @Getter @Setter @Builder +@AllArgsConstructor +@NoArgsConstructor public class GetPostReqDto { private Long boardId; - private Long cursor; + private Long cursor = -1L; @Min(value = 10, message = "Size가 너무 작습니다.") private int size; - } From 0fdd4eca935ba0875c6b2a010153a323b9d38918 Mon Sep 17 00:00:00 2001 From: jjuny7712 Date: Wed, 18 Oct 2023 22:00:41 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EC=82=AD=EC=A0=9C=ED=95=9C=20?= =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=20import=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ssafy/ssafsound/domain/post/dto/GetPostReqDto.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/ssafy/ssafsound/domain/post/dto/GetPostReqDto.java b/src/main/java/com/ssafy/ssafsound/domain/post/dto/GetPostReqDto.java index 5dd7adbbf..40ca40933 100644 --- a/src/main/java/com/ssafy/ssafsound/domain/post/dto/GetPostReqDto.java +++ b/src/main/java/com/ssafy/ssafsound/domain/post/dto/GetPostReqDto.java @@ -1,10 +1,8 @@ package com.ssafy.ssafsound.domain.post.dto; -import com.ssafy.ssafsound.domain.post.validator.CheckCursor; import lombok.*; import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; @Getter @Setter