-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MERGE/#10] - 소셜 로그인 로직 구현 코드 리뷰 반영 및 추가 구현 사항
[FEAT] #10 - 소셜 로그인 로직 구현 코드 리뷰 반영 및 추가 구현 사항
- Loading branch information
Showing
19 changed files
with
100 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/org/sopt/seonyakServer/domain/member/model/SocialType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.sopt.seonyakServer.domain.member.model; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE) | ||
public enum SocialType { | ||
|
||
GOOGLE("GOOGLE"), | ||
; | ||
|
||
private final String socialType; | ||
} |
5 changes: 4 additions & 1 deletion
5
src/main/java/org/sopt/seonyakServer/domain/member/repository/MemberRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package org.sopt.seonyakServer.domain.member.repository; | ||
|
||
import java.util.Optional; | ||
import org.sopt.seonyakServer.domain.member.model.Member; | ||
import org.sopt.seonyakServer.domain.member.model.SocialType; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface MemberRepository extends JpaRepository<Member, Long>, MemberRepositoryCustom { | ||
public interface MemberRepository extends JpaRepository<Member, Long> { | ||
Optional<Member> findBySocialTypeAndSocialId(SocialType socialType, String socialId); | ||
} |
13 changes: 0 additions & 13 deletions
13
src/main/java/org/sopt/seonyakServer/domain/member/repository/MemberRepositoryCustom.java
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
src/main/java/org/sopt/seonyakServer/domain/member/repository/MemberRepositoryImpl.java
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
src/main/java/org/sopt/seonyakServer/domain/member/service/MemberManagementService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.sopt.seonyakServer.domain.member.service; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.sopt.seonyakServer.domain.member.model.Member; | ||
import org.sopt.seonyakServer.domain.member.repository.MemberRepository; | ||
import org.sopt.seonyakServer.global.common.external.client.dto.MemberInfoResponse; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class MemberManagementService { | ||
// 트랜잭션 작업을 관리할 서비스 클래스 (자기 호출 방지 및 단일 책임 원칙 준수) | ||
|
||
private final MemberRepository memberRepository; | ||
|
||
@Transactional | ||
public Long createMember(final MemberInfoResponse memberInfoResponse) { | ||
Member member = Member.of( | ||
memberInfoResponse.socialType(), | ||
memberInfoResponse.socialId(), | ||
memberInfoResponse.email() | ||
); | ||
|
||
return memberRepository.save(member).getId(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
src/main/java/org/sopt/seonyakServer/global/common/external/client/SocialType.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ain/java/org/sopt/seonyakServer/global/common/external/client/dto/MemberInfoResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.