-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor] Post 전체 조회 api QueryString 방식으로 수정 (#379)
- Loading branch information
Showing
5 changed files
with
92 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 31 additions & 1 deletion
32
backend/src/main/java/dev/tripdraw/post/dto/PostSearchRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,34 @@ | ||
package dev.tripdraw.post.dto; | ||
|
||
public record PostSearchRequest(PostSearchConditions conditions, PostSearchPaging paging) { | ||
import java.util.Set; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record PostSearchRequest( | ||
Set<Integer> years, | ||
Set<Integer> months, | ||
Set<Integer> daysOfWeek, | ||
Set<Integer> hours, | ||
Set<Integer> ageRanges, | ||
Set<Integer> genders, | ||
String address, | ||
Long lastViewedId, | ||
Integer limit | ||
) { | ||
|
||
public PostSearchConditions toPostSearchConditions() { | ||
return PostSearchConditions.builder() | ||
.years(years) | ||
.months(months) | ||
.daysOfWeek(daysOfWeek) | ||
.hours(hours) | ||
.ageRanges(ageRanges) | ||
.genders(genders) | ||
.address(address) | ||
.build(); | ||
} | ||
|
||
public PostSearchPaging toPostSearchPaging() { | ||
return new PostSearchPaging(lastViewedId, limit); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters