-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ 기능 수정 : Mapper, DTO, 페이지네이션, Repository 코드 수정
- Loading branch information
Showing
5 changed files
with
41 additions
and
32 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
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
16 changes: 0 additions & 16 deletions
16
...nsMate/src/main/java/intbyte4/learnsmate/lecture/pagination/CursorPaginationResponse.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...src/main/java/intbyte4/learnsmate/lecture/pagination/LectureCursorPaginationResponse.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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package intbyte4.learnsmate.lecture.pagination; | ||
|
||
import lombok.*; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
public class LectureCursorPaginationResponse<T> { | ||
private List<T> data; | ||
private LocalDateTime nextCursor; | ||
private int currentPage; | ||
private int pageSize; | ||
private boolean hasNext; | ||
|
||
public static <T> LectureCursorPaginationResponse<T> ofCursor(List<T> data, LocalDateTime nextCursor) { | ||
return LectureCursorPaginationResponse.<T>builder() | ||
.data(data) | ||
.nextCursor(nextCursor) | ||
.hasNext(nextCursor != null) | ||
.build(); | ||
} | ||
|
||
public static <T> LectureCursorPaginationResponse<T> ofOffset(List<T> data, int currentPage, int pageSize, boolean hasNext) { | ||
return LectureCursorPaginationResponse.<T>builder() | ||
.data(data) | ||
.currentPage(currentPage) | ||
.pageSize(pageSize) | ||
.hasNext(hasNext) | ||
.build(); | ||
} | ||
} |
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