Skip to content

Commit

Permalink
refactor: admin - 응모 내역 상세 조회 수정 (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
5uhwann authored Feb 28, 2024
1 parent 1e5a9f0 commit 2b4e836
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ddingdong.ddingdongBE.domain.qrstamp.controller.dto.response;

import ddingdong.ddingdongBE.domain.qrstamp.entity.StampHistory;
import java.util.List;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand All @@ -15,6 +16,7 @@ public class DetailAppliedUserResponse {
private String studentName;
private String studentNumber;
private String department;
private List<CollectedStampsResponse> collections;
private String certificationImageUrl;

public static DetailAppliedUserResponse from(StampHistory stampHistory) {
Expand All @@ -23,6 +25,10 @@ public static DetailAppliedUserResponse from(StampHistory stampHistory) {
.studentName(stampHistory.getStudentName())
.studentNumber(stampHistory.getStudentNumber())
.department(stampHistory.getDepartment())
.collections(stampHistory.getCollectedStamps().keySet().stream()
.map(stamp -> CollectedStampsResponse.of(stamp.getName(),
stampHistory.getCollectedStamps().get(stamp)))
.toList())
.certificationImageUrl(stampHistory.getCertificationImageUrl()).build();
}

Expand Down

0 comments on commit 2b4e836

Please sign in to comment.