-
Notifications
You must be signed in to change notification settings - Fork 2
π :: (#812) λ€νΈμν¬ λͺ¨λΈ νλ μ΄λ² λΆλ¦¬ #813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
uson1004
merged 11 commits into
develop
from
refactor/812-λ€νΈμν¬-λͺ¨λΈ-νλ μ΄λ²-λΆλ¦¬
Dec 24, 2025
The head ref may contain hidden characters: "refactor/812-\uB124\uD2B8\uC6CC\uD06C-\uBAA8\uB378-\uD50C\uB808\uC774\uBC84-\uBD84\uB9AC"
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b5d157a
refactor :: prod ui λͺ¨λ ν¨ν€μ§ κ²½λ‘ μμ
uson1004 96da1ae
refactor :: ui λͺ¨λ paddingDefault κ²½λ‘ μ¬μ μ
uson1004 670131e
refactor :: λ€νΈμν¬ κ΄λ ¨ λͺ¨λ νλμ΄λ² μ€μ
uson1004 389f972
refactor :: network λͺ¨λ νλμ΄λ² νμΌ λΆλ¦¬
uson1004 4a37500
refactor :: core:data λͺ¨λ νλμ΄λ² νμΌ λΆλ¦¬
uson1004 04a5513
refactor :: κΈ°μ‘΄ meal λ°ν νμμΌλ‘ λ³κ²½
uson1004 5a566b5
refactor :: dev νλ μ΄λ² network μ°μ΄λ νμΌ κ΅¬ν
uson1004 b72bacd
refactor :: λ ν¬μ§ν 리 data λͺ¨λ λΆλ¦¬
uson1004 6c91e8c
refactor :: devμμ μ μ°μ΄λ data λͺ¨λ νμΌ μ κ±°
uson1004 154515b
refactor :: dev repository result κ°μ²΄λ‘ λ°ν
uson1004 5c57a63
feat :: home screen ν μ€νΈ ꡬν
uson1004 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions
29
data/src/dev/kotlin/team.aliens.dms.android.data/auth/repository/AuthRepository.kt
This file contains hidden or 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 team.aliens.dms.android.data.auth.repository | ||
|
|
||
| import team.aliens.dms.android.data.auth.model.EmailVerificationType | ||
| import team.aliens.dms.android.data.auth.model.HashedEmail | ||
|
|
||
| abstract class AuthRepository { | ||
|
|
||
| abstract suspend fun signIn( | ||
| accountId: String, | ||
| password: String, | ||
| deviceToken: String, | ||
| autoSignIn: Boolean = true, | ||
| ): Result<Unit> | ||
|
|
||
| abstract suspend fun sendEmailVerificationCode( | ||
| email: String, | ||
| type: EmailVerificationType, | ||
| ): Result<Unit> | ||
|
|
||
| abstract suspend fun checkEmailVerificationCode( | ||
| email: String, | ||
| code: String, | ||
| type: EmailVerificationType, | ||
| ): Result<Unit> | ||
|
|
||
| abstract suspend fun checkIdExists(accountId: String): Result<HashedEmail> | ||
|
|
||
| abstract suspend fun signOut(): Result<Unit> | ||
| } |
88 changes: 88 additions & 0 deletions
88
data/src/dev/kotlin/team.aliens.dms.android.data/auth/repository/AuthRepositoryImpl.kt
This file contains hidden or 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,88 @@ | ||
| package team.aliens.dms.android.data.auth.repository | ||
|
|
||
| import team.aliens.dms.android.core.jwt.JwtProvider | ||
| import team.aliens.dms.android.core.network.util.statusMapping | ||
| import team.aliens.dms.android.core.school.SchoolProvider | ||
| import team.aliens.dms.android.data.auth.exception.BadRequestException | ||
| import team.aliens.dms.android.data.auth.exception.PasswordMismatchException | ||
| import team.aliens.dms.android.data.auth.exception.UserNotFoundException | ||
| import team.aliens.dms.android.data.auth.mapper.extractFeatures | ||
| import team.aliens.dms.android.data.auth.mapper.extractTokens | ||
| import team.aliens.dms.android.data.auth.model.EmailVerificationType | ||
| import team.aliens.dms.android.data.auth.model.HashedEmail | ||
| import team.aliens.dms.android.network.auth.datasource.NetworkAuthDataSource | ||
| import team.aliens.dms.android.network.auth.model.SendEmailVerificationCodeRequest | ||
| import team.aliens.dms.android.network.auth.model.SignInRequest | ||
| import javax.inject.Inject | ||
|
|
||
| internal class AuthRepositoryImpl @Inject constructor( | ||
| private val networkAuthDataSource: NetworkAuthDataSource, | ||
| private val jwtProvider: JwtProvider, | ||
| private val schoolProvider: SchoolProvider, | ||
| ) : AuthRepository() { | ||
|
|
||
| override suspend fun signIn( | ||
| accountId: String, | ||
| password: String, | ||
| deviceToken: String, | ||
| autoSignIn: Boolean, | ||
| ): Result<Unit> = runCatching { | ||
| val signInResponse = statusMapping( | ||
| onBadRequest = { throw BadRequestException() }, | ||
| onUnauthorized = { throw PasswordMismatchException() }, | ||
| onNotFound = { throw UserNotFoundException() }, | ||
| ) { | ||
| networkAuthDataSource.signIn( | ||
| request = SignInRequest( | ||
| accountId = accountId, | ||
| password = password, | ||
| deviceToken = deviceToken, | ||
| ), | ||
| ) | ||
| } | ||
|
|
||
| // FIXME: λ§μ½ μλ λ‘κ·ΈμΈμ νμ§ μμ μνμμ ν ν° μ¬λ°κΈμ μ΄λ»κ² μ²λ¦¬νλκ°? | ||
| if (autoSignIn) { | ||
| val tokens = signInResponse.extractTokens() | ||
| val features = signInResponse.extractFeatures() | ||
| jwtProvider.updateTokens(tokens) | ||
| schoolProvider.updateFeatures(features) | ||
| } | ||
| } | ||
|
|
||
| override suspend fun sendEmailVerificationCode( | ||
| email: String, | ||
| type: EmailVerificationType, | ||
| ): Result<Unit> = runCatching { | ||
| networkAuthDataSource.sendEmailVerificationCode( | ||
| request = SendEmailVerificationCodeRequest( | ||
| email = email, | ||
| type = type.name, | ||
| ), | ||
| ) | ||
| } | ||
|
|
||
| override suspend fun checkEmailVerificationCode( | ||
| email: String, | ||
| code: String, | ||
| type: EmailVerificationType, | ||
| ): Result<Unit> = runCatching { | ||
| networkAuthDataSource.checkEmailVerificationCode( | ||
| email = email, | ||
| code = code, | ||
| type = type.name, | ||
| ) | ||
| } | ||
|
|
||
| override suspend fun checkIdExists(accountId: String): Result<HashedEmail> = runCatching { | ||
| networkAuthDataSource.checkIdExists( | ||
| accountId = accountId, | ||
| } | ||
|
|
||
|
|
||
| override suspend fun signOut(): Result<Unit> = runCatching { | ||
| jwtProvider.clearCaches() | ||
| schoolProvider.clearCaches() | ||
| } | ||
| } | ||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIXMEμ£Όμμμ μ§μ λ λ°μ κ°μ΄,autoSignInμ΄falseμΌ κ²½μ°μ ν ν° μ²λ¦¬ λ‘μ§μ΄ λΆμμ ν©λλ€. νμ¬ μ½λλautoSignInμ΄trueμΌ λλ§ ν ν°μ μ μ₯νκ³ μμΌλ©°,falseμΌ κ²½μ°μλ λ‘κ·ΈμΈ μ λ°κΈλ ν ν°μ μ¬μ©νμ§ μκ³ λ²λ¦¬κ³ μμ΅λλ€. μλ λ‘κ·ΈμΈμ μ¬μ©νμ§ μλλΌλ μ± μΈμ λμμλ ν ν°μ λ©λͺ¨λ¦¬μ μ μ§νμ¬ API νΈμΆμ μ¬μ©ν΄μΌ ν©λλ€. μ΄ λΆλΆμ λͺ νν ꡬνν΄μΌ ν©λλ€.