-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/#60 회원가입 UI 개선, Position Config API 처리 최적화 #73
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
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f16c8d0
feat/#60: 회원가입 - 이메일 형식 에러시 화면 추가
jinukeu 0b87991
feat/#60: 회원가입 - step4 라이팅 변경
jinukeu 751b77d
feat/#60: Header 영역 뒤로가기 터치영역 수정
jinukeu 6a39778
feat/#60: 회원가입 보류 화면에서 뒤로가기 화면 노출
jinukeu a720ec3
feat/#60: 앱 기본 폰트 크기를 1.0f로 고정합니다.
jinukeu 18b376e
feat/#60: Room 데이터베이스 및 관련 클래스 추가
jinukeu 9ca88a7
feat/#60: Room DB 및 ConfigRepository 추가
jinukeu 9c54712
feat/#60: 직군 설정 API 연동 및 UI 반영
jinukeu ed09fcb
feat/#60: 회원가입 API 요청 시, Position label 값을 name으로 변환합니다.
jinukeu bf974d4
feat/#60: PositionConfig 저장 방식을 전체 교체로 변경합니다.
jinukeu 8ff3856
refactor/#60: Room -> Proto DataStore
jinukeu f8350e5
refactor/#60: RFC 5322를 준수하는 이메일 정규식으로 변경
jinukeu 806f017
refactor/#60: 네이밍 일관성 개선
jinukeu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,4 +4,5 @@ plugins { | |
|
||
dependencies { | ||
implementation(project(":core:model")) | ||
implementation(libs.kotlinx.coroutines.core) | ||
} |
7 changes: 7 additions & 0 deletions
7
core/data-api/src/main/java/com/yapp/dataapi/ConfigRepository.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,7 @@ | ||
package com.yapp.dataapi | ||
|
||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface ConfigRepository { | ||
fun getPositionConfigs(): Flow<List<String>> | ||
} | ||
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
10 changes: 10 additions & 0 deletions
10
core/data/src/main/java/com/yapp/core/data/data/YappDispatcher.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,10 @@ | ||
package com.yapp.core.data.data | ||
|
||
import javax.inject.Qualifier | ||
|
||
@Qualifier | ||
annotation class Dispatcher(val yappDispatcher: YappDispatchers) | ||
|
||
enum class YappDispatchers { | ||
IO, | ||
} | ||
jinukeu marked this conversation as resolved.
Show resolved
Hide resolved
|
18 changes: 18 additions & 0 deletions
18
core/data/src/main/java/com/yapp/core/data/data/di/DispatchersModule.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,18 @@ | ||
package com.yapp.core.data.data.di | ||
|
||
import com.yapp.core.data.data.Dispatcher | ||
import com.yapp.core.data.data.YappDispatchers | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object DispatchersModule { | ||
@Provides | ||
@Dispatcher(YappDispatchers.IO) | ||
fun providesIODispatcher(): CoroutineDispatcher = Dispatchers.IO | ||
} | ||
jinukeu marked this conversation as resolved.
Show resolved
Hide resolved
|
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
43 changes: 43 additions & 0 deletions
43
core/data/src/main/java/com/yapp/core/data/data/repository/ConfigRepositoryImpl.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,43 @@ | ||
package com.yapp.core.data.data.repository | ||
|
||
import androidx.datastore.core.DataStore | ||
import com.yapp.core.data.PositionConfigs | ||
import com.yapp.core.data.data.Dispatcher | ||
import com.yapp.core.data.data.YappDispatchers | ||
import com.yapp.core.data.remote.api.ConfigApi | ||
import com.yapp.core.data.remote.model.response.PositionConfigResponse | ||
import com.yapp.dataapi.ConfigRepository | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.firstOrNull | ||
import kotlinx.coroutines.flow.flow | ||
import kotlinx.coroutines.flow.flowOn | ||
import javax.inject.Inject | ||
|
||
internal class ConfigRepositoryImpl @Inject constructor( | ||
private val configApi: ConfigApi, | ||
private val dataStore: DataStore<PositionConfigs>, | ||
@Dispatcher(YappDispatchers.IO) private val ioDispatcher: CoroutineDispatcher, | ||
) : ConfigRepository { | ||
|
||
override fun getPositionConfigs(): Flow<List<String>> = flow { | ||
val localPositionConfigs = dataStore.data.firstOrNull() | ||
if (localPositionConfigs != null) { | ||
emit(localPositionConfigs.configsList.map { it.label }) | ||
} | ||
|
||
val remotePositionConfigs = configApi.getPositionConfigs() | ||
emit(remotePositionConfigs.positions.map { it.label }) | ||
|
||
updatePositionConfigs(remotePositionConfigs) | ||
}.flowOn(ioDispatcher) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dispatcher 주입하니까 너무 깔끔하네요.. 굳...
jinukeu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
private suspend fun updatePositionConfigs(positionConfigs: PositionConfigResponse) { | ||
dataStore.updateData { currentData -> | ||
currentData.toBuilder() | ||
.clearConfigs() | ||
.addAllConfigs(positionConfigs.toProto()) | ||
.build() | ||
} | ||
} | ||
} |
8 changes: 7 additions & 1 deletion
8
core/data/src/main/java/com/yapp/core/data/data/repository/UnAuthorizedUserRepositoryImpl.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
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
25 changes: 25 additions & 0 deletions
25
core/data/src/main/java/com/yapp/core/data/local/proto/PositionConfigSerializer.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,25 @@ | ||
package com.yapp.core.data.local.proto | ||
|
||
import androidx.datastore.core.CorruptionException | ||
import androidx.datastore.core.Serializer | ||
import com.google.protobuf.InvalidProtocolBufferException | ||
import com.yapp.core.data.PositionConfigs | ||
import java.io.InputStream | ||
import java.io.OutputStream | ||
import javax.inject.Inject | ||
|
||
class PositionConfigSerializer @Inject constructor() : Serializer<PositionConfigs> { | ||
override val defaultValue: PositionConfigs = PositionConfigs.getDefaultInstance() | ||
|
||
override suspend fun readFrom(input: InputStream): PositionConfigs { | ||
return try { | ||
PositionConfigs.parseFrom(input) | ||
} catch (e: InvalidProtocolBufferException) { | ||
throw CorruptionException("Cannot read proto.", e) | ||
} | ||
} | ||
|
||
override suspend fun writeTo(t: PositionConfigs, output: OutputStream) { | ||
t.writeTo(output) | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
core/data/src/main/java/com/yapp/core/data/remote/api/ConfigApi.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,9 @@ | ||
package com.yapp.core.data.remote.api | ||
|
||
import com.yapp.core.data.remote.model.response.PositionConfigResponse | ||
import retrofit2.http.GET | ||
|
||
internal interface ConfigApi { | ||
@GET("v1/positions") | ||
suspend fun getPositionConfigs(): PositionConfigResponse | ||
} |
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
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.
Uh oh!
There was an error while loading. Please reload this page.