-
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.
๐ Fix: ํํ๋ฉด๊ณผ ํฐํด๋ฌธ๋ต ์ค๋ฅ ์์
ํํ๋ฉด๊ณผ ํฐํด๋ฌธ๋ต ์ค๋ฅ ์์
- Loading branch information
Showing
5 changed files
with
42 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.ticle.server.global.dto; | ||
|
||
import org.springframework.data.domain.Page; | ||
|
||
public record PageInfo( | ||
int page, | ||
int size, | ||
long totalElements, | ||
int totalPages | ||
) { | ||
public static PageInfo from(Page<?> page) { | ||
return new PageInfo( | ||
page.getNumber() + 1, | ||
page.getSize(), | ||
page.getTotalElements(), | ||
page.getTotalPages() | ||
); | ||
} | ||
} |
6 changes: 4 additions & 2 deletions
6
src/main/java/com/ticle/server/opinion/dto/response/OpinionResponseList.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,15 +1,17 @@ | ||
package com.ticle.server.opinion.dto.response; | ||
|
||
import com.ticle.server.global.dto.PageInfo; | ||
import lombok.Builder; | ||
|
||
import java.util.List; | ||
|
||
@Builder | ||
public record OpinionResponseList( | ||
PageInfo pageInfo, | ||
List<OpinionResponse> opinionResponseList | ||
) { | ||
|
||
public static OpinionResponseList from(List<OpinionResponse> opinionList) { | ||
return new OpinionResponseList(opinionList); | ||
public static OpinionResponseList of(PageInfo pageInfo, List<OpinionResponse> opinionList) { | ||
return new OpinionResponseList(pageInfo, opinionList); | ||
} | ||
} |
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