// Path: app/src/main/java/com/github/cchao/touchnews/util/BaiDuApiService.java
// public interface BaiDuApiService {
//     //新闻api
//     @GET("showapi_open_bus/channel_news/search_news")
//     Observable<NewsItemRoot> getNews(@Header("apikey") String apikey, @Query("channelId") String channelID, @Query("page") String
//         page);
// 
//     //笑话集
//     @GET("showapi_open_bus/showapi_joke/joke_text")
//     Observable<JokeTextRoot> getJokeText(@Header("apikey") String apikey, @Query("page") String page);
// 
//     //笑话集
//     @GET("showapi_open_bus/showapi_joke/joke_pic")
//     Observable<JokeImageRoot> getJokeImage(@Header("apikey") String apikey, @Query("page") String page);
// 
//     //响应根据关键字获取的歌曲列表
//     @GET("geekery/music/query")
//     Observable<MusicInfoRoot> getMusicList(@Header("apikey") String apikey, @Query("s") String s);
// 
//     //获取Music播放地址
//     @GET("geekery/music/playinfo")
//     Observable<MusicPathRoot> getMusicPath(@Header("apikey") String apikey, @Query("hash") String hash);
// 
//     //歌手信息
//     @GET("geekery/music/singer")
//     Observable<MusicSingerRoot> getSinger(@Header("apikey") String apikey, @Query("name") String name);
// 
// 
// }
// 
// Path: app/src/main/java/com/github/cchao/touchnews/util/UrlUtil.java
// public class UrlUtil {
//     //baiDu_apiKey
//     public static final String API_KEY = "96a573502b09d771c6431c106d04613a";
//     //BaiDu_url
//     public static final String API_BAI_DU = "http://apis.baidu.com/";
//     //turing_apiKey
//     public static final String TURING_KEY = "16d2878f1e41520c14dde5ed52920423";
//     //新闻api
//     public static final String URL_NEWS = "http://apis.baidu.com/showapi_open_bus/channel_news/search_news";
//     //图片笑话
//     public static final String URL_JOKE_IMAGE = "http://apis.baidu.com/showapi_open_bus/showapi_joke/joke_pic";
//     //文字笑话
//     public static final String URL_JOKE_Text = "http://apis.baidu.com/showapi_open_bus/showapi_joke/joke_text";
//     //天气api
//     public static final String URL_WEATHER = "http://apis.baidu.com/heweather/weather/free";
//     //音乐Hash api
//     public static final String URL_MUSIC_HASH = "http://apis.baidu.com/geekery/music/query";
//     //音乐地址 api
//     public static final String URL_MUSIC_INFO = "http://apis.baidu.com/geekery/music/playinfo";
//     //歌手信息 api
//     public static final String URL_MUSIC_SINGER = "http://apis.baidu.com/geekery/music/singer";
//     //通过IP获取定位城市
//     public static final String URL_CITY = "http://pv.sohu.com/cityjson";
//     //图灵api
//     public static final String URL_CHAT = "http://www.tuling123.com/openapi/api";
// }


import android.support.annotation.NonNull;
import com.github.cchao.touchnews.util.BaiDuApiService;
import com.github.cchao.touchnews.util.UrlUtil;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
package com.github.cchao.touchnews.di.module;





/**
 * Created by cchao on 2016/8/23.
 * E-mail:   cchao1024@163.com
 * Description: api module
 */
@Module
public class ApiModule {
    /**
     * @param baseUrl baseUrl
     * @return Retrofit 对象
     */
    private Retrofit getApiService(@NonNull String baseUrl) {
        return new Retrofit.Builder()
            .addConverterFactory(GsonConverterFactory.create())
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .baseUrl(baseUrl)
            .build();
    }

    /**
     * @return 百度的api接口
     */
    @Singleton
    @Provides
// Path: app/src/main/java/com/github/cchao/touchnews/util/BaiDuApiService.java
// public interface BaiDuApiService {
//     //新闻api
//     @GET("showapi_open_bus/channel_news/search_news")
//     Observable<NewsItemRoot> getNews(@Header("apikey") String apikey, @Query("channelId") String channelID, @Query("page") String
//         page);
// 
//     //笑话集
//     @GET("showapi_open_bus/showapi_joke/joke_text")
//     Observable<JokeTextRoot> getJokeText(@Header("apikey") String apikey, @Query("page") String page);
// 
//     //笑话集
//     @GET("showapi_open_bus/showapi_joke/joke_pic")
//     Observable<JokeImageRoot> getJokeImage(@Header("apikey") String apikey, @Query("page") String page);
// 
//     //响应根据关键字获取的歌曲列表
//     @GET("geekery/music/query")
//     Observable<MusicInfoRoot> getMusicList(@Header("apikey") String apikey, @Query("s") String s);
// 
//     //获取Music播放地址
//     @GET("geekery/music/playinfo")
//     Observable<MusicPathRoot> getMusicPath(@Header("apikey") String apikey, @Query("hash") String hash);
// 
//     //歌手信息
//     @GET("geekery/music/singer")
//     Observable<MusicSingerRoot> getSinger(@Header("apikey") String apikey, @Query("name") String name);
// 
// 
// }
// 
// Path: app/src/main/java/com/github/cchao/touchnews/util/UrlUtil.java
// public class UrlUtil {
//     //baiDu_apiKey
//     public static final String API_KEY = "96a573502b09d771c6431c106d04613a";
//     //BaiDu_url
//     public static final String API_BAI_DU = "http://apis.baidu.com/";
//     //turing_apiKey
//     public static final String TURING_KEY = "16d2878f1e41520c14dde5ed52920423";
//     //新闻api
//     public static final String URL_NEWS = "http://apis.baidu.com/showapi_open_bus/channel_news/search_news";
//     //图片笑话
//     public static final String URL_JOKE_IMAGE = "http://apis.baidu.com/showapi_open_bus/showapi_joke/joke_pic";
//     //文字笑话
//     public static final String URL_JOKE_Text = "http://apis.baidu.com/showapi_open_bus/showapi_joke/joke_text";
//     //天气api
//     public static final String URL_WEATHER = "http://apis.baidu.com/heweather/weather/free";
//     //音乐Hash api
//     public static final String URL_MUSIC_HASH = "http://apis.baidu.com/geekery/music/query";
//     //音乐地址 api
//     public static final String URL_MUSIC_INFO = "http://apis.baidu.com/geekery/music/playinfo";
//     //歌手信息 api
//     public static final String URL_MUSIC_SINGER = "http://apis.baidu.com/geekery/music/singer";
//     //通过IP获取定位城市
//     public static final String URL_CITY = "http://pv.sohu.com/cityjson";
//     //图灵api
//     public static final String URL_CHAT = "http://www.tuling123.com/openapi/api";
// }


// Path: app/src/main/java/com/github/cchao/touchnews/di/module/ApiModule.java
import android.support.annotation.NonNull;
import com.github.cchao.touchnews.util.BaiDuApiService;
import com.github.cchao.touchnews.util.UrlUtil;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

package com.github.cchao.touchnews.di.module;





/**
 * Created by cchao on 2016/8/23.
 * E-mail:   cchao1024@163.com
 * Description: api module
 */
@Module
public class ApiModule {
    /**
     * @param baseUrl baseUrl
     * @return Retrofit 对象
     */
    private Retrofit getApiService(@NonNull String baseUrl) {
        return new Retrofit.Builder()
            .addConverterFactory(GsonConverterFactory.create())
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .baseUrl(baseUrl)
            .build();
    }

    /**
     * @return 百度的api接口
     */
    @Singleton
    @Provides
    protected BaiDuApiService provideBaiDuApiService() {