Skip to content

Commit

Permalink
Merge pull request #7 from Sopo2023/style/#3
Browse files Browse the repository at this point in the history
feat: add page request
  • Loading branch information
GayeongKimm authored Jul 24, 2024
2 parents aaee598 + 6b21b05 commit 06e4d0c
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package kr.hs.dgsw.SOPO_server_v2.global.page;

public record PageRequest(
Long page,
Long size) {

public static PageRequest of(final long page, final long size) {
return new PageRequest(page, size);
}

public void validate() {
if(page<1) {
throw new IllegalArgumentException("Page must over than 0");
}
if(size<1) {
throw new IllegalArgumentException("Size must over than 0");
}
}
}

0 comments on commit 06e4d0c

Please sign in to comment.