Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
部分网络请求数据做缓存;
Browse files Browse the repository at this point in the history
  • Loading branch information
OCNYang committed Dec 6, 2017
1 parent 8d7da07 commit dc1046b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/src/main/java/com/ocnyang/qbox/app/network/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static DemoApi getGankApi() {
public static NewsApi getNewsApi() {
if (sNewsApi == null) {
Retrofit retrofit = new Retrofit.Builder()
.client(okHttpClient)
.client(cacheClient)
.baseUrl(ROOT_URL)
.addConverterFactory(gsonConverterFactory)
.addCallAdapterFactory(rxJavaCallAdapterFactory)
Expand All @@ -111,7 +111,7 @@ public static NewsApi getNewsApi() {
public static WechatApi getWechatApi() {
if (mWechatApi == null) {
Retrofit retrofit = new Retrofit.Builder()
.client(okHttpClient)
.client(cacheClient)
.baseUrl(ROOT_URL)
.addConverterFactory(gsonConverterFactory)
.addCallAdapterFactory(rxJavaCallAdapterFactory)
Expand Down Expand Up @@ -139,7 +139,7 @@ public static FindBgApi getFindBgApi() {
public static DayJokeApi getDayJokeApi() {
if (sDayJokeApi == null) {
Retrofit retrofit = new Retrofit.Builder()
.client(okHttpClient)
.client(cacheClient)
.baseUrl("http://japi.juhe.cn/")
.addConverterFactory(gsonConverterFactory)
.addCallAdapterFactory(rxJavaCallAdapterFactory)
Expand Down Expand Up @@ -167,7 +167,7 @@ public static ConstellationApi getConstellationApi(){
public static TextJokeApi getRandomTextJokeApi(){
if (sRandomTextJokeApi == null) {
Retrofit retrofit = new Retrofit.Builder()
.client(okHttpClient)
.client(cacheClient)
.baseUrl("http://v.juhe.cn/")
.addConverterFactory(gsonConverterFactory)
.addCallAdapterFactory(rxJavaCallAdapterFactory)
Expand All @@ -180,7 +180,7 @@ public static TextJokeApi getRandomTextJokeApi(){
public static TextJokeApi getNewTextJokeApi(){
if (sTextJokeApi == null) {
Retrofit retrofit = new Retrofit.Builder()
.client(okHttpClient)
.client(cacheClient)
.baseUrl("http://japi.juhe.cn/")
.addConverterFactory(gsonConverterFactory)
.addCallAdapterFactory(rxJavaCallAdapterFactory)
Expand All @@ -194,7 +194,7 @@ public static TextJokeApi getNewTextJokeApi(){
public static ImgJokeApi getRandomImgJokeApi(){
if (sRandomImgJokeApi == null) {
Retrofit retrofit = new Retrofit.Builder()
.client(okHttpClient)
.client(cacheClient)
.baseUrl("http://v.juhe.cn/")
.addConverterFactory(gsonConverterFactory)
.addCallAdapterFactory(rxJavaCallAdapterFactory)
Expand All @@ -207,7 +207,7 @@ public static ImgJokeApi getRandomImgJokeApi(){
public static ImgJokeApi getNewImgJokeApi(){
if (sNewImgJokeApi == null) {
Retrofit retrofit = new Retrofit.Builder()
.client(okHttpClient)
.client(cacheClient)
.baseUrl("http://japi.juhe.cn/")
.addConverterFactory(gsonConverterFactory)
.addCallAdapterFactory(rxJavaCallAdapterFactory)
Expand Down

0 comments on commit dc1046b

Please sign in to comment.