-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 소셜 회원가입 기능 추가 * feat: 카카오 로그인 및 회원가입 기능 추가
- Loading branch information
Showing
19 changed files
with
335 additions
and
21 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
10 changes: 10 additions & 0 deletions
10
subprojects/api/src/main/java/com/money/config/FeignClientConfig.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,10 @@ | ||
package com.money.config; | ||
|
||
import com.money.ApiApplication; | ||
import org.springframework.cloud.openfeign.EnableFeignClients; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@EnableFeignClients(basePackageClasses = ApiApplication.class) | ||
public class FeignClientConfig { | ||
} |
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
17 changes: 17 additions & 0 deletions
17
subprojects/api/src/main/java/com/money/dto/request/KakaoUserRequest.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,17 @@ | ||
package com.money.dto.request; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class KakaoUserRequest { | ||
|
||
private String secure_resource; | ||
private String property_keys; | ||
|
||
public KakaoUserRequest(String propertyKeys) { | ||
this.secure_resource = "true"; | ||
this.property_keys = propertyKeys; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
subprojects/api/src/main/java/com/money/dto/request/SocialLoginRequest.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,10 @@ | ||
package com.money.dto.request; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record SocialLoginRequest( | ||
@NotBlank(message = "공백일 수 없습니다.") | ||
String token | ||
) { | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
subprojects/api/src/main/java/com/money/dto/request/SocialRegisterRequest.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,18 @@ | ||
package com.money.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.Pattern; | ||
import java.time.LocalDate; | ||
import org.springframework.format.annotation.DateTimeFormat; | ||
|
||
public record SocialRegisterRequest( | ||
String platformId, | ||
String name, | ||
@Schema(example = "010-1234-5678") | ||
@Pattern(regexp = "^\\d{3}-\\d{3,4}-\\d{4}$", message = "휴대폰 번호 양식에 맞지 않습니다.") | ||
String phoneNumber, | ||
@DateTimeFormat(pattern = "yyyy-MM-dd") | ||
LocalDate birth | ||
) { | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
subprojects/api/src/main/java/com/money/dto/response/KakaoUser.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,29 @@ | ||
package com.money.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
@Getter | ||
public class KakaoUser { | ||
|
||
private Long id; | ||
@JsonProperty("kakao_account") | ||
private KakaoAccount kakaoAccount; | ||
|
||
public String getEmail() { | ||
return kakaoAccount.getEmail(); | ||
} | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
private static class KakaoAccount { | ||
|
||
private String email; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
subprojects/api/src/main/java/com/money/dto/response/SocialMemberResponse.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,7 @@ | ||
package com.money.dto.response; | ||
|
||
public record SocialMemberResponse( | ||
String email, | ||
String platformId | ||
) { | ||
} |
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
11 changes: 11 additions & 0 deletions
11
subprojects/api/src/main/java/com/money/exception/auth/InvalidPlatformException.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,11 @@ | ||
package com.money.exception.auth; | ||
|
||
import com.money.exception.ErrorCode; | ||
import com.money.exception.MainException; | ||
|
||
public class InvalidPlatformException extends MainException { | ||
|
||
public InvalidPlatformException() { | ||
super(ErrorCode.INVALID_PLATFORM); | ||
} | ||
} |
5 changes: 4 additions & 1 deletion
5
.../exception/PasswordMismatchException.java → ...ption/auth/PasswordMismatchException.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
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.