-
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.
Browse files
Browse the repository at this point in the history
feat: ์ ํ ๋ก๊ทธ์ธ ์๋ฒ ๊ธฐ๋ฅ ๊ตฌํ
- Loading branch information
Showing
12 changed files
with
175 additions
and
1 deletion.
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
11 changes: 11 additions & 0 deletions
11
user-service/src/main/java/kr/mafoo/user/config/properties/AppleOAuthProperties.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 kr.mafoo.user.config.properties; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding; | ||
|
||
@ConfigurationProperties(prefix = "app.oauth.apple") | ||
@ConfigurationPropertiesBinding | ||
public record AppleOAuthProperties( | ||
String clientId | ||
) { | ||
} |
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
user-service/src/main/java/kr/mafoo/user/controller/dto/request/AppleLoginRequest.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 kr.mafoo.user.controller.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Schema(description = "์ ํ ๋ก๊ทธ์ธ ์์ฒญ") | ||
public record AppleLoginRequest( | ||
@Schema(description = "์์ธ์ค ์ฝ๋", example = "test") | ||
String identityToken | ||
) { | ||
} |
6 changes: 6 additions & 0 deletions
6
user-service/src/main/java/kr/mafoo/user/controller/dto/response/AppleKeyListResponse.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,6 @@ | ||
package kr.mafoo.user.controller.dto.response; | ||
|
||
public record AppleKeyListResponse( | ||
AppleKeyResponse[] keys | ||
) { | ||
} |
11 changes: 11 additions & 0 deletions
11
user-service/src/main/java/kr/mafoo/user/controller/dto/response/AppleKeyResponse.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 kr.mafoo.user.controller.dto.response; | ||
|
||
public record AppleKeyResponse( | ||
String kty, | ||
String kid, | ||
String use, | ||
String alg, | ||
String n, | ||
String e | ||
) { | ||
} |
6 changes: 6 additions & 0 deletions
6
user-service/src/main/java/kr/mafoo/user/controller/dto/response/AppleLoginInfo.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,6 @@ | ||
package kr.mafoo.user.controller.dto.response; | ||
|
||
public record AppleLoginInfo( | ||
String id | ||
) { | ||
} |
3 changes: 2 additions & 1 deletion
3
user-service/src/main/java/kr/mafoo/user/enums/IdentityProvider.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,5 +1,6 @@ | ||
package kr.mafoo.user.enums; | ||
|
||
public enum IdentityProvider { | ||
KAKAO | ||
KAKAO, | ||
APPLE | ||
} |
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
48 changes: 48 additions & 0 deletions
48
user-service/src/main/java/kr/mafoo/user/util/NicknameGenerator.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,48 @@ | ||
package kr.mafoo.user.util; | ||
|
||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.concurrent.ThreadLocalRandom; | ||
|
||
@NoArgsConstructor(access = lombok.AccessLevel.PRIVATE) | ||
public class NicknameGenerator { | ||
private static String[] prefixes = new String[] { | ||
"๋ฉ์๋", "๋ง์๋", "๋๋จํ", "์์ฒญ๋", "์๋ํ", "ํ๋ณตํ", "์ฆ๊ฑฐ์ด", "์๋ก์ด", "์์", "์ ๊ธฐํ", "์ฌ๋ฐ๋", "๋๋ผ์ด" | ||
}; | ||
private static String[] suffixes = new String[] { "์์ฌ", | ||
"๊ณผ์ผ", | ||
"์ฑ ", | ||
"์ปคํผ", | ||
"์ ", | ||
"์์ ", | ||
"์ํ", | ||
"์ฑํ ", | ||
"ํตํ", | ||
"์ฝ๋ฉ", | ||
"ํด์", | ||
"์ฌํ", | ||
"์ด๋", | ||
"๊ฒ์", | ||
"๋ ์", | ||
"๊ณต๋ถ", | ||
"์์ ", | ||
"๊ณผ์ ", | ||
"์ทจ๋ฏธ", | ||
"์ทจ์ ", | ||
"์ฐ์ ", | ||
"๊ฒฐํผ", | ||
"ํฌ์", | ||
"ํ๋ก๊ทธ๋๋ฐ", | ||
"๊ฐ๋ฐ", | ||
"์ฝ๋ฉ", | ||
"ํ ์คํธ", | ||
"๋ณด์" }; | ||
|
||
public static String generate() { | ||
ThreadLocalRandom random = ThreadLocalRandom.current(); | ||
int prefixIndex = random.nextInt(prefixes.length); | ||
int suffixIndex = random.nextInt(suffixes.length); | ||
return prefixes[prefixIndex] + " " + suffixes[suffixIndex]; | ||
} | ||
|
||
} |
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