Skip to content

Commit

Permalink
Merge pull request #265 from TEAM-MODDY/feat/#264
Browse files Browse the repository at this point in the history
#264 [feat]지원서 상세보기 applicationInfo 에 등록일, 만료일 추가
  • Loading branch information
pkl0912 authored Mar 2, 2024
2 parents 9cb6e38 + 35f8afa commit 1cf81d8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public SuccessResponse<ApplicationDetailInfoResponse> getApplicationDetailInfo(
applicationDto.recordResponseList(),
applicationDto.hairDetail(),
hairServiceOfferRetrieveService.getIsSendStatus(applicationId, designerId),
applicationDto.instgramId()
applicationDto.instgramId(),
applicationDto.createdDate(),
applicationDto.expiredDate()
);

ModelInfoResponse modelInfoResponse = new ModelInfoResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public record ApplicationInfoResponse(
List<HairRecordResponse> hairServiceRecords,
String hairDetail,
boolean isSend,
String instagramId
String instagramId,
String createdDate,
String expiredDate
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public record ApplicationDto(
List<String> preferHairStyleList,
List<HairRecordResponse> recordResponseList,
String hairDetail,
String instgramId
String instgramId,
String createdDate,
String expiredDate
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import com.moddy.server.domain.BaseTimeEntity;
import com.moddy.server.domain.model.Model;
import com.moddy.server.domain.user.User;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.time.LocalDate;

@Entity
@Getter
Expand Down Expand Up @@ -48,4 +48,13 @@ public HairModelApplication(Model model, HairLength hairLength, String hairDetai
this.instagramId = instagramId;
this.applicationCaptureUrl = applicationCaptureUrl;
}

public LocalDate getCreatedDate(){
LocalDate createDate = getCreatedAt().toLocalDate();
return createDate;
}
public LocalDate getExpiredDate(){
LocalDate expiredDate = getCreatedAt().plusDays(7).toLocalDate();
return expiredDate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.moddy.server.domain.hair_service_record.repository.HairServiceRecordJpaRepository;
import com.moddy.server.domain.prefer_hair_style.PreferHairStyle;
import com.moddy.server.domain.prefer_hair_style.repository.PreferHairStyleJpaRepository;
import com.moddy.server.domain.prefer_region.repository.PreferRegionJpaRepository;
import com.moddy.server.external.s3.S3Service;
import com.moddy.server.service.designer.DesignerRetrieveService;
import com.moddy.server.service.model.ModelRetrieveService;
Expand All @@ -30,6 +29,7 @@
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import java.time.format.DateTimeFormatter;

@Service
@RequiredArgsConstructor
Expand All @@ -42,6 +42,7 @@ public class HairModelApplicationRetrieveService {
private final S3Service s3Service;
private final PreferHairStyleJpaRepository preferHairStyleJpaRepository;
private final HairServiceRecordJpaRepository hairServiceRecordJpaRepository;
private static final String DATE_FORMAT = "yyyy. MM. dd.";

public DesignerMainResponse getDesignerMainInfo(final Long designerId, final int page, final int size) {

Expand Down Expand Up @@ -96,9 +97,12 @@ public ApplicationDto getApplicationDetailInfo(final Long applicationId) {
preferhairStyleList,
recordResponseList,
hairModelApplication.getHairDetail(),
hairModelApplication.getInstagramId());
hairModelApplication.getInstagramId(),
hairModelApplication.getCreatedDate().format(DateTimeFormatter.ofPattern(DATE_FORMAT)),
hairModelApplication.getExpiredDate().format(DateTimeFormatter.ofPattern(DATE_FORMAT)));
}


public boolean fetchModelApplyStatus(final Long modelId) {
return hairModelApplicationJpaRepository.existsByModelId(modelId);
}
Expand Down

0 comments on commit 1cf81d8

Please sign in to comment.