Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

#47 [feat] 디자이너 회원가입 기능 구현 #63

Merged
merged 18 commits into from
Jan 9, 2024
Merged

Conversation

pkl0912
Copy link
Contributor

@pkl0912 pkl0912 commented Jan 9, 2024

관련 이슈번호

해결하는 데 얼마나 걸렸나요? (예상 작업 시간 / 실제 작업 시간)

  • 2일...

해결하려는 문제가 무엇인가요?

  • 디자이너 회원가입 기능 구현..

어떻게 해결했나요?

  • designer - user 같은 테이블은 builder 를 superbuilder 로 설정해줘야 하고, inheritance 를 설정해줘야 한다
  • string으로 hairShop, portfolio 속성값들을 각각 받아서 servcie 에서 묶어서 저장 (multipart/form-data는 embeddable 객체 안됨)
  • controller 에서 request앞에는 ModelAttribute 속성으로 설정해준다

pkl0912 added 15 commits January 8, 2024 18:45
…into feat/#47

# Conflicts:
#	src/main/java/com/moddy/server/common/exception/enums/ErrorCode.java
#	src/main/java/com/moddy/server/common/exception/enums/SuccessCode.java
#	src/main/java/com/moddy/server/controller/auth/dto/request/SocialLoginRequest.java
#	src/main/java/com/moddy/server/domain/designer/Designer.java
#	src/main/java/com/moddy/server/domain/designer/HairShop.java
#	src/main/java/com/moddy/server/domain/user/User.java
@pkl0912 pkl0912 added the feat label Jan 9, 2024
@pkl0912 pkl0912 self-assigned this Jan 9, 2024
Copy link
Member

@KWY0218 KWY0218 left a comment

Choose a reason for hiding this comment

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

작업하시느라 고생하셨습니다!
코맨트 확인해주세요!!

Comment on lines 21 to 22
INVALID_DAY_OF_WEEK_EXCEPTION(HttpStatus.NOT_FOUND, "요일을 찾을 수 없습니다"),
INVALID_GENDER_EXCEPTION(HttpStatus.NOT_FOUND, "성별을 찾을 수 없습니다"),
Copy link
Member

Choose a reason for hiding this comment

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

p2
해당 에러는 클라이언트가 속성 값을 잘못 입력했을 때 생기는 에러이기 때문에
BAD_REQUEST , 400 에러인 것 같습니다!

+) 제가 전에 404라고 한 것 같은데, 400이 맞는 것 같습니다 하하..

@SecurityRequirement(name = "JWT Auth")
@PostMapping(value = "/designer", consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE})
SuccessResponse<DesignerCreateResponse> createDesigner(@Parameter(hidden = true) @KakaoCode String kakaoCode, @ModelAttribute DesignerCreateRequest request) {
System.out.println(request);
Copy link
Member

Choose a reason for hiding this comment

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

p1
println은 지워주세요!

Comment on lines 22 to 25

String instagramUrl,
String naverPlaceUrl,

Copy link
Member

Choose a reason for hiding this comment

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

p2
불필요한 공백을 지워주세요!

Comment on lines 9 to 13
public class DayOff extends BaseTimeEntity {
public class DayOff{
Copy link
Member

Choose a reason for hiding this comment

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

p1
base entity 를 제거하면 안됩니다..!

Comment on lines 43 to 44

// String kakaoId = String.valueOf(kakaoSocialService.login(SocialLoginRequest.of(code)));
Copy link
Member

Choose a reason for hiding this comment

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

p1
불필요한 주석은 제거해주세요!

Comment on lines 88 to 91




Copy link
Member

Choose a reason for hiding this comment

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

p2
불필요한 공백은 제거해주세요

Comment on lines 46 to 55
public User(String kakaoId, String name, Gender gender, String phoneNumber, Boolean isMarketingAgree, String profileImgUrl ) {
this.kakaoId = kakaoId;
this.name = name;
this.gender = gender;
this.phoneNumber = phoneNumber;
this.isMarketingAgree = isMarketingAgree;
this.profileImgUrl = profileImgUrl;
this.role = role;
}

Copy link
Member

Choose a reason for hiding this comment

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

p2
사용하지 않은 생성자인 듯 합니다! 제거해주세요!

Comment on lines +27 to +28
@Transactional(readOnly = true)
@Builder
Copy link
Member

Choose a reason for hiding this comment

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

p1
불필요한 어노테이션으로 보입니다.

Comment on lines 21 to 23
.findFirst()
.orElseThrow(() -> new BadRequestException(ErrorCode.INVALID_DAY_OF_WEEK_EXCEPTION));
}
Copy link
Member

Choose a reason for hiding this comment

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

p2
DAY_OF_WEEK_EXCEPTION이 아닌 INVALID_GENDER_EXCEPTION인 것 같습니다!

@Getter
@AllArgsConstructor
public enum DayOfWeek {
NOTHING("없음"), MON("월"), TUE("화"), WED("수"), THU("목"), FRI("금"), SAT("토"), SUN("일");

private final String value;

@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static DayOfWeek findByDay(String dayOfWeek) {
Copy link
Member

Choose a reason for hiding this comment

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

p4
findByDayOfWeek는 어떨까요..?

Copy link
Member

@KWY0218 KWY0218 left a comment

Choose a reason for hiding this comment

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

작업하시느라 고생하셨습니다!

Copy link
Member

@hellozo0 hellozo0 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~~! 로직이 좋네요... 갓경린...

@@ -23,6 +25,7 @@ public enum ErrorCode {
USER_NOT_FOUND_EXCEPTION(HttpStatus.NOT_FOUND, "해당 유저는 존재하지 않습니다."),

// 405 METHOD_NOT_ALLOWED

Copy link
Member

Choose a reason for hiding this comment

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

p4 :
위의 에러코드들 처럼 ErrorCode 주석 아래 공백 지우면 좋을것 같아요!

@@ -8,10 +8,13 @@
@AllArgsConstructor
public enum SuccessCode {


Copy link
Member

Choose a reason for hiding this comment

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

p4:
여기도 공백 지우면 좋을 것 같아요!

FIND_MODEL_MAIN_INFO_SUCCESS(HttpStatus.OK, "모델 메인 뷰 조회 성공"),
SOCIAL_LOGIN_SUCCESS(HttpStatus.OK, "카카오 로그인 성공입니다."),
USER_MY_PAGE_SUCCESS(HttpStatus.OK, "마이페이지 유저 정보 조회 성공입니다.");


Copy link
Member

Choose a reason for hiding this comment

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

p4:
여기도 공백 지우면 좋을 것 같아요!

Comment on lines +16 to +23

@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static Gender findByGender(String gender) {
return Stream.of(Gender.values())
.filter(c -> c.getValue().equals(gender))
.findFirst()
.orElseThrow(() -> new BadRequestException(ErrorCode.INVALID_GENDER_EXCEPTION));
}
Copy link
Member

Choose a reason for hiding this comment

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

find 메소드 좋네요! 감사합니다...

Comment on lines +71 to +79
request.dayOffs().stream()
.forEach(d -> {
DayOff dayOff = DayOff.builder()
.dayOfWeek(d)
.designer(designer)
.build();
dayOffJpaRepository.save(dayOff);

});
Copy link
Member

Choose a reason for hiding this comment

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

dayoff 사용법도 확인했습니다!

@pkl0912 pkl0912 merged commit 8469443 into develop Jan 9, 2024
1 check passed
@pkl0912 pkl0912 deleted the feat/#47 branch January 9, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] 디자이너 회원가입 기능 구현
3 participants