下面列出了怎么用retrofit2.http.GET的API类实例代码及写法,或者点击链接到github查看源代码。
@GET("api/v1/accounts/{accountId}/ledgers")
Call<KucoinResponse<Pagination<AccountDetailResponse>>> getAccountDetail(
@Path("accountId") String accountId,
@Query("currentPage") int currentPage,
@Query("pageSize") int pageSize,
@Query("startAt") long startAt,
@Query("endAt") long endAt);
@GET("api/v1/orders")
Call<KucoinResponse<Pagination<OrderResponse>>> queryOrders(@Query("symbol") String symbol,
@Query("side") String side,
@Query("type") String type,
@Query("status") String status,
@Query("startAt") Long startAt,
@Query("endAt") Long endAt,
@Query("pageSize") int pageSize,
@Query("currentPage") int currentPage);
@GET("api/v1/withdrawals/quotas")
Call<KucoinResponse<WithdrawQuotaResponse>> getWithdrawQuotas(@Query("currency") String currency,
@Query("chain") String chain);
@GET("v1/user/bookmarks/illust?restrict=public")
Call<Illusts> getBookmarkJson(@Query("user_id") String userId);
@GET("v1/illust/bookmark/users?filter=for_android")
Observable<ListSimpleUser> getUsersWhoLikeThisIllust(@Header("Authorization") String token,
@Query("illust_id") int illust_id);
@GET("v2/illust/bookmark/detail")
Observable<ListBookmarkTag> getIllustBookmarkTags(@Header("Authorization") String token,
@Query("illust_id") int illust_id);
@GET("api/v1/accounts/{accountId}")
Call<KucoinResponse<AccountBalanceResponse>> getAccount(@Path("accountId") String accountId);
/**
* 获取文章审核列表
*/
@GET("account/review_articles")
Single<RespData<ReviewArticleListResp>> getReviewArticles(@Query("start") int start,
@Query("size") int size,
@Query("status") int status);
@GET("coins/list")
Call<List<CoinList>> getCoinList();
@GET("/abci_query?path=%22/param/fees%22")
Call<JsonRpcResponse<ABCIQueryResult>> getFees();
/**
* 获取评论
*/
@GET("article/comment/list")
Observable<RespData<ArticleReviewResp>> getArticleReviewList(@Query("article_id") String articleId,
@Query("start_time") long startTime,
@Query("size") int size);
@GET("api/v1/market/orderbook/level2_100")
Call<KucoinResponse<OrderBookResponse>> getPartOrderBookAggregated(@Query("symbol") String symbol);
@GET("v1/search/novel?filter=for_android&include_translated_tag_results=true")
Observable<ListNovel> searchNovel(@Header("Authorization") String token,
@Query("word") String word,
@Query("sort") String sort,
@Query("search_target") String search_target);
@GET("coins/{id}/market_chart")
Call<MarketChart> getCoinMarketChartById(@Path("id") String id, @Query("vs_currency") String vsCurrency,
@Query("days") Integer days);
@GET("coins/{id}/market_chart/range")
Call<MarketChart> getCoinMarketChartRangeById(@Path("id") String id, @Query("vs_currency") String vsCurrency,
@Query("from") String from, @Query("to") String to);
@Headers({"Referer: " + Api.APP_MEIZITU_DOMAIN,
"Domain-Name: " + Api.MEI_ZI_TU_DOMAIN_NAME})
@GET("taiwan/page/{page}/")
Observable<String> meiZiTuJaiwan(@Path("page") int page);
@GET("api/v1/market/stats")
Call<KucoinResponse<SymbolTickResponse>> getMarketStats(@Query("symbol") String symbol);
@GET("exchanges")
Call<List<Exchanges>> getExchanges();
@GET("api/v1/accounts")
Call<KucoinResponse<List<AccountBalancesResponse>>> getAccountList(
@Query("currency") String currency, @Query("type") String type);
@Headers({"Referer: " + Api.APP_MEIZITU_DOMAIN,
"Domain-Name: " + Api.MEI_ZI_TU_DOMAIN_NAME})
@GET("{id}")
Observable<String> meiZiTuImageList(@Path("id") int id);
@GET("/abci_query?path=%22custom/stake/validators%22")
Call<JsonRpcResponse<ABCIQueryResult>> getStakeValidators();
@GET("/tx")
Call<JsonRpcResponse<TransactionResult>> getTransaction(@Query("hash") String hash);
/**
* 下载视频扣积分 mArticleId,
*/
@GET("original_videos/{fileId}/judgement")
Single<RespData<ArticleDownloadVideoResp>> getVideoJudgement(@Path("fileId") int fileId,
@Query("article_id") String articleId);
/**
* 获取二级评论
*/
@GET("article/subcomment/list")
Observable<RespData<ArticleReviewResp>> getReviewList(@Query("article_id") String articleId,
@Query("comment_id") String commentId,
@Query("start_time") long startTime,
@Query("size") int size);
@GET("events")
Call<Events> getEvents();
@Headers({"Domain-Name: " + Api.PORN9_VIDEO_DOMAIN_NAME})
@GET("captcha.php")
Observable<ResponseBody> captcha();
@GET("events/countries")
Call<EventCountries> getEventsCountries();
@GET("global")
Call<Global> getGlobal();
@GET("/abci_query")
Call<JsonRpcResponse<ABCIQueryResult>> getTokenInfo(@Query("path") String pathWithSymbol);
@GET("KC3Kai/kc3-translations/{commit}/{path}")
Call<JsonObject> download(@Path("commit") String commit, @Path("path") String path);