增加 获取小电视抽奖结果 的 API

This commit is contained in:
czp 2018-03-13 10:52:46 +08:00
parent c8a7dc03c7
commit dc39fb07d6
5 changed files with 188 additions and 15 deletions

View File

@ -1,5 +1,5 @@
group = 'com.hiczp'
version = '0.0.9'
version = '0.0.10'
description = 'Bilibili android client API library written in Java'
apply plugin: 'idea'

View File

@ -49,10 +49,19 @@ public interface LiveService {
//参与小电视抽奖
//房间号必须与小电视号对应
//目标小电视不存在时(房间号与小电视号不匹配时也视为不存在)返回 -400 "不存在小电视信息"
//SYS_MSG 里面取得的小电视编号是一个字符串, 实际上它肯定是一个数字
@POST("AppSmallTV/join")
Call<JoinAppSmallTVResponseEntity> joinAppSmallTV(@Query("roomid") long roomId, @Query("id") long tvId);
Call<JoinAppSmallTVResponseEntity> joinAppSmallTV(@Query("roomid") long roomId, @Query("id") String tvId);
//TODO 查看小电视抽奖结果
//通过 getAppSmallTV 取得的小电视编号是一个数字
default Call<JoinAppSmallTVResponseEntity> joinAppSmallTV(long roomId, long tvId) {
return joinAppSmallTV(roomId, String.valueOf(tvId));
}
//获得小电视抽奖结果(不访问这个 API, 奖励也会自动进入背包)
//其中的 status 0 , 表示返回正常开奖结果, 1 为没有参与抽奖或小电视已过期, 2 为正在开奖过程中.
@GET("AppSmallTV/getReward")
Call<GetAppSmallTVRewardResponseEntity> getAppSmallTVReward(@Query("id") long tvId);
//获得所有头衔的列表
//这里的 Title 是头衔的意思

View File

@ -61,17 +61,17 @@ public class AppSmallTVEntity {
*/
@SerializedName("lastid")
private int lastid;
private long lastid;
@SerializedName("join")
private List<Join> join;
@SerializedName("unjoin")
private List<Unjoin> unjoin;
public int getLastid() {
public long getLastid() {
return lastid;
}
public void setLastid(int lastid) {
public void setLastid(long lastid) {
this.lastid = lastid;
}
@ -98,15 +98,15 @@ public class AppSmallTVEntity {
*/
@SerializedName("id")
private int id;
private long id;
@SerializedName("dtime")
private int dtime;
public int getId() {
public long getId() {
return id;
}
public void setId(int id) {
public void setId(long id) {
this.id = id;
}
@ -126,15 +126,15 @@ public class AppSmallTVEntity {
*/
@SerializedName("id")
private int id;
private long id;
@SerializedName("dtime")
private int dtime;
public int getId() {
public long getId() {
return id;
}
public void setId(int id) {
public void setId(long id) {
this.id = id;
}

View File

@ -0,0 +1,164 @@
package com.hiczp.bilibili.api.live.entity;
import com.google.gson.annotations.SerializedName;
public class GetAppSmallTVRewardResponseEntity {
/**
* code : 0
* msg : ok
* message : ok
* data : {"fname":"","sname":"麦麦0w0","win":0,"reward":{"id":7,"num":2,"name":"辣条","url":"http://s1.hdslb.com/bfs/static/blive/live-assets/mobile/gift/mobilegift-static-icon/gift-1.png?20171118161652"},"status":0}
*/
@SerializedName("code")
private int code;
@SerializedName("msg")
private String msg;
@SerializedName("message")
private String message;
@SerializedName("data")
private Data data;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Data getData() {
return data;
}
public void setData(Data data) {
this.data = data;
}
public static class Data {
/**
* fname :
* sname : 麦麦0w0
* win : 0
* reward : {"id":7,"num":2,"name":"辣条","url":"http://s1.hdslb.com/bfs/static/blive/live-assets/mobile/gift/mobilegift-static-icon/gift-1.png?20171118161652"}
* status : 0
*/
@SerializedName("fname")
private String fname;
@SerializedName("sname")
private String sname;
@SerializedName("win")
private int win;
@SerializedName("reward")
private Reward reward;
@SerializedName("status")
private int status;
public String getFname() {
return fname;
}
public void setFname(String fname) {
this.fname = fname;
}
public String getSname() {
return sname;
}
public void setSname(String sname) {
this.sname = sname;
}
public int getWin() {
return win;
}
public void setWin(int win) {
this.win = win;
}
public Reward getReward() {
return reward;
}
public void setReward(Reward reward) {
this.reward = reward;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public static class Reward {
/**
* id : 7
* num : 2
* name : 辣条
* url : http://s1.hdslb.com/bfs/static/blive/live-assets/mobile/gift/mobilegift-static-icon/gift-1.png?20171118161652
*/
@SerializedName("id")
private int id;
@SerializedName("num")
private int num;
@SerializedName("name")
private String name;
@SerializedName("url")
private String url;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
}
}

View File

@ -59,17 +59,17 @@ public class JoinAppSmallTVResponseEntity {
*/
@SerializedName("id")
private int id;
private long id;
@SerializedName("dtime")
private int dtime;
@SerializedName("status")
private int status;
public int getId() {
public long getId() {
return id;
}
public void setId(int id) {
public void setId(long id) {
this.id = id;
}