From 2690aac641b43d21561cfdc4b42f7cbfb4a7c6de Mon Sep 17 00:00:00 2001 From: Kang Duoh Date: Sun, 3 Nov 2024 11:21:18 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EC=B5=9C=EC=B4=88=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20=EC=97=AC=EB=B6=80=20=EC=B2=B4=ED=81=AC=20(#21)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hackathon/momento/member/api/MemberController.java | 8 ++++---- .../momento/member/application/MemberService.java | 2 +- .../member/domain/repository/MemberRepository.java | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hackathon/momento/member/api/MemberController.java b/src/main/java/com/hackathon/momento/member/api/MemberController.java index 2975bd1..ce0b2ba 100644 --- a/src/main/java/com/hackathon/momento/member/api/MemberController.java +++ b/src/main/java/com/hackathon/momento/member/api/MemberController.java @@ -82,16 +82,16 @@ public RspTemplate updateProfile( @PostMapping("/check-duplicate") @Operation( - summary = "이메일 중복 검사", - description = "해당 사용자가 존재하는지 여부를 검사합니다.", + summary = "최초 로그인 여부 체크", + description = "해당 사용자가 최초 로그인인지 체크합니다.", responses = { - @ApiResponse(responseCode = "200", description = "중복 검사 성공"), + @ApiResponse(responseCode = "200", description = "최초 로그인 여부 체크 성공"), @ApiResponse(responseCode = "400", description = "잘못된 요청"), @ApiResponse(responseCode = "500", description = "서버 오류") } ) public RspTemplate checkDuplicateRequest(Principal principal) { boolean isDuplicate = memberService.checkDuplicate(principal); - return new RspTemplate<>(HttpStatus.OK, String.valueOf(isDuplicate)); + return new RspTemplate<>(HttpStatus.OK, "최초 로그인 여부 체크 성공", String.valueOf(isDuplicate)); } } diff --git a/src/main/java/com/hackathon/momento/member/application/MemberService.java b/src/main/java/com/hackathon/momento/member/application/MemberService.java index d400bbc..65ff2e7 100644 --- a/src/main/java/com/hackathon/momento/member/application/MemberService.java +++ b/src/main/java/com/hackathon/momento/member/application/MemberService.java @@ -48,7 +48,7 @@ public ProfileResDto updateProfile(Principal principal, UpdateProfileReqDto reqD public boolean checkDuplicate(Principal principal) { Member member = getMemberByPrincipal(principal); - return memberRepository.existsById(member.getId()); + return member.getStack() == null || member.getPersona() == null || member.getAbility() == null; } private Member getMemberByPrincipal(Principal principal) { diff --git a/src/main/java/com/hackathon/momento/member/domain/repository/MemberRepository.java b/src/main/java/com/hackathon/momento/member/domain/repository/MemberRepository.java index b9fd5fc..4412139 100644 --- a/src/main/java/com/hackathon/momento/member/domain/repository/MemberRepository.java +++ b/src/main/java/com/hackathon/momento/member/domain/repository/MemberRepository.java @@ -8,6 +8,5 @@ @Repository public interface MemberRepository extends JpaRepository { - Optional findByEmail(String email); }