Updated on 2026-08-14
This commit is contained in:
parent
6c8c365317
commit
922610a9ed
7 changed files with 50 additions and 163 deletions
|
|
@ -47,16 +47,15 @@ class NetworkModule {
|
|||
.build();
|
||||
}
|
||||
|
||||
private OkHttpClient createHttpClient() {
|
||||
return new OkHttpClient.Builder().
|
||||
addInterceptor(createLogging()).
|
||||
build();
|
||||
}
|
||||
|
||||
private HttpLoggingInterceptor createLogging() {
|
||||
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
|
||||
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||
return logging;
|
||||
@Singleton
|
||||
@Provides
|
||||
@Named(Server.ApiUpdateVersion.URL_UPDATE_VERSION)
|
||||
Retrofit provideGithubusercontent() {
|
||||
return new Retrofit.Builder()
|
||||
.baseUrl(Server.ApiUpdateVersion.URL_UPDATE_VERSION)
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.client(createHttpClient())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
|
|
@ -70,4 +69,16 @@ class NetworkModule {
|
|||
.build();
|
||||
}
|
||||
|
||||
private OkHttpClient createHttpClient() {
|
||||
return new OkHttpClient.Builder().
|
||||
addInterceptor(createLogging()).
|
||||
build();
|
||||
}
|
||||
|
||||
private HttpLoggingInterceptor createLogging() {
|
||||
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
|
||||
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||
return logging;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue