Skip to content

Commit

Permalink
[CHORE] 명세서에 따라 일부 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jun02160 committed Jul 21, 2023
1 parent 343c2db commit 66672c6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ public ApiResponse<OnboardingInviteResponseDto> onboardInvite(@RequestBody @Vali
}

@PatchMapping("/onboard/match")
@ResponseStatus(HttpStatus.OK)
@ResponseStatus(HttpStatus.CREATED)
public ApiResponse<InviteResultResponseDto> inviteRelation(@RequestBody @Valid final InviteCodeRequestDto request, Principal principal) {
return ApiResponse.success(SuccessType.MATCH_PARENT_CHILD_SUCCESS, parentchildService.matchRelation(JwtProvider.getUserFromPrincial(principal), request));
}

@PatchMapping("/onboard/receive")
@ResponseStatus(HttpStatus.OK)
@ResponseStatus(HttpStatus.CREATED)
public ApiResponse<OnboardingReceiveResponseDto> onboardReceive(@RequestBody @Valid final OnboardingReceiveRequestDto request, Principal principal) throws InterruptedException {

Long userId = JwtProvider.getUserFromPrincial(principal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public class OnboardingInviteRequestDto {
@JsonFormat(pattern = "kk:mm")
private LocalTime pushTime;

@NotEmpty // TODO 여기서 걸러지게 만들어야함
@NotEmpty
private List<String> onboardingAnswerList;
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static ParentchildRelation relation(String gender, String relationInfo, b
if (relationInfo.equals("아들")) {
return ParentchildRelation.DAD_SON;
} else if (relationInfo.equals("딸")) {
return ParentchildRelation.DAD_DAU; // TODO 클라에서 둘 중 하나의 값만 받도록 처리하니까 else if 구문 빼도 무관
return ParentchildRelation.DAD_DAU;
}
} else if(gender.equals("여자")) { // 엄마
if (relationInfo.equals("아들")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public OnboardingInviteResponseDto onboardInvite(Long userId, OnboardingInviteRe
.inviteCode(generateInviteCode())
.isInvitorChild(request.getIsInvitorChild())
.relation(ParentchildRelation.relation(request.getUserInfo().getGender(), request.getRelationInfo(), request.getIsInvitorChild()))
.pushTime(request.getPushTime()) // TODO 케이스에 따라 없을 수도 있음
.pushTime(request.getPushTime())
.count(1)
.build();
parentchildRepository.save(parentchild);
Expand Down Expand Up @@ -154,8 +154,7 @@ public InviteResultResponseDto matchRelation(Long userId, InviteCodeRequestDto r
throw new CustomException(ErrorType.ALREADY_EXISTS_PARENT_CHILD_USER);
}

// TODO ParentChild에 연관된 User 수에 따른 예외처리
// TODO 하나의 유저는 하나의 관계만 가지도록 예외처리
// TODO ParentChild에 연관된 User 수에 따른 예외 메시지 출력
user.updateParentchild(newMatchRelation);
user.updateIsMatchFinish(true);
log.info("로그인한 유저가 성립된 Parentchild Id: {}", user.getParentChild().getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public enum ErrorType {
*/

// Common
REQUEST_VALIDATION_EXCEPTION(HttpStatus.BAD_REQUEST, "잘못된 요청입니다."),
REQUEST_VALIDATION_EXCEPTION(HttpStatus.BAD_REQUEST, "잘못된 요청입니다"),
VALIDATION_WRONG_TYPE_EXCEPTION(HttpStatus.BAD_REQUEST, "잘못된 타입이 입력되었습니다."),
HEADER_REQUEST_MISSING_EXCEPTION(HttpStatus.BAD_REQUEST, "요청에 필요한 헤더값이 존재하지 않습니다."),
VALIDATION_WRONG_HTTP_REQUEST(HttpStatus.BAD_REQUEST, "허용되지 않는 문자열이 입력되었습니다."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public enum SuccessType {
GET_TODAY_QNA_SUCCESS(HttpStatus.OK, "일일문답 조회에 성공했습니다."),
GET_QNA_LIST_SUCCESS(HttpStatus.OK, "섹션별 과거의 문답 리스트 조회에 성공했습니다."),
GET_SINGLE_QNA_SUCCESS(HttpStatus.OK, "과거의 문답 개별 조회에 성공했습니다."),
MATCH_PARENT_CHILD_SUCCESS(HttpStatus.OK, "부모자식 관계 매칭에 성공했습니다."),
GET_MAIN_HOME_SUCCESS(HttpStatus.OK, "메인 홈 화면 정보 불러오기에 성공했습니다."),
GET_INVITE_CODE_SUCCESS(HttpStatus.OK, "초대장을 보낼 코드 조회에 성공했습니다."),
PUSH_ALARM_SUCCESS(HttpStatus.OK, "푸시알림 전송에 성공했습니다."),
Expand All @@ -31,6 +30,7 @@ public enum SuccessType {
* 201 CREATED
*/
CREATE_PARENT_CHILD_SUCCESS(HttpStatus.CREATED, "온보딩 정보를 입력받아 부모자식 관계를 생성하는 데 성공했습니다."),
MATCH_PARENT_CHILD_SUCCESS(HttpStatus.CREATED, "부모자식 관계 매칭에 성공했습니다."),
ANSWER_TODAY_QUESTION_SUCCESS(HttpStatus.CREATED, "오늘의 일일문답에 답변을 완료하였습니다."),

;
Expand Down

0 comments on commit 66672c6

Please sign in to comment.