1+ // package com.wzq.sample.data.remote
2+ //
3+ // import com.google.gson.JsonElement
4+ // import com.wzq.sample.data.model.ArticleList
5+ // import com.wzq.sample.data.model.Banner
6+ // import com.wzq.sample.data.model.Category
7+ // import com.wzq.sample.data.model.HotKeywordsItem
8+ // import com.wzq.sample.data.model.Response
9+ // import retrofit2.http.*
10+ //
11+ //
12+ // /**
13+ // * create by wzq on 2021/4/6
14+ // *
15+ // */
16+ // interface MainApi {
17+ //
18+ // /**
19+ // * 获取轮播图
20+ // * http://www.wanandroid.com/banner/json
21+ // */
22+ // @GET("banner/json")
23+ // suspend fun getBanners(): Response<List<Banner>>
24+ //
25+ // /**
26+ // * 获取文章列表
27+ // * http://www.wanandroid.com/article/list/0/json
28+ // * @param pageNum
29+ // */
30+ // @GET("article/list/{pageNum}/json")
31+ // suspend fun getArticles(@Path("pageNum") pageNum: Int): Response<ArticleList>
32+ //
33+ // @GET("article/listproject/{pageNum}/json")
34+ // suspend fun getProjects(@Path("pageNum") pageNum: Int): Response<ArticleList>
35+ //
36+ // /**
37+ // * 获取知识体系
38+ // * http://www.wanandroid.com/tree/json
39+ // */
40+ // @GET("tree/json")
41+ // suspend fun getCategory(): Response<List<Category>>
42+ //
43+ // /**
44+ // * 知识体系下的文章
45+ // * http://www.wanandroid.com/article/list/0/json?cid=168
46+ // * @param page
47+ // * @param cid
48+ // */
49+ // @GET("article/list/{page}/json")
50+ // suspend fun getCategoryArticles(
51+ // @Path("page") page: Int,
52+ // @Query("cid") cid: Int
53+ // ): Response<ArticleList>
54+ //
55+ // /**
56+ // * 登录
57+ // * http://www.wanandroid.com/user/login
58+ // * @param username
59+ // * @param password
60+ // */
61+ // @POST("user/login")
62+ // @FormUrlEncoded
63+ // suspend fun login(
64+ // @Field("username") username: String,
65+ // @Field("password") password: String
66+ // ): Response<JsonElement>
67+ //
68+ // /**
69+ // * 搜索热词
70+ // * http://www.wanandroid.com/hotkey/json
71+ // */
72+ // @GET("hotkey/json")
73+ // suspend fun getHotSearchData(): Response<List<HotKeywordsItem>>
74+ //
75+ // /**
76+ // * 搜索
77+ // * http://www.wanandroid.com/article/query/0/json
78+ // * @param page
79+ // * @param key
80+ // */
81+ // @POST("article/query/{page}/json")
82+ // @FormUrlEncoded
83+ // suspend fun queryBySearchKey(
84+ // @Path("page") page: Int,
85+ // @Field("k") key: String
86+ // ): Response<ArticleList>
87+ // }
0 commit comments