直播任务对接接口
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveTaskModel extends BaseModel {
|
||||
public static final int TASK_TYPE_TIP=0;
|
||||
public static final int TASK_TYPE_ITEM=1;
|
||||
public static final int TASK_TYPE_TIP = 0;
|
||||
public static final int TASK_TYPE_ITEM = 1;
|
||||
|
||||
int type;
|
||||
String title;
|
||||
int hot;
|
||||
int xp;
|
||||
int taskTarget;
|
||||
int task;
|
||||
boolean complete;
|
||||
@SerializedName("new")
|
||||
NewUser user;
|
||||
@SerializedName("list")
|
||||
List<List<Task>> list;
|
||||
|
||||
public LiveTaskModel() {
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
@@ -21,51 +27,205 @@ public class LiveTaskModel extends BaseModel {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
public NewUser getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
public void setUser(NewUser user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public int getHot() {
|
||||
return hot;
|
||||
public List<List<Task>> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setHot(int hot) {
|
||||
this.hot = hot;
|
||||
public void setList(List<List<Task>> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public int getXp() {
|
||||
return xp;
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LiveTaskModel{" +
|
||||
"type=" + type +
|
||||
", user=" + user +
|
||||
", list=" + list +
|
||||
'}';
|
||||
}
|
||||
|
||||
public void setXp(int xp) {
|
||||
this.xp = xp;
|
||||
public static class NewUser {
|
||||
@SerializedName("isNew")
|
||||
private int isNew;
|
||||
@SerializedName("endTime")
|
||||
private String endTime;
|
||||
|
||||
public NewUser() {
|
||||
}
|
||||
|
||||
public boolean isNew() {
|
||||
return isNew == 1;
|
||||
}
|
||||
|
||||
public void setNew(int aNew) {
|
||||
isNew = aNew;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NewUser{" +
|
||||
"isNew=" + isNew +
|
||||
", endTime='" + endTime + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
public int getTaskTarget() {
|
||||
return taskTarget;
|
||||
}
|
||||
public static class Task implements Serializable {
|
||||
@SerializedName("id")
|
||||
private int id;
|
||||
@SerializedName("type")
|
||||
private int type;
|
||||
@SerializedName("task_type")
|
||||
private int taskType;
|
||||
@SerializedName("task_name")
|
||||
private String taskName;
|
||||
@SerializedName("task_num")
|
||||
private int taskNum;
|
||||
@SerializedName("hot")
|
||||
private long hot;
|
||||
@SerializedName("exp")
|
||||
private long exp;
|
||||
@SerializedName("new_hot")
|
||||
private long newUserHot;
|
||||
@SerializedName("new_exp")
|
||||
private long newUserExp;
|
||||
@SerializedName("sort")
|
||||
private int sort;
|
||||
@SerializedName("status")
|
||||
private int status;
|
||||
|
||||
public void setTaskTarget(int taskTarget) {
|
||||
this.taskTarget = taskTarget;
|
||||
}
|
||||
private int nowValue;
|
||||
|
||||
public int getTask() {
|
||||
return task;
|
||||
}
|
||||
public Task() {
|
||||
}
|
||||
|
||||
public void setTask(int task) {
|
||||
this.task = task;
|
||||
}
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public boolean isComplete() {
|
||||
return complete;
|
||||
}
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setComplete(boolean complete) {
|
||||
this.complete = complete;
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getTaskType() {
|
||||
return taskType;
|
||||
}
|
||||
|
||||
public void setTaskType(int taskType) {
|
||||
this.taskType = taskType;
|
||||
}
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
}
|
||||
|
||||
public void setTaskName(String taskName) {
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public int getTaskNum() {
|
||||
return taskNum;
|
||||
}
|
||||
|
||||
public void setTaskNum(int taskNum) {
|
||||
this.taskNum = taskNum;
|
||||
}
|
||||
|
||||
public long getHot() {
|
||||
return hot;
|
||||
}
|
||||
|
||||
public void setHot(long hot) {
|
||||
this.hot = hot;
|
||||
}
|
||||
|
||||
public long getExp() {
|
||||
return exp;
|
||||
}
|
||||
|
||||
public void setExp(long exp) {
|
||||
this.exp = exp;
|
||||
}
|
||||
|
||||
public long getNewUserHot() {
|
||||
return newUserHot;
|
||||
}
|
||||
|
||||
public void setNewUserHot(long newUserHot) {
|
||||
this.newUserHot = newUserHot;
|
||||
}
|
||||
|
||||
public long getNewUserExp() {
|
||||
return newUserExp;
|
||||
}
|
||||
|
||||
public void setNewUserExp(long newUserExp) {
|
||||
this.newUserExp = newUserExp;
|
||||
}
|
||||
|
||||
public int getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(int sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public boolean getStatus() {
|
||||
return status==1;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getNowValue() {
|
||||
return nowValue;
|
||||
}
|
||||
|
||||
public void setNowValue(int nowValue) {
|
||||
this.nowValue = nowValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Task{" +
|
||||
"id=" + id +
|
||||
", type=" + type +
|
||||
", taskType=" + taskType +
|
||||
", taskName='" + taskName + '\'' +
|
||||
", taskNum=" + taskNum +
|
||||
", hot=" + hot +
|
||||
", exp=" + exp +
|
||||
", newUserHot=" + newUserHot +
|
||||
", newUserExp=" + newUserExp +
|
||||
", sort=" + sort +
|
||||
", status=" + status +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
import com.yunbao.common.bean.LiveTaskModel;
|
||||
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||
import com.yunbao.common.bean.NewPeopleInfo;
|
||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
@@ -548,4 +549,13 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<List<ListInfoMessageModel>>> getListInfo(
|
||||
@Query("type") String type,
|
||||
@Query("p") int p);
|
||||
|
||||
/**
|
||||
* 获取主播任务列表
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getLiveTaskStatus")
|
||||
Observable<ResponseModel<LiveTaskModel>> getLiveTaskList(
|
||||
@Query("type") int type,
|
||||
@Query("liveuid") String liveUid
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
import com.yunbao.common.bean.LiveTaskModel;
|
||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
@@ -1088,6 +1089,22 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取直播任务
|
||||
* @param type 1 直播任务 2粉丝任务
|
||||
*/
|
||||
public void getLiveTask(int type, String liveUid, HttpCallback<LiveTaskModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getLiveTaskList(type, liveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}, throwable -> {
|
||||
callback.onError(throwable.getMessage());
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user