Skip to content

Commit

Permalink
Merge pull request #237 from Juinjang/dev
Browse files Browse the repository at this point in the history
dev -> prod merge
  • Loading branch information
yeon015 authored Oct 3, 2024
2 parents 3cc0821 + 6fdef92 commit 82c53b0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public ApiResponse kakaoWithdraw(@AuthenticationPrincipal Member member, @Reques
// 애플 탈퇴
@DeleteMapping("/withdraw/apple")
public ApiResponse withdraw(@AuthenticationPrincipal Member member,
@Nullable@RequestHeader("X-Apple-Code") final String code, @RequestBody @Validated WithdrawReasonRequestDto withdrawReasonReqDto){
@Nullable@RequestHeader("X-Apple-Code") final String code, @RequestBody WithdrawReasonRequestDto withdrawReasonReqDto){
oauthService.appleWithdraw(member, code);

// 탈퇴 사유 추가
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/umc/th/juinjang/model/entity/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public class Member extends BaseEntity implements UserDetails {
private MemberProvider provider;

// apple client id값을 의미
@Column(name = "apple_sub")
@Column(name = "apple_sub", unique = true)
private String appleSub;

// kakao target id값 의미 (카카오의 유저 식별값. 탈퇴할 때 필요)
@Column(name="target_id")
@Column(name="target_id", unique = true)
private Long kakaoTargetId;

@Lob
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ public class MemberService {

// 닉네임 수정
public MemberResponseDto.nicknameDto patchNickname(Member member, MemberRequestDto memberRequestDto) {
// 받아온 닉네임 중복 확인
Member findMember = memberRepository.findByNickname(memberRequestDto.getNickname());
if(findMember != null)
throw new MemberHandler(ALREADY_NICKNAME);

// Member 받아오면 해당 member의 nickname 변경
member.updateNickname(memberRequestDto.getNickname());
memberRepository.save(member); // 변수 없이 member 그대로 저장
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public LoginResponseDto kakaoSignUp (Long targetId, KakaoSignUpRequestDto kakaoS
}
} else if (getMember.isPresent() || getTargetId.isPresent()) { // 둘 중 하나만 존재할 때 실행될 코드
throw new MemberHandler(FAILED_TO_LOGIN);
} else { // 두 값 모두 존재하지 않을 때 실행될 코드, 아직 회원가입 하지 않은 회원인 경우
} else if (!getMember.isPresent() && !getTargetId.isPresent()) { // 두 값 모두 존재하지 않을 때 실행될 코드, 아직 회원가입 하지 않은 회원인 경우
member = memberRepository.save(
Member.builder()
.email(email)
Expand Down

0 comments on commit 82c53b0

Please sign in to comment.