From 2e145b58a3ce3f83abc17656d8ea973b28bd9401 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Sun, 14 Jan 2024 12:54:43 +0900 Subject: [PATCH 01/13] =?UTF-8?q?#117=20[fix]=20Controller=20userID?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/moddy/server/controller/auth/AuthController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/moddy/server/controller/auth/AuthController.java b/src/main/java/com/moddy/server/controller/auth/AuthController.java index 21eac6ae..453915ed 100644 --- a/src/main/java/com/moddy/server/controller/auth/AuthController.java +++ b/src/main/java/com/moddy/server/controller/auth/AuthController.java @@ -91,21 +91,21 @@ SuccessResponse createDesigner( return SuccessResponse.success(SuccessCode.DESIGNER_CREATE_SUCCESS, designerService.createDesigner(servletRequest.getHeader(ORIGIN), kakaoCode, designerInfo, profileImg)); } - @Operation(summary = "[KAKAO CODE] 모델 회원가입 API", description = "모델 회원가입 API입니다.") + @Operation(summary = "[JWT] 모델 회원가입 API", description = "모델 회원가입 API입니다.") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "모델 회원가입 성공"), - @ApiResponse(responseCode = "400", description = "유효하지 않은 카카오 코드를 입력했습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse(responseCode = "400", 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(value = "/signup/model") @SecurityRequirement(name = "JWT Auth") public SuccessResponse createModel( - @Parameter(hidden = true) @KakaoCode String kakaoCode, + @Parameter(hidden = true) @UserId String userId, @Parameter(hidden = true) HttpServletRequest request, @RequestBody ModelCreateRequest modelCreateRequest ) { - return SuccessResponse.success(SuccessCode.MODEL_CREATE_SUCCESS, modelService.createModel(request.getHeader(ORIGIN), kakaoCode, modelCreateRequest)); + return SuccessResponse.success(SuccessCode.MODEL_CREATE_SUCCESS, modelService.createModel(request.getHeader(ORIGIN), userId, modelCreateRequest)); } @Operation(summary = "[SMS 기능 미완성] 인증번호 요청 API", description = "인증번호 요청 API입니다.") From 0ab6210fb6e838a2312ad9bb5144d079b9e2dd22 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Sun, 14 Jan 2024 22:37:38 +0900 Subject: [PATCH 02/13] =?UTF-8?q?#117=20[fix]=20kakaoID=20=EB=8C=80?= =?UTF-8?q?=EC=8B=9C=20JWT=20Token=EC=9D=84=20=EB=B0=9B=EB=8A=94=20?= =?UTF-8?q?=ED=98=95=EC=8B=9D=EC=9C=BC=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 --- .../com/moddy/server/controller/auth/AuthController.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/moddy/server/controller/auth/AuthController.java b/src/main/java/com/moddy/server/controller/auth/AuthController.java index 453915ed..754036b5 100644 --- a/src/main/java/com/moddy/server/controller/auth/AuthController.java +++ b/src/main/java/com/moddy/server/controller/auth/AuthController.java @@ -101,11 +101,10 @@ SuccessResponse createDesigner( @PostMapping(value = "/signup/model") @SecurityRequirement(name = "JWT Auth") public SuccessResponse createModel( - @Parameter(hidden = true) @UserId String userId, - @Parameter(hidden = true) HttpServletRequest request, + @Parameter(hidden = true) @UserId Long userId, @RequestBody ModelCreateRequest modelCreateRequest ) { - return SuccessResponse.success(SuccessCode.MODEL_CREATE_SUCCESS, modelService.createModel(request.getHeader(ORIGIN), userId, modelCreateRequest)); + return SuccessResponse.success(SuccessCode.MODEL_CREATE_SUCCESS, modelService.createModel(userId, modelCreateRequest)); } @Operation(summary = "[SMS 기능 미완성] 인증번호 요청 API", description = "인증번호 요청 API입니다.") From 95480b75a8abb797bca2e9279a30c74b8e5d36d4 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Sun, 14 Jan 2024 22:39:23 +0900 Subject: [PATCH 03/13] =?UTF-8?q?#117=20[fix]=20=EA=B8=B0=EC=A1=B4=20?= =?UTF-8?q?=EA=B0=9D=EC=B2=B4=EC=9D=98=20Setter=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/moddy/server/domain/model/Model.java | 6 ++++++ src/main/java/com/moddy/server/domain/user/User.java | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/moddy/server/domain/model/Model.java b/src/main/java/com/moddy/server/domain/model/Model.java index 3dc628d6..3de976fc 100644 --- a/src/main/java/com/moddy/server/domain/model/Model.java +++ b/src/main/java/com/moddy/server/domain/model/Model.java @@ -2,16 +2,22 @@ import com.moddy.server.domain.user.User; import jakarta.persistence.Entity; +import jakarta.validation.constraints.NotNull; import lombok.Getter; import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; +import lombok.Setter; import lombok.experimental.SuperBuilder; @Getter +@Setter @Entity @NoArgsConstructor @AllArgsConstructor @SuperBuilder public class Model extends User { + + @NotNull private String year; + } diff --git a/src/main/java/com/moddy/server/domain/user/User.java b/src/main/java/com/moddy/server/domain/user/User.java index 69f1ef3f..2d0de4da 100644 --- a/src/main/java/com/moddy/server/domain/user/User.java +++ b/src/main/java/com/moddy/server/domain/user/User.java @@ -11,6 +11,7 @@ @Entity @Getter +@Setter @SuperBuilder @Inheritance(strategy = InheritanceType.JOINED) @NoArgsConstructor @@ -24,27 +25,20 @@ public class User extends BaseTimeEntity { @NotNull private String kakaoId; - @NotNull private String name; @Enumerated(value = EnumType.STRING) - @NotNull private Gender gender; - @NotNull private String phoneNumber; - @NotNull private Boolean isMarketingAgree; - @NotNull private String profileImgUrl; - @NotNull @Enumerated(EnumType.STRING) private Role role; - public Integer getAge(String year){ LocalDateTime currentDateTime = LocalDateTime.now(); Integer age = currentDateTime.getYear() - Integer.parseInt(year) + 1 ; From b3e8e0768c290140ce18a1f97c5ee703ee83f3b5 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Sun, 14 Jan 2024 22:49:16 +0900 Subject: [PATCH 04/13] =?UTF-8?q?#117=20[fix]=20model=20=EA=B0=9D=EC=B2=B4?= =?UTF-8?q?=20=EC=83=9D=EC=84=B1=20service=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../moddy/server/service/model/ModelService.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/moddy/server/service/model/ModelService.java b/src/main/java/com/moddy/server/service/model/ModelService.java index 29d50822..f1edab27 100644 --- a/src/main/java/com/moddy/server/service/model/ModelService.java +++ b/src/main/java/com/moddy/server/service/model/ModelService.java @@ -38,11 +38,13 @@ import com.moddy.server.domain.user.Gender; import com.moddy.server.domain.user.Role; import com.moddy.server.domain.user.User; +import com.moddy.server.domain.user.repository.UserRepository; import com.moddy.server.external.kakao.service.KakaoSocialService; import com.moddy.server.external.s3.S3Service; import com.moddy.server.service.auth.AuthService; import lombok.RequiredArgsConstructor; import org.hibernate.Length; +import org.springframework.beans.BeanUtils; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; @@ -60,6 +62,7 @@ public class ModelService { private final ModelJpaRepository modelJpaRepository; + private final UserRepository userRepository; private final DesignerJpaRepository designerJpaRepository; private final HairModelApplicationJpaRepository hairModelApplicationJpaRepository; private final HairServiceOfferJpaRepository hairServiceOfferJpaRepository; @@ -69,7 +72,6 @@ public class ModelService { private final PreferRegionJpaRepository preferRegionJpaRepository; private final RegionJpaRepository regionJpaRepository; private final HairServiceRecordJpaRepository hairServiceRecordJpaRepository; - private final KakaoSocialService kakaoSocialService; private final AuthService authService; private final S3Service s3Service; @@ -240,20 +242,19 @@ public void updateOfferAgreeStatus(Long offerId){ } @Transactional - public UserCreateResponse createModel(String baseUrl, String code, ModelCreateRequest request) { + public UserCreateResponse createModel(Long userId, ModelCreateRequest request) { - String kakaoId = kakaoSocialService.getIdFromKakao(baseUrl, code); + User user = userRepository.findById(userId).orElseThrow(() -> new NotFoundException(ErrorCode.USER_NOT_FOUND_EXCEPTION)); Model model = Model.builder() + .kakaoId(user.getKakaoId()) .name(request.name()) - .year(request.year()) .gender(request.gender()) .phoneNumber(request.phoneNumber()) .isMarketingAgree(request.isMarketingAgree()) .profileImgUrl(s3Service.getDefaultProfileImageUrl()) - .kakaoId(kakaoId) .role(Role.MODEL) - .build(); + .year(request.year()).build(); modelJpaRepository.save(model); From b4bddbd59c1f8d037953c8e826e30fb723d83163 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Mon, 15 Jan 2024 00:09:34 +0900 Subject: [PATCH 05/13] =?UTF-8?q?#117=20[fix]=20model=20Service=20user=20?= =?UTF-8?q?=EA=B0=92=20update=20->=20Builder=EB=A1=9C=20Model=20=EA=B0=9D?= =?UTF-8?q?=EC=B2=B4=20=EC=83=9D=EC=84=B1=EC=9C=BC=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/service/model/ModelService.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/moddy/server/service/model/ModelService.java b/src/main/java/com/moddy/server/service/model/ModelService.java index f1edab27..b414c8c7 100644 --- a/src/main/java/com/moddy/server/service/model/ModelService.java +++ b/src/main/java/com/moddy/server/service/model/ModelService.java @@ -246,14 +246,22 @@ public UserCreateResponse createModel(Long userId, ModelCreateRequest request) { User user = userRepository.findById(userId).orElseThrow(() -> new NotFoundException(ErrorCode.USER_NOT_FOUND_EXCEPTION)); + user.setName(request.name()); + user.setGender(request.gender()); + user.setPhoneNumber(request.phoneNumber()); + user.setIsMarketingAgree(request.isMarketingAgree()); + user.setProfileImgUrl(s3Service.getDefaultProfileImageUrl()); + user.setRole(Role.MODEL); + Model model = Model.builder() + .id(user.getId()) .kakaoId(user.getKakaoId()) - .name(request.name()) - .gender(request.gender()) - .phoneNumber(request.phoneNumber()) - .isMarketingAgree(request.isMarketingAgree()) - .profileImgUrl(s3Service.getDefaultProfileImageUrl()) - .role(Role.MODEL) + .name(user.getName()) + .gender(user.getGender()) + .phoneNumber(user.getPhoneNumber()) + .isMarketingAgree(user.getIsMarketingAgree()) + .profileImgUrl(user.getProfileImgUrl()) + .role(user.getRole()) .year(request.year()).build(); modelJpaRepository.save(model); From f4780b9169ee1e5f2fff3b0bdd0f695b24f612dc Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Tue, 16 Jan 2024 01:34:33 +0900 Subject: [PATCH 06/13] =?UTF-8?q?#117=20[fix]=20Designer=20Repository=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 --- .../domain/designer/repository/DesignerJpaRepository.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/moddy/server/domain/designer/repository/DesignerJpaRepository.java b/src/main/java/com/moddy/server/domain/designer/repository/DesignerJpaRepository.java index a0ef03d8..0c0c58d9 100644 --- a/src/main/java/com/moddy/server/domain/designer/repository/DesignerJpaRepository.java +++ b/src/main/java/com/moddy/server/domain/designer/repository/DesignerJpaRepository.java @@ -9,8 +9,10 @@ import java.util.Optional; public interface DesignerJpaRepository extends JpaRepository { + @Modifying(clearAutomatically = true) @Query(value = "insert into Designer (id, hair_shop_address, hair_shop_detail_address, hair_shop_name, instagram_url, naver_place_url, introduction, kakao_open_chat_url) VALUES (:id, :hairShopAddress, :hairShopDetailAddress, :hairShopName, :instagramUrl, :naverPlaceUrl, :introduction, :kakaoOpenChatUrl)", nativeQuery = true) void designerRegister(@Param("id") Long id, @Param("hairShopAddress") String hairShopAddress, @Param("hairShopDetailAddress") String hairShopDetailAddress, @Param("hairShopName") String hairShopName, @Param("instagramUrl") String instagramUrl, @Param("naverPlaceUrl") String naverPlaceUrl, @Param("introduction") String introduction, @Param("kakaoOpenChatUrl") String kakaoOpenChatUrl); + Optional findById(Long userId); } \ No newline at end of file From f3934509bdfa805f0027835b219d8a1b3bb83887 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Tue, 16 Jan 2024 01:34:46 +0900 Subject: [PATCH 07/13] =?UTF-8?q?#117=20[fix]=20User=20Setter=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 --- src/main/java/com/moddy/server/domain/user/User.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/moddy/server/domain/user/User.java b/src/main/java/com/moddy/server/domain/user/User.java index 0b55564f..9620069c 100644 --- a/src/main/java/com/moddy/server/domain/user/User.java +++ b/src/main/java/com/moddy/server/domain/user/User.java @@ -19,7 +19,6 @@ @Entity @Getter -@Setter @SuperBuilder @Inheritance(strategy = InheritanceType.JOINED) @NoArgsConstructor From 4080b66af4ee91881f8caad1a80bc3c7c86cd136 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Tue, 16 Jan 2024 01:35:02 +0900 Subject: [PATCH 08/13] =?UTF-8?q?#117=20[fix]=20Model=20create=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/service/model/ModelService.java | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/moddy/server/service/model/ModelService.java b/src/main/java/com/moddy/server/service/model/ModelService.java index 3ba5a389..f790be73 100644 --- a/src/main/java/com/moddy/server/service/model/ModelService.java +++ b/src/main/java/com/moddy/server/service/model/ModelService.java @@ -122,22 +122,13 @@ public ModelMainResponse getModelMainInfo(Long userId, int page, int size){ } @Transactional - public UserCreateResponse createModel(String baseUrl, String code, ModelCreateRequest request) { - - String kakaoId = kakaoSocialService.getIdFromKakao(baseUrl, code); - - Model model = Model.builder() - .name(request.name()) - .year(request.year()) - .gender(request.gender()) - .phoneNumber(request.phoneNumber()) - .isMarketingAgree(request.isMarketingAgree()) - .profileImgUrl(s3Service.getDefaultProfileImageUrl()) - .kakaoId(kakaoId) - .role(Role.MODEL) - .build(); + public UserCreateResponse createModel(long userId, ModelCreateRequest request) { + + User user = userRepository.findById(userId).orElseThrow(() -> new NotFoundException(ErrorCode.USER_NOT_FOUND_EXCEPTION)); + user.update(request.name(),request.gender(), request.phoneNumber(), request.isMarketingAgree(), s3Service.getDefaultProfileImageUrl(), Role.MODEL); - modelJpaRepository.save(model); + modelJpaRepository.modelRegister(userId, request.year()); + Model model = modelJpaRepository.findById(userId).orElseThrow(() -> new NotFoundException(ErrorCode.MODEL_NOT_FOUND_EXCEPTION)); request.preferRegions().stream().forEach(preferRegionId -> { Region region = regionJpaRepository.findById(preferRegionId).orElseThrow(() -> new NotFoundException(ErrorCode.NOT_FOUND_REGION_EXCEPTION)); From fd6d9ad18c8cf1fa9b5b6d722110eb17dd321fd4 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Tue, 16 Jan 2024 01:35:22 +0900 Subject: [PATCH 09/13] =?UTF-8?q?#117=20[fix]=20Model=20JPQL=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/model/repository/ModelJpaRepository.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/moddy/server/domain/model/repository/ModelJpaRepository.java b/src/main/java/com/moddy/server/domain/model/repository/ModelJpaRepository.java index 8965058e..9b01d072 100644 --- a/src/main/java/com/moddy/server/domain/model/repository/ModelJpaRepository.java +++ b/src/main/java/com/moddy/server/domain/model/repository/ModelJpaRepository.java @@ -2,13 +2,19 @@ import com.moddy.server.domain.model.Model; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import java.util.Optional; @Repository public interface ModelJpaRepository extends JpaRepository { - Optional findById(Long userId); + + @Modifying(clearAutomatically = true) + @Query(value = "insert into Model (id, year) VALUES (:id, :year)", nativeQuery = true) + void modelRegister(@Param("id") Long id, @Param("year") String year); } From 27f9c370de6e62c6701e434a2487523268b41a4c Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Tue, 16 Jan 2024 02:07:09 +0900 Subject: [PATCH 10/13] =?UTF-8?q?#117=20[refactor]=20Controller=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20refactoring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/controller/auth/AuthController.java | 14 ++++++-------- .../controller/designer/DesignerController.java | 12 ++++++------ .../server/controller/model/ModelController.java | 10 ++++------ 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/moddy/server/controller/auth/AuthController.java b/src/main/java/com/moddy/server/controller/auth/AuthController.java index c97872f7..bf8c1487 100644 --- a/src/main/java/com/moddy/server/controller/auth/AuthController.java +++ b/src/main/java/com/moddy/server/controller/auth/AuthController.java @@ -45,6 +45,7 @@ @RequestMapping("/auth") @RequiredArgsConstructor public class AuthController { + private static final String ORIGIN = "origin"; private final AuthService authService; private final DesignerService designerService; @@ -62,8 +63,7 @@ public class AuthController { @SecurityRequirement(name = "JWT Auth") public SuccessResponse login( @Parameter(hidden = true) @KakaoCode String kakaoCode, - @Parameter(hidden = true) HttpServletRequest request - ) { + @Parameter(hidden = true) HttpServletRequest request) { return SuccessResponse.success(SOCIAL_LOGIN_SUCCESS, authService.login(request.getHeader(ORIGIN), kakaoCode)); } @@ -87,8 +87,7 @@ public SuccessResponse> getRegionList() { SuccessResponse createDesigner( @Parameter(hidden = true) @UserId Long userId, @RequestPart("profileImg") MultipartFile profileImg, - @RequestPart("designerInfo") DesignerCreateRequest designerInfo - ) { + @RequestPart("designerInfo") DesignerCreateRequest designerInfo) { return SuccessResponse.success(SuccessCode.DESIGNER_CREATE_SUCCESS, designerService.createDesigner(userId, designerInfo, profileImg)); } @@ -103,8 +102,7 @@ SuccessResponse createDesigner( @SecurityRequirement(name = "JWT Auth") public SuccessResponse createModel( @Parameter(hidden = true) @UserId Long userId, - @RequestBody ModelCreateRequest modelCreateRequest - ) { + @RequestBody ModelCreateRequest modelCreateRequest) { return SuccessResponse.success(SuccessCode.MODEL_CREATE_SUCCESS, modelService.createModel(userId, modelCreateRequest)); } @@ -128,8 +126,7 @@ public SuccessNonDataResponse sendVerificationCodeMessageToUser(@RequestBody Pho responseCode = "400", description = "1. 인증번호가 일치하지 않습니다." + "2. 만료된 인증 코드입니다.", - content = @Content(schema = @Schema(implementation = ErrorResponse.class)) - ), + 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))) }) @@ -152,4 +149,5 @@ public SuccessNonDataResponse logout(@UserId Long userId) { authService.logout(userId); return SuccessNonDataResponse.success(LOGOUT_SUCCESS); } + } diff --git a/src/main/java/com/moddy/server/controller/designer/DesignerController.java b/src/main/java/com/moddy/server/controller/designer/DesignerController.java index 06678a46..8dc8eb14 100644 --- a/src/main/java/com/moddy/server/controller/designer/DesignerController.java +++ b/src/main/java/com/moddy/server/controller/designer/DesignerController.java @@ -25,7 +25,9 @@ @Tag(name = "DesignerController") @RequiredArgsConstructor public class DesignerController { + private final DesignerService designerService; + @Operation(summary = "[JWT] 디자이너 메인 뷰 조회", description = "디자이너 메인 뷰 조회 API입니다.") @ApiResponses({ @ApiResponse(responseCode = "200", description = "디자이너 메인뷰 조회 성공", content = @Content(schema = @Schema(implementation = DesignerMainResponse.class))), @@ -37,8 +39,7 @@ public class DesignerController { public SuccessResponse getDesignerMainInfo( @Parameter(hidden = true) @UserId Long userId, @Parameter(name = "page", description = "페이지 ") @RequestParam(value = "page") int page, - @Parameter(name = "size", description = "페이지 ") @RequestParam(value = "size") int size - ){ + @Parameter(name = "size", description = "페이지 ") @RequestParam(value = "size") int size) { return SuccessResponse.success(SuccessCode.FIND_DESIGNER_MAIN_INFO_SUCCESS, designerService.getDesignerMainInfo(userId, page, size)); } @@ -54,8 +55,7 @@ public SuccessResponse getDesignerMainInfo( public SuccessNonDataResponse offerCreateRequest( @Parameter(hidden = true) @UserId Long userId, @PathVariable(value = "applicationId") Long applicationId, - @RequestBody OfferCreateRequest offerCreateRequest - ) { + @RequestBody OfferCreateRequest offerCreateRequest) { designerService.postOffer(userId, applicationId, offerCreateRequest); return SuccessNonDataResponse.success(SuccessCode.POST_OFFER_SUCCESS); } @@ -71,8 +71,8 @@ public SuccessNonDataResponse offerCreateRequest( @SecurityRequirement(name = "JWT Auth") public SuccessResponse getApplicationDetailInfo( @Parameter(hidden = true) @UserId Long userId, - @PathVariable(value = "applicationId") Long applicationId - ){ + @PathVariable(value = "applicationId") Long applicationId) { return SuccessResponse.success(SuccessCode.MODEL_APPLICATION_DETAil_INFO_SUCCESS, designerService.getApplicationDetail(userId, applicationId)); } + } 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 762d0810..010bb50b 100644 --- a/src/main/java/com/moddy/server/controller/model/ModelController.java +++ b/src/main/java/com/moddy/server/controller/model/ModelController.java @@ -45,7 +45,7 @@ public class ModelController { public SuccessResponse getModelMainInfo( @Parameter(hidden = true) @UserId Long userId, @Parameter(name = "page", description = "페이지 ") @RequestParam(value = "page") int page, - @Parameter(name = "size", description = "페이지 ") @RequestParam(value = "size") int size){ + @Parameter(name = "size", description = "페이지 ") @RequestParam(value = "size") int size) { return SuccessResponse.success(SuccessCode.FIND_MODEL_MAIN_INFO_SUCCESS, modelService.getModelMainInfo(userId, page, size)); } @@ -60,7 +60,7 @@ public SuccessResponse getModelMainInfo( @SecurityRequirement(name = "JWT Auth") public SuccessResponse getModelDetailOfferInfo( @Parameter(hidden = true) @UserId Long userId, - @Parameter(name = "offerId", description = "제안서아이디") @PathVariable(value = "offerId") Long offerId){ + @Parameter(name = "offerId", description = "제안서아이디") @PathVariable(value = "offerId") Long offerId) { return SuccessResponse.success(SuccessCode.FIND_MODEL_DETAIL_OFFER_SUCCESS, modelService.getOfferDetail(userId, offerId)); } @@ -89,10 +89,9 @@ public SuccessResponse getOpenChat( @SecurityRequirement(name = "JWT Auth") public SuccessNonDataResponse acceptOffer( @Parameter(hidden = true) @UserId Long userId, - @Parameter(name = "offerId", description = "제안서아이디") @PathVariable(value = "offerId") Long offerId){ + @Parameter(name = "offerId", description = "제안서아이디") @PathVariable(value = "offerId") Long offerId) { modelService.updateOfferAgreeStatus(offerId); return SuccessNonDataResponse.success(SuccessCode.OFFER_ACCEPT_SUCCESS); - } @Operation(summary = "[JWT] 모델 지원서 작성", description = "모델 지원서 작성 API입니다.") @@ -105,8 +104,7 @@ public SuccessNonDataResponse acceptOffer( @PostMapping(value = "/application", consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE}) public SuccessNonDataResponse submitModelApplication( @Parameter(hidden = true) @UserId Long userId, - @ModelAttribute ModelApplicationRequest request - ) { + @ModelAttribute ModelApplicationRequest request) { modelService.postApplication(userId, request); return SuccessNonDataResponse.success(SuccessCode.CREATE_MODEL_APPLICATION_SUCCESS); } From 16b71a8584e037c82f83484e3a642cdb6d0bf76b Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Tue, 16 Jan 2024 02:31:57 +0900 Subject: [PATCH 11/13] =?UTF-8?q?#117=20[refactor]=20=EC=95=88=EC=93=B0?= =?UTF-8?q?=EB=8A=94=20import=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/dto/response/HairModelApplicationResponse.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/com/moddy/server/controller/designer/dto/response/HairModelApplicationResponse.java b/src/main/java/com/moddy/server/controller/designer/dto/response/HairModelApplicationResponse.java index 7615705c..b2541bc2 100644 --- a/src/main/java/com/moddy/server/controller/designer/dto/response/HairModelApplicationResponse.java +++ b/src/main/java/com/moddy/server/controller/designer/dto/response/HairModelApplicationResponse.java @@ -1,8 +1,5 @@ package com.moddy.server.controller.designer.dto.response; -import com.moddy.server.domain.prefer_hair_style.HairStyle; -import com.moddy.server.domain.user.Gender; - import java.util.List; public record HairModelApplicationResponse( From d29b719e159c182bb55b2c96a58d18662dc533cf Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Tue, 16 Jan 2024 03:24:41 +0900 Subject: [PATCH 12/13] =?UTF-8?q?#117=20[fix]=20model,=20Designer=EC=97=90?= =?UTF-8?q?=20Setter=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/moddy/server/domain/designer/Designer.java | 1 - src/main/java/com/moddy/server/domain/model/Model.java | 1 - 2 files changed, 2 deletions(-) diff --git a/src/main/java/com/moddy/server/domain/designer/Designer.java b/src/main/java/com/moddy/server/domain/designer/Designer.java index 8cc31879..ef8d8074 100644 --- a/src/main/java/com/moddy/server/domain/designer/Designer.java +++ b/src/main/java/com/moddy/server/domain/designer/Designer.java @@ -11,7 +11,6 @@ @Entity @Getter -@Setter @NoArgsConstructor @AllArgsConstructor @SuperBuilder diff --git a/src/main/java/com/moddy/server/domain/model/Model.java b/src/main/java/com/moddy/server/domain/model/Model.java index 3de976fc..e560e1ba 100644 --- a/src/main/java/com/moddy/server/domain/model/Model.java +++ b/src/main/java/com/moddy/server/domain/model/Model.java @@ -10,7 +10,6 @@ import lombok.experimental.SuperBuilder; @Getter -@Setter @Entity @NoArgsConstructor @AllArgsConstructor From b506c91d73fc7dd50265e3e7e555f72933c01b50 Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Tue, 16 Jan 2024 03:33:56 +0900 Subject: [PATCH 13/13] =?UTF-8?q?#117=20[fix]=20=EC=8A=A4=EC=9B=A8?= =?UTF-8?q?=EA=B1=B0=20=EC=97=B0=EA=B2=B0=EC=97=90=20=EC=9E=98=EB=AA=BB?= =?UTF-8?q?=EB=90=9C=20ApiResponseCode=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/moddy/server/controller/auth/AuthController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/moddy/server/controller/auth/AuthController.java b/src/main/java/com/moddy/server/controller/auth/AuthController.java index bf8c1487..719e409d 100644 --- a/src/main/java/com/moddy/server/controller/auth/AuthController.java +++ b/src/main/java/com/moddy/server/controller/auth/AuthController.java @@ -94,7 +94,7 @@ SuccessResponse createDesigner( @Operation(summary = "[JWT] 모델 회원가입 API", description = "모델 회원가입 API입니다.") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "모델 회원가입 성공"), - @ApiResponse(responseCode = "400", description = "인증오류 입니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + @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))) })