-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServiceModule.kt
More file actions
82 lines (69 loc) · 2.8 KB
/
ServiceModule.kt
File metadata and controls
82 lines (69 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package com.threegap.bitnagil.di.data
import com.threegap.bitnagil.data.address.service.AddressService
import com.threegap.bitnagil.data.auth.service.AuthService
import com.threegap.bitnagil.data.emotion.service.EmotionService
import com.threegap.bitnagil.data.file.service.FileService
import com.threegap.bitnagil.data.onboarding.service.OnBoardingService
import com.threegap.bitnagil.data.recommendroutine.service.RecommendRoutineService
import com.threegap.bitnagil.data.report.service.ReportService
import com.threegap.bitnagil.data.routine.service.RoutineService
import com.threegap.bitnagil.data.user.service.UserService
import com.threegap.bitnagil.data.version.service.VersionService
import com.threegap.bitnagil.network.Auth
import com.threegap.bitnagil.network.Kakao
import com.threegap.bitnagil.network.NoneAuth
import com.threegap.bitnagil.network.token.ReissueService
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object ServiceModule {
@Provides
@Singleton
fun provideAuthService(@Auth retrofit: Retrofit): AuthService =
retrofit.create(AuthService::class.java)
@Provides
@Singleton
fun providerOnBoardingService(@Auth retrofit: Retrofit): OnBoardingService =
retrofit.create(OnBoardingService::class.java)
@Provides
@Singleton
fun provideRoutineService(@Auth retrofit: Retrofit): RoutineService =
retrofit.create(RoutineService::class.java)
@Provides
@Singleton
fun providerEmotionService(@Auth retrofit: Retrofit): EmotionService =
retrofit.create(EmotionService::class.java)
@Provides
@Singleton
fun provideReissueService(@NoneAuth retrofit: Retrofit): ReissueService =
retrofit.create(ReissueService::class.java)
@Provides
@Singleton
fun provideUserService(@Auth retrofit: Retrofit): UserService =
retrofit.create(UserService::class.java)
@Provides
@Singleton
fun provideRecommendRoutineService(@Auth retrofit: Retrofit): RecommendRoutineService =
retrofit.create(RecommendRoutineService::class.java)
@Provides
@Singleton
fun provideVersionService(@NoneAuth retrofit: Retrofit): VersionService =
retrofit.create(VersionService::class.java)
@Provides
@Singleton
fun provideAddressService(@Kakao retrofit: Retrofit): AddressService =
retrofit.create(AddressService::class.java)
@Provides
@Singleton
fun provideFileService(@Auth retrofit: Retrofit): FileService =
retrofit.create(FileService::class.java)
@Provides
@Singleton
fun provideReportService(@Auth retrofit: Retrofit): ReportService =
retrofit.create(ReportService::class.java)
}