Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#264 [feat]지원서 상세보기 applicationInfo 에 등록일, 만료일 추가 #265

Merged
merged 6 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.createDate(),
applicationDto.expireDate()
);

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 createDate,
String expireDate
) {
}
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 createDate,
String expireDate
) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3
해당 속성 명도 ed를 붙인 뒤, 노션 api 도 수정하면 좋을 거 같습니다..!

}
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
Loading