// Path: app/src/main/java/me/yifeiyuan/climb/data/GankConfig.java
// public class GankConfig {
// 
//     public static final String URL_DOMAIN = "http://gank.io/api/";
// 
//     public static final String URL_DAILY = "http://gank.avosapps.com/api/day/";
// 
//     public static final String URL_RANDOM = "http://gank.avosapps.com/api/random/data/Android/";
// 
//     public static final String ANDROID = "Android";
// 
//     public static final int PAGE_COUNT = 30;
//     public static final int MEIZI_COUNT = 20;
// }
// 
// Path: app/src/main/java/me/yifeiyuan/climb/network/api/GankApi.java
// public interface GankApi {
// 
//     @GET("data/Android/"+ GankConfig.PAGE_COUNT+"/{page}")
//     Observable<GankResponse> getAndroid(@Path("page") int page);
// 
//     @GET("data/iOS/"+ GankConfig.PAGE_COUNT+"/{page}")
//     Observable<GankResponse> getIos(@Path("page") int page);
// 
//     @GET("data/all/"+ GankConfig.PAGE_COUNT+"/{page}")
//     Observable<GankResponse> getAll(@Path("page") int page);
// 
//     // http://gank.avosapps.com/api/day/2015/08/06
//     @GET("day/{year}/{month}/{day}")
//     Observable<GankDaily> getDaily(@Path("year") int year, @Path("month") int month, @Path("day") int day);
// 
//     @GET("data/福利/"+GankConfig.MEIZI_COUNT+"/{page}")
//     Observable<GankResponse> getMeizi(@Path("page") int page);
// }
// 
// Path: app/src/main/java/me/yifeiyuan/climb/network/api/WeatherApi.java
// public interface WeatherApi {
// 
//     //  https://api.heweather.com/x3/weather?cityid=城市ID&key=你的认证key
// //    @GET("https://api.heweather.com/x3/weather?")
// //    Observable<RequestBody> getWeather(@Query("cityid") String city, @Query("key")String key);
// 
//     @GET("http://apis.baidu.com/heweather/weather/free")
//     @Headers({"apikey:"+ Config.BAIDU_WEATHER})
//     Observable<RequestBody> getWeather(@Query("city") String city);
// }
// 
// Path: app/src/main/java/me/yifeiyuan/climb/network/api/ZhiHuApi.java
// public interface ZhiHuApi {
// 
// 
//     @GET("http://news-at.zhihu.com/api/4/start-image/1080*1776")
//     Observable<SplashEntity> getWel();
// 
// 
//     /**主题日报列表*/
//     @GET("http://news-at.zhihu.com/api/4/themes")
//     Observable<RequestBody> themeList();
// 
//     /**主题日报内容*/
//     @GET("http://news-at.zhihu.com/api/4/theme/{themeId}")
//     Observable<RequestBody> themeDetails(@Path("themeId") int themeId);
// }


import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import rx.schedulers.Schedulers;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.concurrent.TimeUnit;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import me.yifeiyuan.climb.BuildConfig;
import me.yifeiyuan.climb.data.GankConfig;
import me.yifeiyuan.climb.network.api.GankApi;
import me.yifeiyuan.climb.network.api.WeatherApi;
import me.yifeiyuan.climb.network.api.ZhiHuApi;

    @Singleton
    @Provides
    Gson provideGson() {
        return new GsonBuilder()
                .setDateFormat("yyyy-MM-dd")   //("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
                .create();
    }

    @Singleton
    @Provides
    Retrofit provideRetrofit(OkHttpClient client, Gson gson) {
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(GankConfig.URL_DOMAIN)
                .addConverterFactory(GsonConverterFactory.create(gson))
                .addCallAdapterFactory(RxJavaCallAdapterFactory.createWithScheduler(Schedulers.io()))
                .client(client)
                .build();

        return retrofit;
    }

    @Singleton
    @Provides
    GankApi provideGankApi(Retrofit retrofit) {
        return retrofit.create(GankApi.class);
    }

    @Singleton
    @Provides
// Path: app/src/main/java/me/yifeiyuan/climb/data/GankConfig.java
// public class GankConfig {
// 
//     public static final String URL_DOMAIN = "http://gank.io/api/";
// 
//     public static final String URL_DAILY = "http://gank.avosapps.com/api/day/";
// 
//     public static final String URL_RANDOM = "http://gank.avosapps.com/api/random/data/Android/";
// 
//     public static final String ANDROID = "Android";
// 
//     public static final int PAGE_COUNT = 30;
//     public static final int MEIZI_COUNT = 20;
// }
// 
// Path: app/src/main/java/me/yifeiyuan/climb/network/api/GankApi.java
// public interface GankApi {
// 
//     @GET("data/Android/"+ GankConfig.PAGE_COUNT+"/{page}")
//     Observable<GankResponse> getAndroid(@Path("page") int page);
// 
//     @GET("data/iOS/"+ GankConfig.PAGE_COUNT+"/{page}")
//     Observable<GankResponse> getIos(@Path("page") int page);
// 
//     @GET("data/all/"+ GankConfig.PAGE_COUNT+"/{page}")
//     Observable<GankResponse> getAll(@Path("page") int page);
// 
//     // http://gank.avosapps.com/api/day/2015/08/06
//     @GET("day/{year}/{month}/{day}")
//     Observable<GankDaily> getDaily(@Path("year") int year, @Path("month") int month, @Path("day") int day);
// 
//     @GET("data/福利/"+GankConfig.MEIZI_COUNT+"/{page}")
//     Observable<GankResponse> getMeizi(@Path("page") int page);
// }
// 
// Path: app/src/main/java/me/yifeiyuan/climb/network/api/WeatherApi.java
// public interface WeatherApi {
// 
//     //  https://api.heweather.com/x3/weather?cityid=城市ID&key=你的认证key
// //    @GET("https://api.heweather.com/x3/weather?")
// //    Observable<RequestBody> getWeather(@Query("cityid") String city, @Query("key")String key);
// 
//     @GET("http://apis.baidu.com/heweather/weather/free")
//     @Headers({"apikey:"+ Config.BAIDU_WEATHER})
//     Observable<RequestBody> getWeather(@Query("city") String city);
// }
// 
// Path: app/src/main/java/me/yifeiyuan/climb/network/api/ZhiHuApi.java
// public interface ZhiHuApi {
// 
// 
//     @GET("http://news-at.zhihu.com/api/4/start-image/1080*1776")
//     Observable<SplashEntity> getWel();
// 
// 
//     /**主题日报列表*/
//     @GET("http://news-at.zhihu.com/api/4/themes")
//     Observable<RequestBody> themeList();
// 
//     /**主题日报内容*/
//     @GET("http://news-at.zhihu.com/api/4/theme/{themeId}")
//     Observable<RequestBody> themeDetails(@Path("themeId") int themeId);
// }


// Path: app/src/main/java/me/yifeiyuan/climb/di/modules/ApiModule.java
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import rx.schedulers.Schedulers;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.concurrent.TimeUnit;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import me.yifeiyuan.climb.BuildConfig;
import me.yifeiyuan.climb.data.GankConfig;
import me.yifeiyuan.climb.network.api.GankApi;
import me.yifeiyuan.climb.network.api.WeatherApi;
import me.yifeiyuan.climb.network.api.ZhiHuApi;


    @Singleton
    @Provides
    Gson provideGson() {
        return new GsonBuilder()
                .setDateFormat("yyyy-MM-dd")   //("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
                .create();
    }

    @Singleton
    @Provides
    Retrofit provideRetrofit(OkHttpClient client, Gson gson) {
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(GankConfig.URL_DOMAIN)
                .addConverterFactory(GsonConverterFactory.create(gson))
                .addCallAdapterFactory(RxJavaCallAdapterFactory.createWithScheduler(Schedulers.io()))
                .client(client)
                .build();

        return retrofit;
    }

    @Singleton
    @Provides
    GankApi provideGankApi(Retrofit retrofit) {
        return retrofit.create(GankApi.class);
    }

    @Singleton
    @Provides
    ZhiHuApi provideZhiHuApi(Retrofit retrofit) {