pda/zhuike/src/main/java/com/novelbook/android/netapi/HttpApi.java

57 lines
1.5 KiB
Java
Raw Normal View History

package com.novelbook.android.netapi;
import java.util.Map;
import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
2019-04-03 23:29:58 +08:00
import retrofit2.http.Path;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;
/**
* Created by 眼神 on 2018/3/27.
*
* 存放所有的Api
*/
public interface HttpApi {
//请填写自己的接口名
// @POST("abc")
// Observable<ResponseBody> getDataForBean(@Body DouBanMovieRequest bean);
//请填写自己的接口名
@GET("top250")
Observable<ResponseBody> getDataForMap(@QueryMap Map<String, Integer> map);
/**
* 通过地址下载一个文件
*/
@GET("ab")
@Streaming
Call<ResponseBody> downloadFile(@Url String fileUrl);
2019-04-05 23:59:31 +08:00
//http://xiaoshuofenxiang.com/api/g/
@GET("g")
Observable<ResponseBody> getMasterDomain();
//http://xiaoshuofenxiang.com/api/n/f2619820112625133c14dcb170f5e092.json
@GET("n/{id}")
Observable<ResponseBody> getNovel(@Path("id") int novelId);
2019-04-03 16:21:00 +08:00
2019-04-05 23:59:31 +08:00
//http://xiaoshuofenxiang.com/api/n/f2619820112625133c14dcb170f5e092.mulu-urls.json
@GET("n/{id}/mulu-urls")
Observable<ResponseBody> getNovelSites(@Path("id") int novelId);
2019-04-03 16:21:00 +08:00
2019-04-05 23:59:31 +08:00
//http://xiaoshuofenxiang.com/api/s/www.qu.la.json
2019-04-10 22:19:06 +08:00
@GET("s/{siteDomain}.json")
Observable<ResponseBody> getNovelRule(@Path("siteDomain") String siteDomain);
@GET("/page/index")
Observable<ResponseBody> getFirstPage();
}