Skip to content

Commit

Permalink
Merge pull request #85 from teamterning/!hotfix/#84
Browse files Browse the repository at this point in the history
[🔥!hotfix/#84] 홈 > 나에게 딱맞는 인턴 공고 조회 응답 데이터 변경
  • Loading branch information
junggyo1020 authored Jul 18, 2024
2 parents 842a4e4 + 763b850 commit 76a88a5
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,25 @@ public record HomeResponseDto(
Long intershipAnnouncementId,
String title,
String dDay,
String deadline,
String workingPeriod,
String startYearMonth,
String companyImage,
boolean isScrapped
) {
public static HomeResponseDto of(final Long scrapId, final InternshipAnnouncement internshipAnnouncement, final boolean isScrapped){
String dDay = DateUtil.convert(internshipAnnouncement.getDeadline()); // dDay 계산 로직 추가
String startYearMonth = internshipAnnouncement.getStartYear() + "년 " + internshipAnnouncement.getStartMonth() + "월";
String deadline = DateUtil.convertDeadline(internshipAnnouncement.getDeadline());

return HomeResponseDto.builder()
.scrapId(scrapId)
.intershipAnnouncementId(internshipAnnouncement.getId())
.title(internshipAnnouncement.getTitle())
.dDay(dDay)
.deadline(deadline)
.workingPeriod(internshipAnnouncement.getWorkingPeriod())
.startYearMonth(startYearMonth)
.companyImage(internshipAnnouncement.getCompany().getCompanyImage())
.isScrapped(isScrapped)
.build();
Expand Down

0 comments on commit 76a88a5

Please sign in to comment.