-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTokenModule.java
More file actions
39 lines (28 loc) · 986 Bytes
/
TokenModule.java
File metadata and controls
39 lines (28 loc) · 986 Bytes
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
package com.tom.meeter;
import static com.tom.meeter.infrastructure.common.Globals.getServerPath;
import static com.tom.meeter.infrastructure.common.InfrastructureHelper.logMethod;
import android.app.Application;
import androidx.annotation.NonNull;
import com.tom.meeter.context.token.service.TokenService;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import retrofit2.Retrofit;
import retrofit2.converter.jackson.JacksonConverterFactory;
@Module
public class TokenModule {
private static final String TAG = TokenModule.class.getCanonicalName();
public TokenModule() {
logMethod(TAG, this);
}
@Singleton
@NonNull
@Provides
public TokenService providesTokenService(Application app) {
return new Retrofit.Builder()
.baseUrl(getServerPath(app))
.addConverterFactory(JacksonConverterFactory.create())
.build()
.create(TokenService.class);
}
}