From bd1f26711b8ea98f06ad5c4c2da2b2d0955594dc Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Thu, 22 Feb 2024 15:22:24 +0900 Subject: [PATCH 01/13] =?UTF-8?q?#250=20[refactor]=20ModelController=20?= =?UTF-8?q?=EC=8A=A4=EC=9B=A8=EA=B1=B0=20Tag=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EB=B0=8F=20=EB=9D=BC=EC=9A=B0=ED=84=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/controller/model/ModelController.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/moddy/server/controller/model/ModelController.java b/src/main/java/com/moddy/server/controller/model/ModelController.java index 6aa37499..f51ddb82 100644 --- a/src/main/java/com/moddy/server/controller/model/ModelController.java +++ b/src/main/java/com/moddy/server/controller/model/ModelController.java @@ -8,11 +8,9 @@ import com.moddy.server.controller.designer.dto.response.UserCreateResponse; import com.moddy.server.controller.model.dto.request.ModelCreateRequest; import com.moddy.server.controller.model.dto.response.ApplicationUserDetailResponse; -import com.moddy.server.controller.model.dto.response.OpenChatResponse; import com.moddy.server.service.model.ModelRegisterService; import com.moddy.server.service.model.ModelRetrieveService; import com.moddy.server.service.model.ModelService; -import com.moddy.server.service.offer.HairServiceOfferRetrieveService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -24,33 +22,32 @@ import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController @RequiredArgsConstructor +@Tag(name = "Model Controller") +@RequestMapping("/model") public class ModelController { private final ModelService modelService; private final ModelRegisterService modelRegisterService; - private final HairServiceOfferRetrieveService hairServiceOfferRetrieveService; private final ModelRetrieveService modelRetrieveService; - @Tag(name = "Auth Controller") @Operation(summary = "모델 회원가입 시 희망 지역 리스트 조회 API") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "희망 지역 리스트 조회 성공입니다."), @ApiResponse(responseCode = "500", description = "서버 내부 오류", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) }) - @GetMapping("/auth/regions") + @GetMapping("/regions") public SuccessResponse> getRegionList() { return SuccessResponse.success(SuccessCode.FIND_REGION_LIST_SUCCESS, modelRetrieveService.getRegionList()); } - @Tag(name = "Auth Controller", description = "로그인 및 회원 가입 관련 API 입니다.") @Operation(summary = "[JWT] 모델 회원가입 API", description = "모델 회원가입 API입니다.") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "모델 회원가입 성공"), @@ -58,7 +55,7 @@ public SuccessResponse> getRegionList() { @ApiResponse(responseCode = "404", description = "유효하지 않은 값을 입력했습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), @ApiResponse(responseCode = "500", description = "서버 내부 오류", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) }) - @PostMapping(value = "/auth/signup/model") + @PostMapping() @SecurityRequirement(name = "JWT Auth") public SuccessResponse createModel( @Parameter(hidden = true) @UserId Long userId, @@ -66,7 +63,6 @@ public SuccessResponse createModel( return SuccessResponse.success(SuccessCode.MODEL_CREATE_SUCCESS, modelRegisterService.createModel(userId, modelCreateRequest)); } - @Tag(name = "ModelController") @Operation(summary = "[JWT] 모델 지원서 최종 확인 시 유저 정보 조회 API", description = "[모델 뷰] 모델 지원서 최종 확인 시 유저 정보 조회 API 입니다.") @ApiResponses({ @ApiResponse(responseCode = "200", description = "모델 지원서 작성 성공"), @@ -75,7 +71,7 @@ public SuccessResponse createModel( @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), }) @SecurityRequirement(name = "JWT Auth") - @GetMapping(value = "/model/application/user") + @GetMapping(value = "/detail") public SuccessResponse getUserDetailInApplication(@Parameter(hidden = true) @UserId Long userId) { return SuccessResponse.success(SuccessCode.CREATE_MODEL_APPLICATION_SUCCESS, modelService.getUserDetailInApplication(userId)); } From 5a23713a755d623ac532cb96e40077e00a3eb261 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Thu, 22 Feb 2024 15:30:14 +0900 Subject: [PATCH 02/13] =?UTF-8?q?#250=20[refactor]=20OfferController=20?= =?UTF-8?q?=EC=8A=A4=EC=9B=A8=EA=B1=B0=20Tag=20=EB=B3=80=EA=B2=BD,?= =?UTF-8?q?=EB=9D=BC=EC=9A=B0=ED=84=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/offer/OfferController.java | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/moddy/server/controller/offer/OfferController.java b/src/main/java/com/moddy/server/controller/offer/OfferController.java index 688d7f65..03d59161 100644 --- a/src/main/java/com/moddy/server/controller/offer/OfferController.java +++ b/src/main/java/com/moddy/server/controller/offer/OfferController.java @@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -33,27 +34,13 @@ @RestController @RequiredArgsConstructor +@Tag(name = "Offer Controller") +@RequestMapping("/offer") public class OfferController { private final HairServiceOfferRetrieveService hairServiceOfferRetrieveService; private final HairServiceOfferRegisterService hairServiceOfferRegisterService; - @Tag(name = "ModelController") - @Operation(summary = "[JWT] 카카오톡 오픈채팅", description = "지원서 캡처 이미지 및 디자이너 정보 조회입니다") - @ApiResponses({ - @ApiResponse(responseCode = "200", description = "모델 메인뷰 조회 성공", content = @Content(schema = @Schema(implementation = OpenChatResponse.class))), - @ApiResponse(responseCode = "401", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), - }) - @GetMapping("/model/{offerId}/agree") - @SecurityRequirement(name = "JWT Auth") - public SuccessResponse getOpenChat( - @Parameter(hidden = true) @UserId Long userId, - @Parameter(name = "offerId", description = "제안서아이디") @PathVariable(value = "offerId") Long offerId) { - return SuccessResponse.success(SuccessCode.OPEN_CHAT_GET_SUCCESS, hairServiceOfferRetrieveService.getOpenChatInfo(userId, offerId)); - } - - @Tag(name = "ModelController") @Operation(summary = "[JWT] 디자이너 제안서 승낙하기", description = "디자이너 제안서 승낙하기 API입니다.") @ApiResponses({ @ApiResponse(responseCode = "200", description = "디자이너 제안서 승낙하기"), @@ -61,7 +48,7 @@ public SuccessResponse getOpenChat( @ApiResponse(responseCode = "404", description = "제안서 아이디가 존재하지 않습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), }) - @PutMapping("/model/offer/{offerId}") + @PutMapping("/{offerId}/agree") @SecurityRequirement(name = "JWT Auth") public SuccessNonDataResponse acceptOffer( @Parameter(hidden = true) @UserId Long userId, @@ -70,14 +57,13 @@ public SuccessNonDataResponse acceptOffer( return SuccessNonDataResponse.success(SuccessCode.OFFER_ACCEPT_SUCCESS); } - @Tag(name = "ModelController") @Operation(summary = "[JWT] 모델 메인 뷰 조회", description = "모델 메인 뷰 조회 API입니다.") @ApiResponses({ @ApiResponse(responseCode = "200", description = "모델 메인뷰 조회 성공", content = @Content(schema = @Schema(implementation = ModelMainOfferResponse.class))), @ApiResponse(responseCode = "401", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), }) - @GetMapping("/model") + @GetMapping() @SecurityRequirement(name = "JWT Auth") public SuccessResponse getModelMainInfo( @Parameter(hidden = true) @UserId Long modelId, @@ -86,7 +72,6 @@ public SuccessResponse getModelMainInfo( return SuccessResponse.success(SuccessCode.FIND_MODEL_MAIN_INFO_SUCCESS, hairServiceOfferRetrieveService.getModelMainOfferInfo(modelId, page, size)); } - @Tag(name = "ModelController") @Operation(summary = "[JWT] 모델에게 온 디자이너 제안 상세보기", description = "제안서 상세보기 API입니다.") @ApiResponses({ @ApiResponse(responseCode = "401", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), @@ -94,7 +79,7 @@ public SuccessResponse getModelMainInfo( @ApiResponse(responseCode = "404", description = "제안서 아이디가 존재하지 않습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), }) - @GetMapping("/model/offer/{offerId}") + @GetMapping("/{offerId}") @SecurityRequirement(name = "JWT Auth") public SuccessResponse getModelDetailOfferInfo( @Parameter(hidden = true) @UserId Long modelId, @@ -102,7 +87,6 @@ public SuccessResponse getModelDetailOfferInfo( return SuccessResponse.success(SuccessCode.FIND_MODEL_DETAIL_OFFER_SUCCESS, hairServiceOfferRetrieveService.getOfferDetail(modelId, offerId)); } - @Tag(name = "DesignerController") @Operation(summary = "[JWT] 제안서 작성하기", description = "제안서 작성하기 API입니다.") @ApiResponses({ @ApiResponse(responseCode = "200", description = "제안서 작성 성공", content = @Content(schema = @Schema(implementation = SuccessNonDataResponse.class))), @@ -111,7 +95,7 @@ public SuccessResponse getModelDetailOfferInfo( @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), }) @SecurityRequirement(name = "JWT Auth") - @PostMapping("/designer/{applicationId}/offer") + @PostMapping("/{applicationId}") public SuccessNonDataResponse offerCreateRequest( @Parameter(hidden = true) @UserId Long designerId, @PathVariable(value = "applicationId") Long applicationId, From af659ef7ed1f420b61604ed18dfa6c9dfeece0ae Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Thu, 22 Feb 2024 15:34:26 +0900 Subject: [PATCH 03/13] =?UTF-8?q?#250=20[refactor]=20ApplicationController?= =?UTF-8?q?=20=EC=8A=A4=EC=9B=A8=EA=B1=B0=20Tag=20=EC=84=A4=EC=A0=95,=20?= =?UTF-8?q?=EB=9D=BC=EC=9A=B0=ED=84=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/ApplicationController.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/moddy/server/controller/application/ApplicationController.java b/src/main/java/com/moddy/server/controller/application/ApplicationController.java index 3bdceb2c..4367eaed 100644 --- a/src/main/java/com/moddy/server/controller/application/ApplicationController.java +++ b/src/main/java/com/moddy/server/controller/application/ApplicationController.java @@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; @@ -37,6 +38,8 @@ @RestController @RequiredArgsConstructor +@Tag(name = "Application Controller") +@RequestMapping("/application") public class ApplicationController { private final HairModelApplicationRegisterService hairModelApplicationRegisterService; @@ -44,7 +47,6 @@ public class ApplicationController { private final ModelRetrieveService modelRetrieveService; private final HairServiceOfferRetrieveService hairServiceOfferRetrieveService; - @Tag(name = "ModelController") @Operation(summary = "[JWT] 모델 지원서 작성", description = "모델 지원서 작성 API입니다.") @ApiResponses({ @ApiResponse(responseCode = "200", description = "모델 지원서 작성 성공"), @@ -52,7 +54,7 @@ public class ApplicationController { @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), }) @SecurityRequirement(name = "JWT Auth") - @PostMapping(value = "/model/application", consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE}) + @PostMapping(consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE}) public SuccessNonDataResponse submitModelApplication( @Parameter(hidden = true) @UserId Long modelId, @RequestPart(value = "modelImgUrl", required = false) MultipartFile modelImgUrl, @@ -61,14 +63,14 @@ public SuccessNonDataResponse submitModelApplication( hairModelApplicationRegisterService.postApplication(modelId, modelImgUrl, applicationCaptureImgUrl, applicationInfo); return SuccessNonDataResponse.success(SuccessCode.CREATE_MODEL_APPLICATION_SUCCESS); } - @Tag(name = "DesignerController") + @Operation(summary = "[JWT] 디자이너 메인 뷰 조회", description = "디자이너 메인 뷰 조회 API입니다.") @ApiResponses({ @ApiResponse(responseCode = "200", description = "디자이너 메인뷰 조회 성공", content = @Content(schema = @Schema(implementation = DesignerMainResponse.class))), @ApiResponse(responseCode = "401", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), }) - @GetMapping(value = "/designer") + @GetMapping() @SecurityRequirement(name = "JWT Auth") public SuccessResponse getDesignerMainInfo( @Parameter(hidden = true) @UserId Long designerId, @@ -76,7 +78,7 @@ public SuccessResponse getDesignerMainInfo( @Parameter(name = "size", description = "페이지 ") @RequestParam(value = "size") int size) { return SuccessResponse.success(SuccessCode.FIND_DESIGNER_MAIN_INFO_SUCCESS, hairModelApplicationRetrieveService.getDesignerMainInfo(designerId, page, size)); } - @Tag(name = "DesignerController") + @Operation(summary = "[JWT] 모델 지원서 상세 조회", description = "모델 지원서 상세 조회 API입니다.") @ApiResponses({ @ApiResponse(responseCode = "200", description = "모델 지원서 상세 조회 성공", content = @Content(schema = @Schema(implementation = ApplicationDetailInfoResponse.class))), @@ -84,7 +86,7 @@ public SuccessResponse getDesignerMainInfo( @ApiResponse(responseCode = "404", description = "지원서 아이디가 존재하지 않습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), }) - @GetMapping("/designer/{applicationId}") + @GetMapping("/{applicationId}") @SecurityRequirement(name = "JWT Auth") public SuccessResponse getApplicationDetailInfo( @Parameter(hidden = true) @UserId Long designerId, From 19fc21583919411c9368ce8c77533b5ac961d048 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Thu, 22 Feb 2024 15:47:32 +0900 Subject: [PATCH 04/13] =?UTF-8?q?#250=20[refactor]=20=EB=94=94=EC=9E=90?= =?UTF-8?q?=EC=9D=B4=EB=84=88=EC=9D=98=20=EC=A0=9C=EC=95=88=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=EB=B3=B4=EA=B8=B0=20-=20Reponse=20=EB=8F=84=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=EB=B3=84=EB=A1=9C=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/ApplicationInfoDetailResponse.java | 10 ++++++++++ .../designer/dto/response/ApplicationInfoResponse.java | 2 -- .../model/dto/response/DesignerInfoResponse.java | 1 + .../dto/response/OfferInfoResponse.java} | 8 +++----- .../controller/offer/response/DetailOfferResponse.java | 7 +++++-- 5 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 src/main/java/com/moddy/server/controller/application/dto/response/ApplicationInfoDetailResponse.java rename src/main/java/com/moddy/server/controller/{model/dto/response/StyleDetailResponse.java => offer/dto/response/OfferInfoResponse.java} (50%) diff --git a/src/main/java/com/moddy/server/controller/application/dto/response/ApplicationInfoDetailResponse.java b/src/main/java/com/moddy/server/controller/application/dto/response/ApplicationInfoDetailResponse.java new file mode 100644 index 00000000..36e1292f --- /dev/null +++ b/src/main/java/com/moddy/server/controller/application/dto/response/ApplicationInfoDetailResponse.java @@ -0,0 +1,10 @@ +package com.moddy.server.controller.application.dto.response; + +import java.util.List; + +public record ApplicationInfoDetailResponse( + Long applicationId, + List preferStyle, + String modelApplicationDetail +) { +} 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 bda471bc..2a2715c8 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 @@ -1,7 +1,5 @@ package com.moddy.server.controller.designer.dto.response; -import com.moddy.server.domain.hair_model_application.HairLength; -import com.moddy.server.domain.prefer_hair_style.HairStyle; import java.util.List; diff --git a/src/main/java/com/moddy/server/controller/model/dto/response/DesignerInfoResponse.java b/src/main/java/com/moddy/server/controller/model/dto/response/DesignerInfoResponse.java index d452c8b0..dc878d6a 100644 --- a/src/main/java/com/moddy/server/controller/model/dto/response/DesignerInfoResponse.java +++ b/src/main/java/com/moddy/server/controller/model/dto/response/DesignerInfoResponse.java @@ -3,6 +3,7 @@ import java.util.List; public record DesignerInfoResponse( + Long designerId, String imgUrl, String shopName, String name, diff --git a/src/main/java/com/moddy/server/controller/model/dto/response/StyleDetailResponse.java b/src/main/java/com/moddy/server/controller/offer/dto/response/OfferInfoResponse.java similarity index 50% rename from src/main/java/com/moddy/server/controller/model/dto/response/StyleDetailResponse.java rename to src/main/java/com/moddy/server/controller/offer/dto/response/OfferInfoResponse.java index 40444207..2d125b07 100644 --- a/src/main/java/com/moddy/server/controller/model/dto/response/StyleDetailResponse.java +++ b/src/main/java/com/moddy/server/controller/offer/dto/response/OfferInfoResponse.java @@ -1,15 +1,13 @@ -package com.moddy.server.controller.model.dto.response; +package com.moddy.server.controller.offer.dto.response; import lombok.Builder; - import java.util.List; @Builder -public record StyleDetailResponse( +public record OfferInfoResponse( + Long offerId, Boolean isAgree, - List preferStyle, String designerOfferDetail, - String modelApplicationDetail, List preferOfferConditions ) { } \ No newline at end of file diff --git a/src/main/java/com/moddy/server/controller/offer/response/DetailOfferResponse.java b/src/main/java/com/moddy/server/controller/offer/response/DetailOfferResponse.java index 37996fd4..6f4f8465 100644 --- a/src/main/java/com/moddy/server/controller/offer/response/DetailOfferResponse.java +++ b/src/main/java/com/moddy/server/controller/offer/response/DetailOfferResponse.java @@ -1,10 +1,13 @@ package com.moddy.server.controller.offer.response; +import com.moddy.server.controller.application.dto.response.ApplicationInfoDetailResponse; import com.moddy.server.controller.model.dto.response.DesignerInfoResponse; -import com.moddy.server.controller.model.dto.response.StyleDetailResponse; + +import com.moddy.server.controller.offer.dto.response.OfferInfoResponse; public record DetailOfferResponse( DesignerInfoResponse designerInfo, - StyleDetailResponse styleDetail + ApplicationInfoDetailResponse applicationInfo, + OfferInfoResponse offerInfo ) { } From 97bf749a247b6141b2f220721da5565993ca1bdf Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Thu, 22 Feb 2024 16:07:04 +0900 Subject: [PATCH 05/13] =?UTF-8?q?#250=20[refactor]=20=EB=94=94=EC=9E=90?= =?UTF-8?q?=EC=9D=B4=EB=84=88=20info=20=EC=97=90=20designerId=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../moddy/server/service/designer/DesignerRetrieveService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/moddy/server/service/designer/DesignerRetrieveService.java b/src/main/java/com/moddy/server/service/designer/DesignerRetrieveService.java index 0d600325..fe5998a3 100644 --- a/src/main/java/com/moddy/server/service/designer/DesignerRetrieveService.java +++ b/src/main/java/com/moddy/server/service/designer/DesignerRetrieveService.java @@ -37,7 +37,7 @@ public DesignerInfoResponse getOfferDesignerInfoResponse(final Long designerId) Designer designer = designerJpaRepository.findById(designerId).orElseThrow(() -> new NotFoundException(ErrorCode.DESIGNER_NOT_FOUND_EXCEPTION)); List dayOfWeekList = getDayOfWeekList(designerId); - DesignerInfoResponse designerInfoResponse = new DesignerInfoResponse(designer.getProfileImgUrl(), designer.getHairShop().getName(), designer.getName(), designer.getPortfolio().getInstagramUrl(), designer.getPortfolio().getNaverPlaceUrl(), designer.getIntroduction(), designer.getGender().getValue(), dayOfWeekList, designer.getHairShop().getAddress(), designer.getHairShop().getDetailAddress()); + DesignerInfoResponse designerInfoResponse = new DesignerInfoResponse(designerId, designer.getProfileImgUrl(), designer.getHairShop().getName(), designer.getName(), designer.getPortfolio().getInstagramUrl(), designer.getPortfolio().getNaverPlaceUrl(), designer.getIntroduction(), designer.getGender().getValue(), dayOfWeekList, designer.getHairShop().getAddress(), designer.getHairShop().getDetailAddress()); return designerInfoResponse; } From baf5faaf37ec3b0357659100bb5cf08a0fd43964 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Thu, 22 Feb 2024 16:07:34 +0900 Subject: [PATCH 06/13] =?UTF-8?q?#250=20[refactor]=20=EC=A7=80=EC=9B=90?= =?UTF-8?q?=EC=84=9C=20=EC=A0=95=EB=B3=B4=20response=EB=8A=94=20Applicatio?= =?UTF-8?q?nRetrieveService=EC=97=90=EC=84=9C=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HairModelApplicationRetrieveService.java | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 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 c86a6fde..cc31f007 100644 --- a/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java +++ b/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java @@ -2,6 +2,7 @@ import com.moddy.server.common.exception.enums.ErrorCode; import com.moddy.server.common.exception.model.NotFoundException; +import com.moddy.server.controller.application.dto.response.ApplicationInfoDetailResponse; import com.moddy.server.controller.designer.dto.response.DesignerMainResponse; import com.moddy.server.controller.designer.dto.response.HairModelApplicationResponse; import com.moddy.server.controller.designer.dto.response.HairRecordResponse; @@ -9,12 +10,10 @@ import com.moddy.server.controller.model.dto.ApplicationModelInfoDto; import com.moddy.server.domain.hair_model_application.HairModelApplication; import com.moddy.server.domain.hair_model_application.repository.HairModelApplicationJpaRepository; -import com.moddy.server.domain.hair_service_offer.repository.HairServiceOfferJpaRepository; import com.moddy.server.domain.hair_service_record.HairServiceRecord; 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.service.designer.DesignerRetrieveService; import com.moddy.server.service.model.ModelRetrieveService; import lombok.RequiredArgsConstructor; @@ -59,7 +58,19 @@ public DesignerMainResponse getDesignerMainInfo(final Long designerId, final int applicationResponsesList ); } - public ApplicationDto getApplicationDetailInfo(final Long applicationId){ + + public ApplicationInfoDetailResponse getOfferApplicationInfo(final Long applicationId) { + List preferHairStyleList = getPreferHairStyle(applicationId); + String applicationHairDetail = getApplicationHairDetail(applicationId); + + return new ApplicationInfoDetailResponse( + applicationId, + preferHairStyleList, + applicationHairDetail + ); + } + + public ApplicationDto getApplicationDetailInfo(final Long applicationId) { HairModelApplication hairModelApplication = hairModelApplicationJpaRepository.findById(applicationId).orElseThrow(() -> new NotFoundException(ErrorCode.NOT_FOUND_APPLICATION_EXCEPTION)); Long modelId = hairModelApplication.getModel().getId(); List preferHairStyles = preferHairStyleJpaRepository.findAllByHairModelApplicationId(applicationId); @@ -87,12 +98,17 @@ public ApplicationDto getApplicationDetailInfo(final Long applicationId){ hairModelApplication.getHairDetail(), hairModelApplication.getInstagramId()); } - public String fetchApplicationHairDetail(final Long applicationId) { + + public boolean fetchModelApplyStatus(final Long modelId) { + return hairModelApplicationJpaRepository.existsByModelId(modelId); + } + + private String getApplicationHairDetail(final Long applicationId) { HairModelApplication hairModelApplication = hairModelApplicationJpaRepository.findById(applicationId).orElseThrow(() -> new NotFoundException(ErrorCode.NOT_FOUND_APPLICATION_EXCEPTION)); return hairModelApplication.getHairDetail(); } - public List fetchPreferHairStyle(final Long applicationId) { + private List getPreferHairStyle(final Long applicationId) { List preferHairStyles = preferHairStyleJpaRepository.findAllByHairModelApplicationId(applicationId); List preferHairStyleList = preferHairStyles.stream().map(hairStyle -> { return hairStyle.getHairStyle().getValue(); @@ -101,11 +117,6 @@ public List fetchPreferHairStyle(final Long applicationId) { return preferHairStyleList; } - - public boolean fetchModelApplyStatus(final Long modelId){ - return hairModelApplicationJpaRepository.existsByModelId(modelId); - } - private Page findApplicationsByPaging(final int page, final int size) { PageRequest pageRequest = PageRequest.of(page - 1, size, Sort.by(Sort.Direction.DESC, "id")); Page applicationPage = hairModelApplicationJpaRepository.findAll(pageRequest); From dd19a9b656f692085efe1d99c47991d85369f853 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Thu, 22 Feb 2024 16:09:14 +0900 Subject: [PATCH 07/13] =?UTF-8?q?#250=20[refactor]=20Offer=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=A1=B0=ED=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HairServiceOfferRetrieveService.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/moddy/server/service/offer/HairServiceOfferRetrieveService.java b/src/main/java/com/moddy/server/service/offer/HairServiceOfferRetrieveService.java index dc1ddf94..ce2ace26 100644 --- a/src/main/java/com/moddy/server/service/offer/HairServiceOfferRetrieveService.java +++ b/src/main/java/com/moddy/server/service/offer/HairServiceOfferRetrieveService.java @@ -2,11 +2,12 @@ import com.moddy.server.common.exception.enums.ErrorCode; import com.moddy.server.common.exception.model.NotFoundException; +import com.moddy.server.controller.application.dto.response.ApplicationInfoDetailResponse; import com.moddy.server.controller.model.dto.DesignerInfoOpenChatDto; import com.moddy.server.controller.model.dto.response.DesignerInfoOpenChatResponse; import com.moddy.server.controller.model.dto.response.DesignerInfoResponse; import com.moddy.server.controller.model.dto.response.OpenChatResponse; -import com.moddy.server.controller.model.dto.response.StyleDetailResponse; +import com.moddy.server.controller.offer.dto.response.OfferInfoResponse; import com.moddy.server.controller.offer.response.DetailOfferResponse; import com.moddy.server.domain.hair_service_offer.HairServiceOffer; import com.moddy.server.domain.hair_service_offer.repository.HairServiceOfferJpaRepository; @@ -64,36 +65,35 @@ public boolean getIsSendStatus(final Long applicationId, final Long userId) { Optional offer = hairServiceOfferJpaRepository.findByHairModelApplicationIdAndDesignerId(applicationId, userId); return offer.isPresent(); } - public DetailOfferResponse getOfferDetail(final Long modelId, final Long offerId) { + + public DetailOfferResponse getOfferDetail(final Long offerId) { HairServiceOffer hairServiceOffer = hairServiceOfferJpaRepository.findById(offerId).orElseThrow(() -> new NotFoundException(ErrorCode.NOT_FOUND_OFFER_EXCEPTION)); DesignerInfoResponse designerInfoResponse = designerRetrieveService.getOfferDesignerInfoResponse(hairServiceOffer.getDesigner().getId()); - StyleDetailResponse styleDetailResponse = getStyleDetailResponse(hairServiceOffer, offerId); + ApplicationInfoDetailResponse applicationInfoDetailResponse = hairModelApplicationRetrieveService.getOfferApplicationInfo(hairServiceOffer.getHairModelApplication().getId()); + OfferInfoResponse offerInfoResponse = getOfferDetailResponse(hairServiceOffer, offerId); + handleOfferClickStatus(hairServiceOffer); - return new DetailOfferResponse(designerInfoResponse, styleDetailResponse); + return new DetailOfferResponse(designerInfoResponse, applicationInfoDetailResponse,offerInfoResponse); } - private StyleDetailResponse getStyleDetailResponse(final HairServiceOffer hairServiceOffer, final Long offerId) { - - String applicationHairDetail = hairModelApplicationRetrieveService.fetchApplicationHairDetail(hairServiceOffer.getHairModelApplication().getId()); - List preferHairStyleList = hairModelApplicationRetrieveService.fetchPreferHairStyle(hairServiceOffer.getHairModelApplication().getId()); + private OfferInfoResponse getOfferDetailResponse(final HairServiceOffer hairServiceOffer, final Long offerId) { List preferOfferConditionList = preferOfferConditionJpaRepository.findAllByHairServiceOfferId(offerId); List offerConditionList = preferOfferConditionList.stream().map(PreferOfferCondition::getOfferCondition).collect(Collectors.toList()); List preferOfferConditionBooleanList = Arrays.stream(OfferCondition.values()).map(offerConditionList::contains).collect(Collectors.toList()); - StyleDetailResponse styleDetailResponse = StyleDetailResponse + OfferInfoResponse offerInfoResponse = OfferInfoResponse .builder() + .offerId(hairServiceOffer.getId()) .isAgree(hairServiceOffer.isModelAgree()) - .preferStyle(preferHairStyleList) .designerOfferDetail(hairServiceOffer.getOfferDetail()) - .modelApplicationDetail(applicationHairDetail) .preferOfferConditions(preferOfferConditionBooleanList) .build(); - return styleDetailResponse; + return offerInfoResponse; } public ModelMainOfferResponse getModelMainOfferInfo(final Long modelId, final int page, final int size) { From 8e3cb60cda9bd9d71bc277404932420adba8eb62 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Thu, 22 Feb 2024 16:09:37 +0900 Subject: [PATCH 08/13] =?UTF-8?q?#250=20[refactor]=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20modelId=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/moddy/server/controller/offer/OfferController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/moddy/server/controller/offer/OfferController.java b/src/main/java/com/moddy/server/controller/offer/OfferController.java index 03d59161..40cfa858 100644 --- a/src/main/java/com/moddy/server/controller/offer/OfferController.java +++ b/src/main/java/com/moddy/server/controller/offer/OfferController.java @@ -84,7 +84,7 @@ public SuccessResponse getModelMainInfo( public SuccessResponse getModelDetailOfferInfo( @Parameter(hidden = true) @UserId Long modelId, @Parameter(name = "offerId", description = "제안서아이디") @PathVariable(value = "offerId") Long offerId) { - return SuccessResponse.success(SuccessCode.FIND_MODEL_DETAIL_OFFER_SUCCESS, hairServiceOfferRetrieveService.getOfferDetail(modelId, offerId)); + return SuccessResponse.success(SuccessCode.FIND_MODEL_DETAIL_OFFER_SUCCESS, hairServiceOfferRetrieveService.getOfferDetail(offerId)); } @Operation(summary = "[JWT] 제안서 작성하기", description = "제안서 작성하기 API입니다.") From 6f27a0792b943f9375b783f469b563044d778592 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Thu, 22 Feb 2024 23:58:04 +0900 Subject: [PATCH 09/13] =?UTF-8?q?#250=20[fix]=20=EC=93=B8=EB=8D=B0=20?= =?UTF-8?q?=EC=97=86=EB=8A=94=20=EA=B4=84=ED=98=B8=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/controller/application/ApplicationController.java | 2 +- .../java/com/moddy/server/controller/model/ModelController.java | 2 +- .../java/com/moddy/server/controller/offer/OfferController.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/moddy/server/controller/application/ApplicationController.java b/src/main/java/com/moddy/server/controller/application/ApplicationController.java index 4367eaed..9688ca3d 100644 --- a/src/main/java/com/moddy/server/controller/application/ApplicationController.java +++ b/src/main/java/com/moddy/server/controller/application/ApplicationController.java @@ -70,7 +70,7 @@ public SuccessNonDataResponse submitModelApplication( @ApiResponse(responseCode = "401", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), }) - @GetMapping() + @GetMapping @SecurityRequirement(name = "JWT Auth") public SuccessResponse getDesignerMainInfo( @Parameter(hidden = true) @UserId Long designerId, diff --git a/src/main/java/com/moddy/server/controller/model/ModelController.java b/src/main/java/com/moddy/server/controller/model/ModelController.java index f51ddb82..6ace2d3a 100644 --- a/src/main/java/com/moddy/server/controller/model/ModelController.java +++ b/src/main/java/com/moddy/server/controller/model/ModelController.java @@ -55,7 +55,7 @@ public SuccessResponse> getRegionList() { @ApiResponse(responseCode = "404", description = "유효하지 않은 값을 입력했습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), @ApiResponse(responseCode = "500", description = "서버 내부 오류", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) }) - @PostMapping() + @PostMapping @SecurityRequirement(name = "JWT Auth") public SuccessResponse createModel( @Parameter(hidden = true) @UserId Long userId, diff --git a/src/main/java/com/moddy/server/controller/offer/OfferController.java b/src/main/java/com/moddy/server/controller/offer/OfferController.java index 40cfa858..99e99bcd 100644 --- a/src/main/java/com/moddy/server/controller/offer/OfferController.java +++ b/src/main/java/com/moddy/server/controller/offer/OfferController.java @@ -63,7 +63,7 @@ public SuccessNonDataResponse acceptOffer( @ApiResponse(responseCode = "401", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), }) - @GetMapping() + @GetMapping @SecurityRequirement(name = "JWT Auth") public SuccessResponse getModelMainInfo( @Parameter(hidden = true) @UserId Long modelId, From 843c1d18cfb554ab6dfbc58d1f87a114cccdd122 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Fri, 23 Feb 2024 00:05:32 +0900 Subject: [PATCH 10/13] =?UTF-8?q?#250=20[refactor]=20Application=20Control?= =?UTF-8?q?ler=20=EC=A1=B0=ED=9A=8C/=EB=93=B1=EB=A1=9D=20=EC=BB=A8?= =?UTF-8?q?=ED=8A=B8=EB=A1=A4=EB=9F=AC=202=EA=B0=80=EC=A7=80=EB=A1=9C=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApplicationRegisterController.java | 52 +++++++++++++++++++ ...ava => ApplicationRetrieveController.java} | 31 +---------- 2 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 src/main/java/com/moddy/server/controller/application/ApplicationRegisterController.java rename src/main/java/com/moddy/server/controller/application/{ApplicationController.java => ApplicationRetrieveController.java} (74%) diff --git a/src/main/java/com/moddy/server/controller/application/ApplicationRegisterController.java b/src/main/java/com/moddy/server/controller/application/ApplicationRegisterController.java new file mode 100644 index 00000000..1559169d --- /dev/null +++ b/src/main/java/com/moddy/server/controller/application/ApplicationRegisterController.java @@ -0,0 +1,52 @@ +package com.moddy.server.controller.application; + +import com.moddy.server.common.dto.ErrorResponse; +import com.moddy.server.common.dto.SuccessNonDataResponse; +import com.moddy.server.common.exception.enums.SuccessCode; +import com.moddy.server.config.resolver.user.UserId; +import com.moddy.server.controller.model.dto.request.ModelApplicationRequest; +import com.moddy.server.service.application.HairModelApplicationRegisterService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RestController +@RequiredArgsConstructor +@Tag(name = "Application Controller") +@RequestMapping("/application") +public class ApplicationRegisterController { + + private final HairModelApplicationRegisterService hairModelApplicationRegisterService; + + @Operation(summary = "[JWT] 모델 지원서 작성", description = "모델 지원서 작성 API입니다.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "모델 지원서 작성 성공"), + @ApiResponse(responseCode = "400", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + }) + @SecurityRequirement(name = "JWT Auth") + @PostMapping(consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE}) + public SuccessNonDataResponse submitModelApplication( + @Parameter(hidden = true) @UserId Long modelId, + @RequestPart(value = "modelImgUrl", required = false) MultipartFile modelImgUrl, + @RequestPart(value = "applicationCaptureImgUrl", required = false) MultipartFile applicationCaptureImgUrl, + @RequestPart(value = "applicationInfo") @Valid ModelApplicationRequest applicationInfo) { + hairModelApplicationRegisterService.postApplication(modelId, modelImgUrl, applicationCaptureImgUrl, applicationInfo); + return SuccessNonDataResponse.success(SuccessCode.CREATE_MODEL_APPLICATION_SUCCESS); + } + +} + diff --git a/src/main/java/com/moddy/server/controller/application/ApplicationController.java b/src/main/java/com/moddy/server/controller/application/ApplicationRetrieveController.java similarity index 74% rename from src/main/java/com/moddy/server/controller/application/ApplicationController.java rename to src/main/java/com/moddy/server/controller/application/ApplicationRetrieveController.java index 9688ca3d..49b97f6e 100644 --- a/src/main/java/com/moddy/server/controller/application/ApplicationController.java +++ b/src/main/java/com/moddy/server/controller/application/ApplicationRetrieveController.java @@ -1,7 +1,6 @@ package com.moddy.server.controller.application; import com.moddy.server.common.dto.ErrorResponse; -import com.moddy.server.common.dto.SuccessNonDataResponse; import com.moddy.server.common.dto.SuccessResponse; import com.moddy.server.common.exception.enums.SuccessCode; import com.moddy.server.config.resolver.user.UserId; @@ -11,8 +10,6 @@ import com.moddy.server.controller.designer.dto.response.ModelInfoResponse; import com.moddy.server.controller.model.dto.ApplicationDto; import com.moddy.server.controller.model.dto.ApplicationModelInfoDto; -import com.moddy.server.controller.model.dto.request.ModelApplicationRequest; -import com.moddy.server.service.application.HairModelApplicationRegisterService; import com.moddy.server.service.application.HairModelApplicationRetrieveService; import com.moddy.server.service.model.ModelRetrieveService; import com.moddy.server.service.offer.HairServiceOfferRetrieveService; @@ -24,46 +21,23 @@ import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; -import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; @RestController @RequiredArgsConstructor @Tag(name = "Application Controller") @RequestMapping("/application") -public class ApplicationController { +public class ApplicationRetrieveController { - private final HairModelApplicationRegisterService hairModelApplicationRegisterService; private final HairModelApplicationRetrieveService hairModelApplicationRetrieveService; private final ModelRetrieveService modelRetrieveService; private final HairServiceOfferRetrieveService hairServiceOfferRetrieveService; - @Operation(summary = "[JWT] 모델 지원서 작성", description = "모델 지원서 작성 API입니다.") - @ApiResponses({ - @ApiResponse(responseCode = "200", description = "모델 지원서 작성 성공"), - @ApiResponse(responseCode = "400", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), - }) - @SecurityRequirement(name = "JWT Auth") - @PostMapping(consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE}) - public SuccessNonDataResponse submitModelApplication( - @Parameter(hidden = true) @UserId Long modelId, - @RequestPart(value = "modelImgUrl", required = false) MultipartFile modelImgUrl, - @RequestPart(value = "applicationCaptureImgUrl", required = false) MultipartFile applicationCaptureImgUrl, - @RequestPart(value = "applicationInfo") @Valid ModelApplicationRequest applicationInfo) { - hairModelApplicationRegisterService.postApplication(modelId, modelImgUrl, applicationCaptureImgUrl, applicationInfo); - return SuccessNonDataResponse.success(SuccessCode.CREATE_MODEL_APPLICATION_SUCCESS); - } - @Operation(summary = "[JWT] 디자이너 메인 뷰 조회", description = "디자이너 메인 뷰 조회 API입니다.") @ApiResponses({ @ApiResponse(responseCode = "200", description = "디자이너 메인뷰 조회 성공", content = @Content(schema = @Schema(implementation = DesignerMainResponse.class))), @@ -112,8 +86,7 @@ public SuccessResponse getApplicationDetailInfo( applicationDto.instgramId() ); - ApplicationDetailInfoResponse applicationDetailInfoResponse = new ApplicationDetailInfoResponse(applicationInfoResponse,modelInfoResponse); + ApplicationDetailInfoResponse applicationDetailInfoResponse = new ApplicationDetailInfoResponse(applicationInfoResponse, modelInfoResponse); return SuccessResponse.success(SuccessCode.MODEL_APPLICATION_DETAil_INFO_SUCCESS, applicationDetailInfoResponse); } } - From 9e111684c60cac9d2bbcfe56d84edf41984b7f21 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Fri, 23 Feb 2024 00:18:07 +0900 Subject: [PATCH 11/13] =?UTF-8?q?#250=20[refactor]=20Offer=20Controller=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C/=EB=93=B1=EB=A1=9D=20=EC=BB=A8=ED=8A=B8?= =?UTF-8?q?=EB=A1=A4=EB=9F=AC=202=EA=B0=80=EC=A7=80=EB=A1=9C=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ller.java => OfferRegisterController.java} | 43 +------------ .../offer/OfferRetrieveController.java | 64 +++++++++++++++++++ 2 files changed, 67 insertions(+), 40 deletions(-) rename src/main/java/com/moddy/server/controller/offer/{OfferController.java => OfferRegisterController.java} (56%) create mode 100644 src/main/java/com/moddy/server/controller/offer/OfferRetrieveController.java diff --git a/src/main/java/com/moddy/server/controller/offer/OfferController.java b/src/main/java/com/moddy/server/controller/offer/OfferRegisterController.java similarity index 56% rename from src/main/java/com/moddy/server/controller/offer/OfferController.java rename to src/main/java/com/moddy/server/controller/offer/OfferRegisterController.java index 99e99bcd..37728115 100644 --- a/src/main/java/com/moddy/server/controller/offer/OfferController.java +++ b/src/main/java/com/moddy/server/controller/offer/OfferRegisterController.java @@ -2,15 +2,10 @@ import com.moddy.server.common.dto.ErrorResponse; import com.moddy.server.common.dto.SuccessNonDataResponse; -import com.moddy.server.common.dto.SuccessResponse; import com.moddy.server.common.exception.enums.SuccessCode; import com.moddy.server.config.resolver.user.UserId; import com.moddy.server.controller.designer.dto.request.OfferCreateRequest; -import com.moddy.server.controller.model.dto.response.OpenChatResponse; -import com.moddy.server.controller.offer.dto.response.ModelMainOfferResponse; -import com.moddy.server.controller.offer.response.DetailOfferResponse; import com.moddy.server.service.offer.HairServiceOfferRegisterService; -import com.moddy.server.service.offer.HairServiceOfferRetrieveService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -21,13 +16,11 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.io.IOException; @@ -36,9 +29,8 @@ @RequiredArgsConstructor @Tag(name = "Offer Controller") @RequestMapping("/offer") -public class OfferController { +public class OfferRegisterController { - private final HairServiceOfferRetrieveService hairServiceOfferRetrieveService; private final HairServiceOfferRegisterService hairServiceOfferRegisterService; @Operation(summary = "[JWT] 디자이너 제안서 승낙하기", description = "디자이너 제안서 승낙하기 API입니다.") @@ -57,36 +49,6 @@ public SuccessNonDataResponse acceptOffer( return SuccessNonDataResponse.success(SuccessCode.OFFER_ACCEPT_SUCCESS); } - @Operation(summary = "[JWT] 모델 메인 뷰 조회", description = "모델 메인 뷰 조회 API입니다.") - @ApiResponses({ - @ApiResponse(responseCode = "200", description = "모델 메인뷰 조회 성공", content = @Content(schema = @Schema(implementation = ModelMainOfferResponse.class))), - @ApiResponse(responseCode = "401", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), - }) - @GetMapping - @SecurityRequirement(name = "JWT Auth") - public SuccessResponse getModelMainInfo( - @Parameter(hidden = true) @UserId Long modelId, - @Parameter(name = "page", description = "페이지 ") @RequestParam(value = "page") int page, - @Parameter(name = "size", description = "페이지 ") @RequestParam(value = "size") int size) { - return SuccessResponse.success(SuccessCode.FIND_MODEL_MAIN_INFO_SUCCESS, hairServiceOfferRetrieveService.getModelMainOfferInfo(modelId, page, size)); - } - - @Operation(summary = "[JWT] 모델에게 온 디자이너 제안 상세보기", description = "제안서 상세보기 API입니다.") - @ApiResponses({ - @ApiResponse(responseCode = "401", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse(responseCode = "200", description = "제안서 상세보기 조회 성공", content = @Content(schema = @Schema(implementation = DetailOfferResponse.class))), - @ApiResponse(responseCode = "404", description = "제안서 아이디가 존재하지 않습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), - }) - @GetMapping("/{offerId}") - @SecurityRequirement(name = "JWT Auth") - public SuccessResponse getModelDetailOfferInfo( - @Parameter(hidden = true) @UserId Long modelId, - @Parameter(name = "offerId", description = "제안서아이디") @PathVariable(value = "offerId") Long offerId) { - return SuccessResponse.success(SuccessCode.FIND_MODEL_DETAIL_OFFER_SUCCESS, hairServiceOfferRetrieveService.getOfferDetail(offerId)); - } - @Operation(summary = "[JWT] 제안서 작성하기", description = "제안서 작성하기 API입니다.") @ApiResponses({ @ApiResponse(responseCode = "200", description = "제안서 작성 성공", content = @Content(schema = @Schema(implementation = SuccessNonDataResponse.class))), @@ -103,4 +65,5 @@ public SuccessNonDataResponse offerCreateRequest( hairServiceOfferRegisterService.postOffer(designerId, applicationId, offerCreateRequest); return SuccessNonDataResponse.success(SuccessCode.POST_OFFER_SUCCESS); } -} \ No newline at end of file + +} diff --git a/src/main/java/com/moddy/server/controller/offer/OfferRetrieveController.java b/src/main/java/com/moddy/server/controller/offer/OfferRetrieveController.java new file mode 100644 index 00000000..0d4a7009 --- /dev/null +++ b/src/main/java/com/moddy/server/controller/offer/OfferRetrieveController.java @@ -0,0 +1,64 @@ +package com.moddy.server.controller.offer; + +import com.moddy.server.common.dto.ErrorResponse; +import com.moddy.server.common.dto.SuccessResponse; +import com.moddy.server.common.exception.enums.SuccessCode; +import com.moddy.server.config.resolver.user.UserId; +import com.moddy.server.controller.offer.dto.response.ModelMainOfferResponse; +import com.moddy.server.controller.offer.response.DetailOfferResponse; +import com.moddy.server.service.offer.HairServiceOfferRetrieveService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@RequiredArgsConstructor +@Tag(name = "Offer Controller") +@RequestMapping("/offer") +public class OfferRetrieveController { + + private final HairServiceOfferRetrieveService hairServiceOfferRetrieveService; + + @Operation(summary = "[JWT] 모델 메인 뷰 조회", description = "모델 메인 뷰 조회 API입니다.") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "모델 메인뷰 조회 성공", content = @Content(schema = @Schema(implementation = ModelMainOfferResponse.class))), + @ApiResponse(responseCode = "401", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + }) + @GetMapping + @SecurityRequirement(name = "JWT Auth") + public SuccessResponse getModelMainInfo( + @Parameter(hidden = true) @UserId Long modelId, + @Parameter(name = "page", description = "페이지 ") @RequestParam(value = "page") int page, + @Parameter(name = "size", description = "페이지 ") @RequestParam(value = "size") int size) { + return SuccessResponse.success(SuccessCode.FIND_MODEL_MAIN_INFO_SUCCESS, hairServiceOfferRetrieveService.getModelMainOfferInfo(modelId, page, size)); + } + + @Operation(summary = "[JWT] 모델에게 온 디자이너 제안 상세보기", description = "제안서 상세보기 API입니다.") + @ApiResponses({ + @ApiResponse(responseCode = "401", description = "인증 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse(responseCode = "200", description = "제안서 상세보기 조회 성공", content = @Content(schema = @Schema(implementation = DetailOfferResponse.class))), + @ApiResponse(responseCode = "404", description = "제안서 아이디가 존재하지 않습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse(responseCode = "500", description = "서버 내부 오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + }) + @GetMapping("/{offerId}") + @SecurityRequirement(name = "JWT Auth") + public SuccessResponse getModelDetailOfferInfo( + @Parameter(hidden = true) @UserId Long modelId, + @Parameter(name = "offerId", description = "제안서아이디") @PathVariable(value = "offerId") Long offerId) { + return SuccessResponse.success(SuccessCode.FIND_MODEL_DETAIL_OFFER_SUCCESS, hairServiceOfferRetrieveService.getOfferDetail(offerId)); + } + +} \ No newline at end of file From 3c07be0b2aaecc1018c7a47b7de4c1fe50140ab9 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Fri, 23 Feb 2024 00:18:24 +0900 Subject: [PATCH 12/13] =?UTF-8?q?#250=20[refactor]=20Model=20Controller=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C/=EB=93=B1=EB=A1=9D=20=EC=BB=A8=ED=8A=B8?= =?UTF-8?q?=EB=A1=A4=EB=9F=AC=202=EA=B0=80=EC=A7=80=EB=A1=9C=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/ModelRegisterController.java | 48 +++++++++++++++++++ ...ller.java => ModelRetrieveController.java} | 26 +--------- 2 files changed, 50 insertions(+), 24 deletions(-) create mode 100644 src/main/java/com/moddy/server/controller/model/ModelRegisterController.java rename src/main/java/com/moddy/server/controller/model/{ModelController.java => ModelRetrieveController.java} (66%) diff --git a/src/main/java/com/moddy/server/controller/model/ModelRegisterController.java b/src/main/java/com/moddy/server/controller/model/ModelRegisterController.java new file mode 100644 index 00000000..2a502f8e --- /dev/null +++ b/src/main/java/com/moddy/server/controller/model/ModelRegisterController.java @@ -0,0 +1,48 @@ +package com.moddy.server.controller.model; + +import com.moddy.server.common.dto.ErrorResponse; +import com.moddy.server.common.dto.SuccessResponse; +import com.moddy.server.common.exception.enums.SuccessCode; +import com.moddy.server.config.resolver.user.UserId; +import com.moddy.server.controller.designer.dto.response.UserCreateResponse; +import com.moddy.server.controller.model.dto.request.ModelCreateRequest; +import com.moddy.server.service.model.ModelRegisterService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +@Tag(name = "Model Controller") +@RequestMapping("/model") +public class ModelRegisterController { + + private final ModelRegisterService modelRegisterService; + + @Operation(summary = "[JWT] 모델 회원가입 API", description = "모델 회원가입 API입니다.") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "모델 회원가입 성공"), + @ApiResponse(responseCode = "401", description = "인증오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse(responseCode = "404", description = "유효하지 않은 값을 입력했습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse(responseCode = "500", description = "서버 내부 오류", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) + }) + @PostMapping + @SecurityRequirement(name = "JWT Auth") + public SuccessResponse createModel( + @Parameter(hidden = true) @UserId Long userId, + @Valid @RequestBody ModelCreateRequest modelCreateRequest) { + return SuccessResponse.success(SuccessCode.MODEL_CREATE_SUCCESS, modelRegisterService.createModel(userId, modelCreateRequest)); + } + +} diff --git a/src/main/java/com/moddy/server/controller/model/ModelController.java b/src/main/java/com/moddy/server/controller/model/ModelRetrieveController.java similarity index 66% rename from src/main/java/com/moddy/server/controller/model/ModelController.java rename to src/main/java/com/moddy/server/controller/model/ModelRetrieveController.java index 6ace2d3a..e3f89c78 100644 --- a/src/main/java/com/moddy/server/controller/model/ModelController.java +++ b/src/main/java/com/moddy/server/controller/model/ModelRetrieveController.java @@ -5,10 +5,7 @@ import com.moddy.server.common.exception.enums.SuccessCode; import com.moddy.server.config.resolver.user.UserId; import com.moddy.server.controller.auth.dto.response.RegionResponse; -import com.moddy.server.controller.designer.dto.response.UserCreateResponse; -import com.moddy.server.controller.model.dto.request.ModelCreateRequest; import com.moddy.server.controller.model.dto.response.ApplicationUserDetailResponse; -import com.moddy.server.service.model.ModelRegisterService; import com.moddy.server.service.model.ModelRetrieveService; import com.moddy.server.service.model.ModelService; import io.swagger.v3.oas.annotations.Operation; @@ -19,23 +16,20 @@ import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + import java.util.List; @RestController @RequiredArgsConstructor @Tag(name = "Model Controller") @RequestMapping("/model") -public class ModelController { +public class ModelRetrieveController { private final ModelService modelService; - private final ModelRegisterService modelRegisterService; private final ModelRetrieveService modelRetrieveService; @Operation(summary = "모델 회원가입 시 희망 지역 리스트 조회 API") @@ -48,21 +42,6 @@ public SuccessResponse> getRegionList() { return SuccessResponse.success(SuccessCode.FIND_REGION_LIST_SUCCESS, modelRetrieveService.getRegionList()); } - @Operation(summary = "[JWT] 모델 회원가입 API", description = "모델 회원가입 API입니다.") - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "모델 회원가입 성공"), - @ApiResponse(responseCode = "401", description = "인증오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse(responseCode = "404", description = "유효하지 않은 값을 입력했습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse(responseCode = "500", description = "서버 내부 오류", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) - }) - @PostMapping - @SecurityRequirement(name = "JWT Auth") - public SuccessResponse createModel( - @Parameter(hidden = true) @UserId Long userId, - @Valid @RequestBody ModelCreateRequest modelCreateRequest) { - return SuccessResponse.success(SuccessCode.MODEL_CREATE_SUCCESS, modelRegisterService.createModel(userId, modelCreateRequest)); - } - @Operation(summary = "[JWT] 모델 지원서 최종 확인 시 유저 정보 조회 API", description = "[모델 뷰] 모델 지원서 최종 확인 시 유저 정보 조회 API 입니다.") @ApiResponses({ @ApiResponse(responseCode = "200", description = "모델 지원서 작성 성공"), @@ -75,5 +54,4 @@ public SuccessResponse createModel( public SuccessResponse getUserDetailInApplication(@Parameter(hidden = true) @UserId Long userId) { return SuccessResponse.success(SuccessCode.CREATE_MODEL_APPLICATION_SUCCESS, modelService.getUserDetailInApplication(userId)); } - } From a91be27af7e15b00498c5af4991fad7c2415cbef Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Sat, 24 Feb 2024 16:43:55 +0900 Subject: [PATCH 13/13] =?UTF-8?q?#250=20[fix]=20private=20=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HairModelApplicationRetrieveService.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 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 fbf26e37..8213992d 100644 --- a/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java +++ b/src/main/java/com/moddy/server/service/application/HairModelApplicationRetrieveService.java @@ -98,30 +98,23 @@ public ApplicationDto getApplicationDetailInfo(final Long applicationId) { hairModelApplication.getHairDetail(), hairModelApplication.getInstagramId()); } - public String fetchApplicationHairDetail(final Long applicationId) { - HairModelApplication hairModelApplication = hairModelApplicationJpaRepository.findById(applicationId).orElseThrow(() -> new NotFoundException(ErrorCode.NOT_FOUND_APPLICATION_EXCEPTION)); - return hairModelApplication.getHairDetail(); - } - - private List getPreferHairStyle(final Long applicationId) { - List preferHairStyles = preferHairStyleJpaRepository.findAllByHairModelApplicationId(applicationId); - List preferHairStyleList = preferHairStyles.stream().map(hairStyle -> { - return hairStyle.getHairStyle().getValue(); - }).collect(Collectors.toList()); - return preferHairStyleList; - } - - - public boolean fetchModelApplyStatus(final Long modelId){ + public boolean fetchModelApplyStatus(final Long modelId) { return hairModelApplicationJpaRepository.existsByModelId(modelId); } - public ApplicationImgUrlResponse getApplicationImgUrl(final Long applicationId){ + public ApplicationImgUrlResponse getApplicationImgUrl(final Long applicationId) { return new ApplicationImgUrlResponse(hairModelApplicationJpaRepository.findById(applicationId).get().getApplicationCaptureUrl()); } + public DownloadUrlResponseDto getApplicationCaptureDownloadUrl(final Long applicationId) { + final HairModelApplication hairModelApplication = hairModelApplicationJpaRepository.findById(applicationId) + .orElseThrow(() -> new NotFoundException(ErrorCode.NOT_FOUND_APPLICATION_EXCEPTION)); + final String applicationDownloadUrl = s3Service.getPreSignedUrlToDownload(hairModelApplication.getApplicationCaptureUrl()); + return new DownloadUrlResponseDto(applicationDownloadUrl); + } + private Page findApplicationsByPaging(final int page, final int size) { PageRequest pageRequest = PageRequest.of(page - 1, size, Sort.by(Sort.Direction.DESC, "id")); Page applicationPage = hairModelApplicationJpaRepository.findAll(pageRequest); @@ -129,11 +122,18 @@ private Page findApplicationsByPaging(final int page, fina return applicationPage; } - public DownloadUrlResponseDto getApplicationCaptureDownloadUrl(final Long applicationId) { - final HairModelApplication hairModelApplication = hairModelApplicationJpaRepository.findById(applicationId) - .orElseThrow(() -> new NotFoundException(ErrorCode.NOT_FOUND_APPLICATION_EXCEPTION)); - final String applicationDownloadUrl = s3Service.getPreSignedUrlToDownload(hairModelApplication.getApplicationCaptureUrl()); - return new DownloadUrlResponseDto(applicationDownloadUrl); + private String getApplicationHairDetail(final Long applicationId) { + HairModelApplication hairModelApplication = hairModelApplicationJpaRepository.findById(applicationId).orElseThrow(() -> new NotFoundException(ErrorCode.NOT_FOUND_APPLICATION_EXCEPTION)); + return hairModelApplication.getHairDetail(); + } + + private List getPreferHairStyle(final Long applicationId) { + List preferHairStyles = preferHairStyleJpaRepository.findAllByHairModelApplicationId(applicationId); + List preferHairStyleList = preferHairStyles.stream().map(hairStyle -> { + return hairStyle.getHairStyle().getValue(); + }).collect(Collectors.toList()); + + return preferHairStyleList; } private HairModelApplicationResponse getApplicationResponse(final HairModelApplication application) {