From ef32d5afe26cdce677f0b7acea8055c8c931bf57 Mon Sep 17 00:00:00 2001 From: pkl0912 Date: Thu, 29 Feb 2024 17:18:16 +0900 Subject: [PATCH 1/5] =?UTF-8?q?#264=20[feat]=20applicationInfo=20=EC=97=90?= =?UTF-8?q?=20=EB=93=B1=EB=A1=9D=EC=9D=BC,=20=EB=A7=8C=EB=A3=8C=EC=9D=BC?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/ApplicationRetrieveController.java | 4 +++- .../dto/response/ApplicationInfoResponse.java | 4 +++- .../server/controller/model/dto/ApplicationDto.java | 4 +++- .../HairModelApplication.java | 13 +++++++++++-- .../HairModelApplicationRetrieveService.java | 8 ++++++-- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/moddy/server/controller/application/ApplicationRetrieveController.java b/src/main/java/com/moddy/server/controller/application/ApplicationRetrieveController.java index aeb400ce..a5ed67ba 100644 --- a/src/main/java/com/moddy/server/controller/application/ApplicationRetrieveController.java +++ b/src/main/java/com/moddy/server/controller/application/ApplicationRetrieveController.java @@ -94,7 +94,9 @@ public SuccessResponse getApplicationDetailInfo( applicationDto.recordResponseList(), applicationDto.hairDetail(), hairServiceOfferRetrieveService.getIsSendStatus(applicationId, designerId), - applicationDto.instgramId() + applicationDto.instgramId(), + applicationDto.createDate(), + applicationDto.expireDate() ); ModelInfoResponse modelInfoResponse = new ModelInfoResponse( diff --git a/src/main/java/com/moddy/server/controller/designer/dto/response/ApplicationInfoResponse.java b/src/main/java/com/moddy/server/controller/designer/dto/response/ApplicationInfoResponse.java index cf3f0e16..41dc1413 100644 --- a/src/main/java/com/moddy/server/controller/designer/dto/response/ApplicationInfoResponse.java +++ b/src/main/java/com/moddy/server/controller/designer/dto/response/ApplicationInfoResponse.java @@ -10,6 +10,8 @@ public record ApplicationInfoResponse( List hairServiceRecords, String hairDetail, boolean isSend, - String instagramId + String instagramId, + String createDate, + String expireDate ) { } diff --git a/src/main/java/com/moddy/server/controller/model/dto/ApplicationDto.java b/src/main/java/com/moddy/server/controller/model/dto/ApplicationDto.java index eb1b7b8a..b871378a 100644 --- a/src/main/java/com/moddy/server/controller/model/dto/ApplicationDto.java +++ b/src/main/java/com/moddy/server/controller/model/dto/ApplicationDto.java @@ -11,6 +11,8 @@ public record ApplicationDto( List preferHairStyleList, List recordResponseList, String hairDetail, - String instgramId + String instgramId, + String createDate, + String expireDate ) { } diff --git a/src/main/java/com/moddy/server/domain/hair_model_application/HairModelApplication.java b/src/main/java/com/moddy/server/domain/hair_model_application/HairModelApplication.java index 378fb6c1..04ce83c7 100644 --- a/src/main/java/com/moddy/server/domain/hair_model_application/HairModelApplication.java +++ b/src/main/java/com/moddy/server/domain/hair_model_application/HairModelApplication.java @@ -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 @@ -48,4 +48,13 @@ public HairModelApplication(Model model, HairLength hairLength, String hairDetai this.instagramId = instagramId; this.applicationCaptureUrl = applicationCaptureUrl; } + + public LocalDate getCreateDate(){ + LocalDate createDate = getCreatedAt().toLocalDate(); + return createDate; + } + public LocalDate getExpireDate(){ + LocalDate expiredDate = getCreatedAt().plusDays(7).toLocalDate(); + return expiredDate; + } } diff --git a/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java b/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java index 8213992d..92e56f81 100644 --- a/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java +++ b/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java @@ -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; @@ -27,9 +26,11 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDate; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; +import java.time.format.DateTimeFormatter; @Service @RequiredArgsConstructor @@ -96,9 +97,12 @@ public ApplicationDto getApplicationDetailInfo(final Long applicationId) { preferhairStyleList, recordResponseList, hairModelApplication.getHairDetail(), - hairModelApplication.getInstagramId()); + hairModelApplication.getInstagramId(), + hairModelApplication.getCreateDate().format(DateTimeFormatter.ofPattern("yyyy. MM. dd.")), + hairModelApplication.getExpireDate().format(DateTimeFormatter.ofPattern("yyyy. MM. dd."))); } + public boolean fetchModelApplyStatus(final Long modelId) { return hairModelApplicationJpaRepository.existsByModelId(modelId); } From 4902cc62dc497c8ea6b543ae7d26457f3c1aaf23 Mon Sep 17 00:00:00 2001 From: pkl0912 Date: Fri, 1 Mar 2024 21:07:48 +0900 Subject: [PATCH 2/5] =?UTF-8?q?#264=20[refactor]=20format=EC=83=81?= =?UTF-8?q?=EC=88=98=20=EC=B6=94=EA=B0=80,=20=ED=95=A8=EC=88=98=EB=AA=85?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/hair_model_application/HairModelApplication.java | 4 ++-- .../application/HairModelApplicationRetrieveService.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/moddy/server/domain/hair_model_application/HairModelApplication.java b/src/main/java/com/moddy/server/domain/hair_model_application/HairModelApplication.java index 04ce83c7..8e8e0b46 100644 --- a/src/main/java/com/moddy/server/domain/hair_model_application/HairModelApplication.java +++ b/src/main/java/com/moddy/server/domain/hair_model_application/HairModelApplication.java @@ -49,11 +49,11 @@ public HairModelApplication(Model model, HairLength hairLength, String hairDetai this.applicationCaptureUrl = applicationCaptureUrl; } - public LocalDate getCreateDate(){ + public LocalDate getCreatedDate(){ LocalDate createDate = getCreatedAt().toLocalDate(); return createDate; } - public LocalDate getExpireDate(){ + public LocalDate getExpiredDate(){ LocalDate expiredDate = getCreatedAt().plusDays(7).toLocalDate(); return expiredDate; } diff --git a/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java b/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java index 92e56f81..8ab39650 100644 --- a/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java +++ b/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java @@ -26,7 +26,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.time.LocalDate; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; @@ -43,6 +42,7 @@ public class HairModelApplicationRetrieveService { private final S3Service s3Service; private final PreferHairStyleJpaRepository preferHairStyleJpaRepository; private final HairServiceRecordJpaRepository hairServiceRecordJpaRepository; + private final String dateFormat = "yyyy. MM. dd."; public DesignerMainResponse getDesignerMainInfo(final Long designerId, final int page, final int size) { @@ -98,8 +98,8 @@ public ApplicationDto getApplicationDetailInfo(final Long applicationId) { recordResponseList, hairModelApplication.getHairDetail(), hairModelApplication.getInstagramId(), - hairModelApplication.getCreateDate().format(DateTimeFormatter.ofPattern("yyyy. MM. dd.")), - hairModelApplication.getExpireDate().format(DateTimeFormatter.ofPattern("yyyy. MM. dd."))); + hairModelApplication.getCreatedDate().format(DateTimeFormatter.ofPattern(dateFormat)), + hairModelApplication.getExpiredDate().format(DateTimeFormatter.ofPattern(dateFormat))); } From 034a86d0f53090958c0d0fc2df6b1e64a805cb10 Mon Sep 17 00:00:00 2001 From: pkl0912 Date: Sat, 2 Mar 2024 00:33:11 +0900 Subject: [PATCH 3/5] =?UTF-8?q?#264=20[refactor]=20=EC=83=81=EC=88=98=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/HairModelApplicationRetrieveService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java b/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java index 8ab39650..3beb3543 100644 --- a/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java +++ b/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java @@ -42,7 +42,7 @@ public class HairModelApplicationRetrieveService { private final S3Service s3Service; private final PreferHairStyleJpaRepository preferHairStyleJpaRepository; private final HairServiceRecordJpaRepository hairServiceRecordJpaRepository; - private final String dateFormat = "yyyy. MM. dd."; + private static final String DATE_FORMAT = "yyyy. MM. dd."; public DesignerMainResponse getDesignerMainInfo(final Long designerId, final int page, final int size) { @@ -98,8 +98,8 @@ public ApplicationDto getApplicationDetailInfo(final Long applicationId) { recordResponseList, hairModelApplication.getHairDetail(), hairModelApplication.getInstagramId(), - hairModelApplication.getCreatedDate().format(DateTimeFormatter.ofPattern(dateFormat)), - hairModelApplication.getExpiredDate().format(DateTimeFormatter.ofPattern(dateFormat))); + hairModelApplication.getCreatedDate().format(DateTimeFormatter.ofPattern(DATE_FORMAT)), + hairModelApplication.getExpiredDate().format(DateTimeFormatter.ofPattern(DATE_FORMAT))); } From 8f1b06ed5435fc9806d0bb2e8623e457cd495e6f Mon Sep 17 00:00:00 2001 From: pkl0912 Date: Sat, 2 Mar 2024 14:21:42 +0900 Subject: [PATCH 4/5] #264 [refactor] createDate-> createdDate --- .../controller/application/ApplicationRetrieveController.java | 4 ++-- .../com/moddy/server/controller/model/dto/ApplicationDto.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/moddy/server/controller/application/ApplicationRetrieveController.java b/src/main/java/com/moddy/server/controller/application/ApplicationRetrieveController.java index a5ed67ba..c7f6b82e 100644 --- a/src/main/java/com/moddy/server/controller/application/ApplicationRetrieveController.java +++ b/src/main/java/com/moddy/server/controller/application/ApplicationRetrieveController.java @@ -95,8 +95,8 @@ public SuccessResponse getApplicationDetailInfo( applicationDto.hairDetail(), hairServiceOfferRetrieveService.getIsSendStatus(applicationId, designerId), applicationDto.instgramId(), - applicationDto.createDate(), - applicationDto.expireDate() + applicationDto.createdDate(), + applicationDto.expiredDate() ); ModelInfoResponse modelInfoResponse = new ModelInfoResponse( diff --git a/src/main/java/com/moddy/server/controller/model/dto/ApplicationDto.java b/src/main/java/com/moddy/server/controller/model/dto/ApplicationDto.java index b871378a..dea3dc3f 100644 --- a/src/main/java/com/moddy/server/controller/model/dto/ApplicationDto.java +++ b/src/main/java/com/moddy/server/controller/model/dto/ApplicationDto.java @@ -12,7 +12,7 @@ public record ApplicationDto( List recordResponseList, String hairDetail, String instgramId, - String createDate, - String expireDate + String createdDate, + String expiredDate ) { } From 3b88b0166151c9e4f30a955b6d46c37f58fac8db Mon Sep 17 00:00:00 2001 From: pkl0912 Date: Sat, 2 Mar 2024 16:24:35 +0900 Subject: [PATCH 5/5] =?UTF-8?q?#264=20[refactor]=20createdDate=20=EB=A1=9C?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/dto/response/ApplicationInfoResponse.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/moddy/server/controller/designer/dto/response/ApplicationInfoResponse.java b/src/main/java/com/moddy/server/controller/designer/dto/response/ApplicationInfoResponse.java index 41dc1413..7b67a687 100644 --- a/src/main/java/com/moddy/server/controller/designer/dto/response/ApplicationInfoResponse.java +++ b/src/main/java/com/moddy/server/controller/designer/dto/response/ApplicationInfoResponse.java @@ -11,7 +11,7 @@ public record ApplicationInfoResponse( String hairDetail, boolean isSend, String instagramId, - String createDate, - String expireDate + String createdDate, + String expiredDate ) { }