Skip to content

Commit ae7206f

Browse files
authored
Merge pull request #150 from YAPP-Github/feature/#139-report
[Feature/#139] 제보하기 기능을 구현합니다.
2 parents 91613b7 + da1655a commit ae7206f

File tree

88 files changed

+2893
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+2893
-77
lines changed

.github/workflows/develop_branch.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ jobs:
2424
- name: Generate local.properties
2525
env:
2626
KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }}
27+
KAKAO_REST_API_KEY: ${{ secrets.KAKAO_REST_API_KEY }}
2728
BITNAGIL_DEV_URL: ${{ secrets.BITNAGIL_DEV_URL }}
2829
BITNAGIL_PROD_URL: ${{ secrets.BITNAGIL_PROD_URL }}
2930
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
3031
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
3132
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }}
3233
run: |
3334
echo "kakao.native.app.key=$KAKAO_NATIVE_APP_KEY" >> local.properties
35+
echo "kakao.rest.api.key=$KAKAO_REST_API_KEY" >> local.properties
3436
echo "bitnagil.dev.url=$BITNAGIL_DEV_URL" >> local.properties
3537
echo "bitnagil.prod.url=$BITNAGIL_PROD_URL" >> local.properties
3638
echo "release.key.alias=$RELEASE_KEY_ALIAS" >> local.properties

app/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ android {
4646
name = "KAKAO_NATIVE_APP_KEY",
4747
value = "\"$kakaoNativeAppKey\"",
4848
)
49+
50+
val kakaoRestApiKey =
51+
(properties["kakao.rest.api.key"] as? String)
52+
?: System.getenv("KAKAO_REST_API_KEY")
53+
?: throw GradleException("KAKAO_REST_API_KEY 값이 없습니다.")
54+
55+
buildConfigField(
56+
type = "String",
57+
name = "KAKAO_REST_API_KEY",
58+
value = "\"$kakaoRestApiKey\"",
59+
)
4960
}
5061

5162
buildTypes {

app/src/main/AndroidManifest.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
xmlns:tools="http://schemas.android.com/tools">
44

55
<uses-permission android:name="android.permission.INTERNET" />
6+
<uses-permission android:name="android.permission.CAMERA" />
7+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
8+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
9+
10+
<uses-feature android:name="android.hardware.camera" android:required="true" />
611

712
<application
813
android:name=".BitnagilApplication"
@@ -41,5 +46,15 @@
4146
android:scheme="kakao${KAKAO_NATIVE_APP_KEY}" />
4247
</intent-filter>
4348
</activity>
49+
50+
<provider
51+
android:name="androidx.core.content.FileProvider"
52+
android:authorities="${applicationId}.provider"
53+
android:exported="false"
54+
android:grantUriPermissions="true">
55+
<meta-data
56+
android:name="android.support.FILE_PROVIDER_PATHS"
57+
android:resource="@xml/file_paths" />
58+
</provider>
4459
</application>
4560
</manifest>

app/src/main/java/com/threegap/bitnagil/MainNavHost.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import com.threegap.bitnagil.presentation.login.LoginScreenContainer
1313
import com.threegap.bitnagil.presentation.onboarding.OnBoardingScreenContainer
1414
import com.threegap.bitnagil.presentation.onboarding.OnBoardingViewModel
1515
import com.threegap.bitnagil.presentation.onboarding.model.navarg.OnBoardingScreenArg
16+
import com.threegap.bitnagil.presentation.report.ReportScreenContainer
1617
import com.threegap.bitnagil.presentation.routinelist.RoutineListScreenContainer
1718
import com.threegap.bitnagil.presentation.setting.SettingScreenContainer
1819
import com.threegap.bitnagil.presentation.splash.SplashScreenContainer
@@ -134,6 +135,11 @@ fun MainNavHost(
134135
launchSingleTop = true
135136
}
136137
},
138+
navigateToReport = {
139+
navigator.navController.navigate(Route.Report) {
140+
launchSingleTop = true
141+
}
142+
},
137143
)
138144
}
139145

@@ -289,5 +295,15 @@ fun MainNavHost(
289295
},
290296
)
291297
}
298+
299+
composable<Route.Report> {
300+
ReportScreenContainer(
301+
navigateToBack = {
302+
if (navigator.navController.previousBackStackEntry != null) {
303+
navigator.navController.popBackStack()
304+
}
305+
},
306+
)
307+
}
292308
}
293309
}

app/src/main/java/com/threegap/bitnagil/Route.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@ sealed interface Route {
4848

4949
@Serializable
5050
data object Guide : Route
51+
52+
@Serializable
53+
data object Report : Route
5154
}

app/src/main/java/com/threegap/bitnagil/di/core/NetworkModule.kt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import android.content.Intent
55
import com.threegap.bitnagil.BuildConfig
66
import com.threegap.bitnagil.MainActivity
77
import com.threegap.bitnagil.datastore.auth.storage.AuthTokenDataStore
8+
import com.threegap.bitnagil.network.Auth
9+
import com.threegap.bitnagil.network.Kakao
10+
import com.threegap.bitnagil.network.NoneAuth
811
import com.threegap.bitnagil.network.auth.AuthInterceptor
912
import com.threegap.bitnagil.network.auth.TokenAuthenticator
1013
import com.threegap.bitnagil.network.token.ReissueService
@@ -30,6 +33,8 @@ import javax.inject.Singleton
3033
@InstallIn(SingletonComponent::class)
3134
object NetworkModule {
3235
private const val APPLICATION_JSON = "application/json"
36+
private const val REST_API_KEY = BuildConfig.KAKAO_REST_API_KEY
37+
private const val KAKAO_URL = "https://dapi.kakao.com"
3338

3439
@Provides
3540
@Singleton
@@ -74,6 +79,43 @@ object NetworkModule {
7479
override suspend fun clearTokens() = dataStore.clearAuthToken()
7580
}
7681

82+
@Provides
83+
@Singleton
84+
@Kakao
85+
fun provideKakaoAuthInterceptor(): Interceptor =
86+
Interceptor { chain ->
87+
val request = chain.request().newBuilder()
88+
.addHeader("Authorization", "KakaoAK $REST_API_KEY")
89+
.build()
90+
chain.proceed(request)
91+
}
92+
93+
@Provides
94+
@Singleton
95+
@Kakao
96+
fun provideKakaoOkHttpClient(
97+
httpLoggingInterceptor: HttpLoggingInterceptor,
98+
@Kakao kakaoAuthInterceptor: Interceptor,
99+
): OkHttpClient = OkHttpClient.Builder()
100+
.addInterceptor(kakaoAuthInterceptor)
101+
.addInterceptor(httpLoggingInterceptor)
102+
.connectTimeout(10L, TimeUnit.SECONDS)
103+
.writeTimeout(30L, TimeUnit.SECONDS)
104+
.readTimeout(30L, TimeUnit.SECONDS)
105+
.build()
106+
107+
@Provides
108+
@Singleton
109+
@Kakao
110+
fun provideKakaoRetrofit(
111+
converterFactory: Converter.Factory,
112+
@Kakao okHttpClient: OkHttpClient,
113+
): Retrofit = Retrofit.Builder()
114+
.baseUrl(KAKAO_URL)
115+
.addConverterFactory(converterFactory)
116+
.client(okHttpClient)
117+
.build()
118+
77119
@Provides
78120
@Singleton
79121
fun provideTokenAuthenticator(

app/src/main/java/com/threegap/bitnagil/di/data/DataSourceModule.kt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
package com.threegap.bitnagil.di.data
22

3+
import com.threegap.bitnagil.data.address.datasource.AddressDataSource
4+
import com.threegap.bitnagil.data.address.datasource.LocationDataSource
5+
import com.threegap.bitnagil.data.address.datasourceImpl.AddressDataSourceImpl
6+
import com.threegap.bitnagil.data.address.datasourceImpl.LocationDataSourceImpl
37
import com.threegap.bitnagil.data.auth.datasource.AuthLocalDataSource
48
import com.threegap.bitnagil.data.auth.datasource.AuthRemoteDataSource
59
import com.threegap.bitnagil.data.auth.datasourceimpl.AuthLocalDataSourceImpl
610
import com.threegap.bitnagil.data.auth.datasourceimpl.AuthRemoteDataSourceImpl
711
import com.threegap.bitnagil.data.emotion.datasource.EmotionDataSource
812
import com.threegap.bitnagil.data.emotion.datasourceImpl.EmotionDataSourceImpl
13+
import com.threegap.bitnagil.data.file.datasource.FileDataSource
14+
import com.threegap.bitnagil.data.file.datasourceImpl.FileDataSourceImpl
915
import com.threegap.bitnagil.data.onboarding.datasource.OnBoardingDataSource
1016
import com.threegap.bitnagil.data.onboarding.datasourceImpl.OnBoardingDataSourceImpl
1117
import com.threegap.bitnagil.data.recommendroutine.datasource.RecommendRoutineDataSource
1218
import com.threegap.bitnagil.data.recommendroutine.datasourceImpl.RecommendRoutineDataSourceImpl
19+
import com.threegap.bitnagil.data.report.datasource.ReportDataSource
20+
import com.threegap.bitnagil.data.report.datasourceImpl.ReportDataSourceImpl
1321
import com.threegap.bitnagil.data.routine.datasource.RoutineRemoteDataSource
1422
import com.threegap.bitnagil.data.routine.datasourceImpl.RoutineRemoteDataSourceImpl
1523
import com.threegap.bitnagil.data.user.datasource.UserDataSource
@@ -63,4 +71,20 @@ abstract class DataSourceModule {
6371
@Binds
6472
@Singleton
6573
abstract fun bindVersionDataSource(versionDataSourceImpl: VersionDataSourceImpl): VersionDataSource
74+
75+
@Binds
76+
@Singleton
77+
abstract fun bindLocationDataSource(locationDataSourceImpl: LocationDataSourceImpl): LocationDataSource
78+
79+
@Binds
80+
@Singleton
81+
abstract fun bindAddressDataSource(addressDataSourceImpl: AddressDataSourceImpl): AddressDataSource
82+
83+
@Binds
84+
@Singleton
85+
abstract fun bindFileDataSource(impl: FileDataSourceImpl): FileDataSource
86+
87+
@Binds
88+
@Singleton
89+
abstract fun bindReportDataSource(impl: ReportDataSourceImpl): ReportDataSource
6690
}

app/src/main/java/com/threegap/bitnagil/di/data/RepositoryModule.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
package com.threegap.bitnagil.di.data
22

3+
import com.threegap.bitnagil.data.address.repositoryImpl.AddressRepositoryImpl
34
import com.threegap.bitnagil.data.auth.repositoryimpl.AuthRepositoryImpl
45
import com.threegap.bitnagil.data.emotion.repositoryImpl.EmotionRepositoryImpl
6+
import com.threegap.bitnagil.data.file.repositoryImpl.FileRepositoryImpl
57
import com.threegap.bitnagil.data.onboarding.repositoryImpl.OnBoardingRepositoryImpl
68
import com.threegap.bitnagil.data.recommendroutine.repositoryImpl.RecommendRoutineRepositoryImpl
9+
import com.threegap.bitnagil.data.report.repositoryImpl.ReportRepositoryImpl
710
import com.threegap.bitnagil.data.routine.repositoryImpl.RoutineRepositoryImpl
811
import com.threegap.bitnagil.data.user.repositoryImpl.UserRepositoryImpl
912
import com.threegap.bitnagil.data.version.repositoryImpl.VersionRepositoryImpl
1013
import com.threegap.bitnagil.data.writeroutine.repositoryImpl.WriteRoutineRepositoryImpl
14+
import com.threegap.bitnagil.domain.address.repository.AddressRepository
1115
import com.threegap.bitnagil.domain.auth.repository.AuthRepository
1216
import com.threegap.bitnagil.domain.emotion.repository.EmotionRepository
17+
import com.threegap.bitnagil.domain.file.repository.FileRepository
1318
import com.threegap.bitnagil.domain.onboarding.repository.OnBoardingRepository
1419
import com.threegap.bitnagil.domain.recommendroutine.repository.RecommendRoutineRepository
20+
import com.threegap.bitnagil.domain.report.repository.ReportRepository
1521
import com.threegap.bitnagil.domain.routine.repository.RoutineRepository
1622
import com.threegap.bitnagil.domain.user.repository.UserRepository
1723
import com.threegap.bitnagil.domain.version.repository.VersionRepository
@@ -57,4 +63,16 @@ abstract class RepositoryModule {
5763
@Binds
5864
@Singleton
5965
abstract fun bindVersionRepository(versionRepositoryImpl: VersionRepositoryImpl): VersionRepository
66+
67+
@Binds
68+
@Singleton
69+
abstract fun bindAddressRepository(addressRepositoryImpl: AddressRepositoryImpl): AddressRepository
70+
71+
@Binds
72+
@Singleton
73+
abstract fun bindFileRepository(impl: FileRepositoryImpl): FileRepository
74+
75+
@Binds
76+
@Singleton
77+
abstract fun bindReportRepository(impl: ReportRepositoryImpl): ReportRepository
6078
}

app/src/main/java/com/threegap/bitnagil/di/data/ServiceModule.kt

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
package com.threegap.bitnagil.di.data
22

3+
import com.threegap.bitnagil.data.address.service.AddressService
34
import com.threegap.bitnagil.data.auth.service.AuthService
45
import com.threegap.bitnagil.data.emotion.service.EmotionService
6+
import com.threegap.bitnagil.data.file.service.FileService
57
import com.threegap.bitnagil.data.onboarding.service.OnBoardingService
68
import com.threegap.bitnagil.data.recommendroutine.service.RecommendRoutineService
9+
import com.threegap.bitnagil.data.report.service.ReportService
710
import com.threegap.bitnagil.data.routine.service.RoutineService
811
import com.threegap.bitnagil.data.user.service.UserService
912
import com.threegap.bitnagil.data.version.service.VersionService
1013
import com.threegap.bitnagil.data.writeroutine.service.WriteRoutineService
11-
import com.threegap.bitnagil.di.core.Auth
12-
import com.threegap.bitnagil.di.core.NoneAuth
14+
import com.threegap.bitnagil.network.Auth
15+
import com.threegap.bitnagil.network.Kakao
16+
import com.threegap.bitnagil.network.NoneAuth
1317
import com.threegap.bitnagil.network.token.ReissueService
1418
import dagger.Module
1519
import dagger.Provides
@@ -66,4 +70,19 @@ object ServiceModule {
6670
@Singleton
6771
fun provideVersionService(@NoneAuth retrofit: Retrofit): VersionService =
6872
retrofit.create(VersionService::class.java)
73+
74+
@Provides
75+
@Singleton
76+
fun provideAddressService(@Kakao retrofit: Retrofit): AddressService =
77+
retrofit.create(AddressService::class.java)
78+
79+
@Provides
80+
@Singleton
81+
fun provideFileService(@Auth retrofit: Retrofit): FileService =
82+
retrofit.create(FileService::class.java)
83+
84+
@Provides
85+
@Singleton
86+
fun provideReportService(@Auth retrofit: Retrofit): ReportService =
87+
retrofit.create(ReportService::class.java)
6988
}

app/src/main/java/com/threegap/bitnagil/navigation/home/HomeNavHost.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ fun HomeNavHost(
4343
navigateToRegisterRoutine: (String?) -> Unit,
4444
navigateToEmotion: () -> Unit,
4545
navigateToRoutineList: (String) -> Unit,
46+
navigateToReport: () -> Unit,
4647
) {
4748
val navigator = rememberHomeNavigator()
4849
var showFloatingOverlay by remember { mutableStateOf(false) }
@@ -106,6 +107,11 @@ fun HomeNavHost(
106107

107108
BitnagilFloatingActionMenu(
108109
actions = listOf(
110+
FloatingActionItem(
111+
icon = R.drawable.ic_complaint,
112+
text = "제보하기",
113+
onClick = { navigateToReport() },
114+
),
109115
FloatingActionItem(
110116
icon = R.drawable.ic_routine_add,
111117
text = "루틴 등록",

0 commit comments

Comments
 (0)