-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from mju-likelion/feature/diary-room-refactor-#87
Feature/#87 감정일기, 실시간 집중세션 방 코드 리팩터링
- Loading branch information
Showing
5 changed files
with
41 additions
and
37 deletions.
There are no files selected for viewing
8 changes: 6 additions & 2 deletions
8
src/main/java/com/example/mutsideout_mju/dto/request/PaginationDto.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,14 +1,18 @@ | ||
package com.example.mutsideout_mju.dto.request; | ||
|
||
import com.example.mutsideout_mju.exception.NotFoundException; | ||
import com.example.mutsideout_mju.exception.errorCode.ErrorCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
public class PaginationDto { | ||
private final int PAGE_SIZE = 10; //10개씩 페이징 | ||
private final int pageSize = 10; //10개씩 페이징 | ||
private int page; //요청받은 페이지 | ||
|
||
public PaginationDto(int page) { | ||
if (pageSize <= page && page != 0) { | ||
throw new NotFoundException(ErrorCode.NOT_FOUND_PAGE); | ||
} | ||
this.page = Math.max(page - 1, 0); | ||
} | ||
} |
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
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