| | |
| | | package com.dayu.pipirrapp.net; |
| | | |
| | | |
| | | import com.dayu.pipirrapp.BuildConfig; |
| | | |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import okhttp3.OkHttpClient; |
| | |
| | | public class RetrofitClient { |
| | | |
| | | private static RetrofitClient mInstance; |
| | | private Retrofit retrofit; |
| | | private final Retrofit retrofit; |
| | | private static final int READ_TIME_OUT = 10; |
| | | private static final int CONNECT_TIME_OUT = 10; |
| | | |
| | |
| | | builder.addInterceptor(new MyIntercepterApplication()); |
| | | //添加日志拦截器 |
| | | //添加数据请求统一处理拦截器 |
| | | // if (BuildConfig.DEBUG) { |
| | | // builder.addInterceptor(loggingInterceptor); |
| | | // } |
| | | if (BuildConfig.DEBUG) { |
| | | builder.addInterceptor(loggingInterceptor); |
| | | } |
| | | |
| | | OkHttpClient client = builder.build(); |
| | | // // 创建GsonBuilder并设置长整型序列化策略为字符串 |