Skip to content

Commit

Permalink
chore: 빠진 DTO 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
woosung1223 committed Oct 23, 2023
1 parent 5263a4f commit d62afcd
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package harustudy.backend.admin.dto;

import harustudy.backend.participantcode.domain.ParticipantCode;
import java.util.List;
import org.springframework.data.domain.Page;

public record AdminParticipantCodesResponse(Integer totalPage, List<AdminParticipantCodeResponse> data) {

public static AdminParticipantCodesResponse from(Page<ParticipantCode> participantCodePages) {
List<AdminParticipantCodeResponse> data = participantCodePages.map(AdminParticipantCodeResponse::from)
.toList();

return new AdminParticipantCodesResponse(participantCodePages.getTotalPages(), data);
}
}

0 comments on commit d62afcd

Please sign in to comment.