Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update all entity, refactor all base api and event
- Loading branch information
1 parent
c40dc5d
commit d146add
Showing
25 changed files
with
908 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package me.ewriter.bangumitv.api; | ||
|
||
import me.ewriter.bangumitv.api.response.BaseResponse; | ||
import retrofit2.Call; | ||
import retrofit2.http.GET; | ||
import retrofit2.http.Path; | ||
import retrofit2.http.Query; | ||
import rx.Observable; | ||
|
||
/** | ||
* Created by Zubin on 2016/9/19. | ||
*/ | ||
public interface WebApi { | ||
|
||
/** | ||
* 获取用户的动画,游戏,图书等状态 | ||
* @param category anime 动画 game 游戏 book 图书 | ||
* @param userId 用户登录后的id | ||
* @param type wish 想看 collect 看过 do在看 on_hold搁置 dropped 抛弃 | ||
* @param page 页数 | ||
* @return | ||
*/ | ||
@GET("{category}/list/{userId}/{type}") | ||
Observable<String> listCollection(@Path("category") String category, | ||
@Path("userId") int userId, @Path("type") String type, | ||
@Query("page") int page); | ||
|
||
/** | ||
* 网页条目搜索 | ||
* @param keyword 关键词 | ||
* @param category 分类,默认为 all 全部 ;1为书籍; 2为动画 ;3为音乐;4为游戏;6为三次元 | ||
* @param page 页数 | ||
* @return | ||
*/ | ||
@GET("subject_search/{keyword}") | ||
Observable<String> searchItem(@Path("keyword") String keyword, | ||
@Query("cat") String category, @Query("page") int page); | ||
|
||
|
||
/** | ||
* 网页人物搜索 | ||
* @param keyword 关键词 | ||
* @param category 分类, 默认 all,全部;crt 虚拟角色;prsn 现实人物 | ||
* @param page 页数 | ||
* @return | ||
*/ | ||
@GET("mono_search/{keyword}") | ||
Observable<String> searchPerson(@Path("keyword") String keyword, | ||
@Query("cat") String category, @Query("page") int page); | ||
} |
42 changes: 6 additions & 36 deletions
42
app/src/main/java/me/ewriter/bangumitv/api/response/BaseResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,16 @@ | ||
package me.ewriter.bangumitv.api.response; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* Created by Zubin on 2016/7/25. | ||
* Created by Zubin on 2016/9/19. | ||
*/ | ||
public class BaseResponse { | ||
private String html; | ||
|
||
/** | ||
* request : /ep/638069/status/remove?source=onAir | ||
* code : 200 | ||
* error : OK | ||
*/ | ||
|
||
@SerializedName("request") | ||
private String request; | ||
@SerializedName("code") | ||
private int code; | ||
@SerializedName("error") | ||
private String error; | ||
|
||
public String getRequest() { | ||
return request; | ||
} | ||
|
||
public void setRequest(String request) { | ||
this.request = request; | ||
} | ||
|
||
public int getCode() { | ||
return code; | ||
} | ||
|
||
public void setCode(int code) { | ||
this.code = code; | ||
} | ||
|
||
public String getError() { | ||
return error; | ||
public String getHtml() { | ||
return html; | ||
} | ||
|
||
public void setError(String error) { | ||
this.error = error; | ||
public void setHtml(String html) { | ||
this.html = html; | ||
} | ||
} |
Oops, something went wrong.