Skip to content

Commit

Permalink
Merge pull request #118 from THT-Team/feature/TOP-93_setting_list
Browse files Browse the repository at this point in the history
TOP-93 feature 설정 관리 화면 디자인 구현
  • Loading branch information
cwj-c authored Jan 27, 2024
2 parents 10cd897 + 45cc730 commit 7e4e914
Show file tree
Hide file tree
Showing 46 changed files with 1,467 additions and 133 deletions.
21 changes: 21 additions & 0 deletions data/src/main/assets/setting_account_manager_items.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"items": [
{
"type": "SettingItemSectionEntity",
"title": "계정 관리",
"description": null,
"items": [
{
"type": "SettingItemEntity",
"title": "로그아웃",
"key": "Logout"
},
{
"type": "SettingItemEntity",
"title": "계정 탈퇴",
"key": "DisActive"
}
]
}
]
}
130 changes: 130 additions & 0 deletions data/src/main/assets/setting_manage_items.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{
"items": [
{
"type": "SettingItemSectionEntity",
"title": "계정 설정",
"description": null,
"items": [
{
"type": "SettingContentItemItemEntity",
"title": "연동된 SNS",
"content": null,
"key": "Sns"
},
{
"type": "SettingContentItemItemEntity",
"title": "핸드폰 번호",
"content": null,
"key": "Phone"
},{
"type": "SettingContentItemItemEntity",
"title": "이메일",
"content": null,
"key": "Email"
}
]
},
{
"type": "SettingItemSectionEntity",
"title": "활동",
"description": "나의 연락처에 저장된 지인들을 폴링에서 보고 싶지 않다면 서로에게 노출되지 않도록 설정 할 수 있어요.",
"items": [
{
"type": "SettingItemEntity",
"title": "저장된 연락처 차단하기",
"key": "ContactBlock"
}
]
},
{
"type": "SettingItemSectionEntity",
"title": "내 위치 설정",
"description": "나의 위치를 업데이트해서 상대방과 매칭률을 높혀보세요.",
"items": [
{
"type": "SettingLocationItemItemEntity",
"title": "내 위치",
"location": null,
"key": "Location"
}
]
},
{
"type": "SettingItemSectionEntity",
"title": "알림 설정",
"description": null,
"items": [
{
"type": "SettingItemEntity",
"title": "알림 설정",
"key": "AlarmSetting"
}
]
},
{
"type": "SettingItemSectionEntity",
"title": "고객 지원",
"description": null,
"items": [
{
"type": "SettingItemEntity",
"title": "자주 묻는 질문",
"key": "Question"
},
{
"type": "SettingItemEntity",
"title": "문의 및 피드백 보내기",
"key": "Feedback"
}
]
},
{
"type": "SettingItemSectionEntity",
"title": "법적 고지",
"description": null,
"items": [
{
"type": "SettingItemEntity",
"title": "서비스 이용약관",
"key": "UseTerms"
},
{
"type": "SettingItemEntity",
"title": "개인정보 처리방침",
"key": "PrivacyTerms"
},
{
"type": "SettingItemEntity",
"title": "위치정보 이용약관",
"key": "LocationTerms"
},
{
"type": "SettingItemEntity",
"title": "라이센스",
"key": "Licence"
},
{
"type": "SettingItemEntity",
"title": "사업자 정보",
"key": "CompanyInfo"
}
]
},
{
"type": "SettingImageBannerItemEntity",
"banner": "Falling"
},
{
"type": "SettingItemSectionEntity",
"title": "계정 관리",
"description": null,
"items": [
{
"type": "SettingItemEntity",
"title": "계정 관리",
"key": "AccountManager"
}
]
}
]
}
10 changes: 2 additions & 8 deletions data/src/main/java/com/tht/tht/data/di/DaoModule.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.tht.tht.data.di

import com.tht.tht.data.local.dao.TokenDao
import com.tht.tht.data.local.dao.TokenDaoImpl
import com.tht.tht.data.local.dao.SignupUserDao
import com.tht.tht.data.local.dao.SignupUserDaoImpl
import com.tht.tht.data.local.dao.TermsDao
import com.tht.tht.data.local.dao.TermsDaoImpl
import com.tht.tht.data.local.dao.TokenDao
import com.tht.tht.data.local.dao.TokenDaoImpl
import com.tht.tht.data.local.dao.topic.DailyTopicDao
import com.tht.tht.data.local.dao.topic.DailyTopicDaoImpl
import dagger.Binds
Expand All @@ -18,10 +16,6 @@ import javax.inject.Singleton
@InstallIn(SingletonComponent::class)
abstract class DaoModule {

@Binds
@Singleton
abstract fun bindTermsDao(impl: TermsDaoImpl): TermsDao

@Binds
@Singleton
abstract fun bindSignupUserData(impl: SignupUserDaoImpl): SignupUserDao
Expand Down
5 changes: 5 additions & 0 deletions data/src/main/java/com/tht/tht/data/di/DataSourceModule.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.tht.tht.data.di

import com.tht.tht.data.local.datasource.SettingItemDataSource
import com.tht.tht.data.local.datasource.SettingItemDataSourceImpl
import com.tht.tht.data.local.datasource.SignupUserDataSource
import com.tht.tht.data.local.datasource.SignupUserDataSourceImpl
import com.tht.tht.data.local.datasource.TermsDataSource
Expand Down Expand Up @@ -67,4 +69,7 @@ abstract class DataSourceModule {

@Binds
abstract fun bindChatDataSource(impl: ChatDataSourceImpl): ChatDataSource

@Binds
abstract fun bindSettingItemDataSource(impl: SettingItemDataSourceImpl): SettingItemDataSource
}
5 changes: 5 additions & 0 deletions data/src/main/java/com/tht/tht/data/di/RepositoryModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import com.tht.tht.data.repository.ImageRepositoryImpl
import com.tht.tht.data.repository.LocationRepositoryImpl
import com.tht.tht.data.repository.LoginRepositoryImpl
import com.tht.tht.data.repository.RegionCodeRepositoryImpl
import com.tht.tht.data.repository.SettingRepositoryImpl
import com.tht.tht.data.repository.SignupRepositoryImpl
import com.tht.tht.data.repository.TokenRepositoryImpl
import com.tht.tht.domain.chat.repository.ChatRepository
import com.tht.tht.domain.dailyusercard.DailyUserCardRepository
import com.tht.tht.domain.email.repository.EmailRepository
import com.tht.tht.domain.image.ImageRepository
import com.tht.tht.domain.login.repository.LoginRepository
import com.tht.tht.domain.setting.repository.SettingRepository
import com.tht.tht.domain.signup.repository.LocationRepository
import com.tht.tht.domain.signup.repository.RegionCodeRepository
import com.tht.tht.domain.signup.repository.SignupRepository
Expand Down Expand Up @@ -58,4 +60,7 @@ abstract class RepositoryModule {

@Binds
abstract fun bindDailyUserCardRepository(impl: DailyUserCardRepositoryImpl): DailyUserCardRepository

@Binds
abstract fun bindSettingRepository(impl: SettingRepositoryImpl): SettingRepository
}
19 changes: 14 additions & 5 deletions data/src/main/java/com/tht/tht/data/di/ServiceModule.kt
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
package com.tht.tht.data.di

import com.tht.tht.data.remote.service.location.LocationService
import com.tht.tht.data.remote.service.location.LocationServiceImpl
import com.tht.tht.data.local.service.SettingItemListService
import com.tht.tht.data.local.service.SettingItemListServiceImpl
import com.tht.tht.data.local.service.TermsService
import com.tht.tht.data.local.service.TermsServiceImpl
import com.tht.tht.data.remote.service.email.EmailService
import com.tht.tht.data.remote.service.email.EmailServiceImpl
import com.tht.tht.data.remote.service.location.LocationService
import com.tht.tht.data.remote.service.location.LocationServiceImpl
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
abstract class ServiceModule {

@Binds
@Singleton
abstract fun bindLocationService(impl: LocationServiceImpl): LocationService

@Binds
@Singleton
abstract fun bindEmailService(impl: EmailServiceImpl): EmailService

@Binds
abstract fun bindTermsService(impl: TermsServiceImpl): TermsService

@Binds
abstract fun bindSettingItemListService(
impl: SettingItemListServiceImpl
): SettingItemListService
}
15 changes: 15 additions & 0 deletions data/src/main/java/com/tht/tht/data/di/UseCaseModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import com.tht.tht.domain.image.RemoveImageUrlUseCase
import com.tht.tht.domain.image.UploadImageUseCase
import com.tht.tht.domain.login.repository.LoginRepository
import com.tht.tht.domain.login.usecase.LoginUseCase
import com.tht.tht.domain.setting.repository.SettingRepository
import com.tht.tht.domain.setting.usecase.FetchAccountManageItemsUseCase
import com.tht.tht.domain.setting.usecase.FetchSettingManageItemsUseCase
import com.tht.tht.domain.signup.repository.LocationRepository
import com.tht.tht.domain.signup.repository.RegionCodeRepository
import com.tht.tht.domain.signup.repository.SignupRepository
Expand Down Expand Up @@ -311,4 +314,16 @@ object UseCaseModule {
loginRepository: LoginRepository
): UserDisActiveUseCase =
UserDisActiveUseCase(logoutUseCase, loginRepository)

@Provides
fun provideFetchSettingManageItemsUseCase(
settingRepository: SettingRepository
): FetchSettingManageItemsUseCase =
FetchSettingManageItemsUseCase(settingRepository)

@Provides
fun provideFetchAccountManageItemsUseCase(
settingRepository: SettingRepository
): FetchAccountManageItemsUseCase =
FetchAccountManageItemsUseCase(settingRepository)
}
7 changes: 0 additions & 7 deletions data/src/main/java/com/tht/tht/data/local/dao/TermsDao.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.tht.tht.data.local.datasource

import com.tht.tht.data.local.entity.setting.SettingItemsListResponse

interface SettingItemDataSource {
suspend fun fetchSettingMangerItemList(): SettingItemsListResponse

suspend fun fetchSettingAccountManagerItemList(): SettingItemsListResponse
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.tht.tht.data.local.datasource

import com.tht.tht.data.di.IODispatcher
import com.tht.tht.data.local.entity.setting.SettingItemsListResponse
import com.tht.tht.data.local.service.SettingItemListService
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.withContext
import javax.inject.Inject

class SettingItemDataSourceImpl @Inject constructor(
private val service: SettingItemListService,
@IODispatcher private val dispatcher: CoroutineDispatcher
) : SettingItemDataSource {
override suspend fun fetchSettingMangerItemList(): SettingItemsListResponse {
return withContext(dispatcher) {
service.fetchSettingMangerItemList()
}
}

override suspend fun fetchSettingAccountManagerItemList(): SettingItemsListResponse {
return withContext(dispatcher) {
service.fetchSettingAccountManagerItemList()
}
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package com.tht.tht.data.local.datasource

import com.tht.tht.data.di.IODispatcher
import com.tht.tht.data.local.dao.TermsDao
import com.tht.tht.data.local.service.TermsService
import com.tht.tht.data.local.entity.TermsEntity
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.withContext
import javax.inject.Inject

class TermsDataSourceImpl @Inject constructor(
private val termsDao: TermsDao,
private val termsService: TermsService,
@IODispatcher private val dispatcher: CoroutineDispatcher
) : TermsDataSource {

override suspend fun fetchSignupTerms(): TermsEntity {
return withContext(dispatcher) {
termsDao.fetchTerms()
termsService.fetchTerms()
}
}
}
Loading

0 comments on commit 7e4e914

Please sign in to comment.