贵族迭代:支持钻石开通,首充优惠,贵族排行榜
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.mango.core.bean.response;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@@ -7,76 +9,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class ServiceResult<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1954065564856833013L;
|
||||
|
||||
public static final int SC_SUCCESS = 200;
|
||||
|
||||
private int code = -1;
|
||||
|
||||
private String message = "";
|
||||
|
||||
private T data;
|
||||
|
||||
private long timestamp;
|
||||
|
||||
public ServiceResult() {
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return this.code == SC_SUCCESS;
|
||||
}
|
||||
|
||||
public static <T> ServiceResult<T> success(T data) {
|
||||
return success(data, "");
|
||||
}
|
||||
|
||||
public static <T> ServiceResult<T> success(T data, String message) {
|
||||
ServiceResult<T> result = new ServiceResult<T>();
|
||||
result.setCodeSuccess().setMessage(message).setData(data);
|
||||
return result;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public ServiceResult<T> setCode(int code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ServiceResult<T> setCodeSuccess() {
|
||||
this.code = SC_SUCCESS;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public ServiceResult<T> setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public ServiceResult<T> setData(T data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(long timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public static final int SUCCESS = 200;//成功
|
||||
public static final int INVALID_SERVICE = 199;//服务不可用
|
||||
public static final int SERVEXCEPTION = 5000;//服务端异常
|
||||
@@ -93,11 +26,74 @@ public class ServiceResult<T> implements Serializable {
|
||||
public static final int SMSCODEERROR = 4003;//短信验证码错误
|
||||
public static final int WEEKNOTWITHCASHTOWNUMS = 1600;//每周提现俩次
|
||||
public static final int CODE_NEED_COMPLETE_USER_INFO = 1415;//每周提现俩次
|
||||
|
||||
/** 没有网络 */
|
||||
/**
|
||||
* 没有网络
|
||||
*/
|
||||
public static final int NOT_NET = 50010;
|
||||
public static final int OTHER = 50011;
|
||||
private static final long serialVersionUID = -1954065564856833013L;
|
||||
private int code = -1;
|
||||
private String message = "";
|
||||
@Nullable
|
||||
private T data;
|
||||
private long timestamp;
|
||||
public ServiceResult() {
|
||||
}
|
||||
|
||||
public static <T> ServiceResult<T> success(T data) {
|
||||
return success(data, "");
|
||||
}
|
||||
|
||||
public static <T> ServiceResult<T> success(T data, String message) {
|
||||
ServiceResult<T> result = new ServiceResult<T>();
|
||||
result.setCodeSuccess().setMessage(message).setData(data);
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return this.code == SC_SUCCESS;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public ServiceResult<T> setCode(int code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ServiceResult<T> setCodeSuccess() {
|
||||
this.code = SC_SUCCESS;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public ServiceResult<T> setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public ServiceResult<T> setData(@Nullable T data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(long timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public String getErrorMessage() {
|
||||
String errorStr = "服务器正在维护";
|
||||
|
@@ -23,23 +23,8 @@ public class ChargeBean implements Serializable{
|
||||
public int giftGoldNum;
|
||||
public int channel;
|
||||
public String prodDesc;
|
||||
|
||||
public boolean isSelected;
|
||||
|
||||
|
||||
public ChargeBean(int money) {
|
||||
this.money = money;
|
||||
}
|
||||
// public int seqNo;
|
||||
//
|
||||
//
|
||||
// public int getSeqNo() {
|
||||
// return seqNo;
|
||||
// }
|
||||
//
|
||||
// public void setSeqNo(int seqNo) {
|
||||
// this.seqNo = seqNo;
|
||||
// }
|
||||
private String oriPrice;
|
||||
|
||||
|
||||
public String getChargeProdId() {
|
||||
@@ -82,6 +67,14 @@ public class ChargeBean implements Serializable{
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public String getOriPrice() {
|
||||
return oriPrice;
|
||||
}
|
||||
|
||||
public void setOriPrice(String oriPrice) {
|
||||
this.oriPrice = oriPrice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ChargeBean{" +
|
||||
|
@@ -3,9 +3,11 @@ package com.mango.core.vip
|
||||
import com.mango.core.base.BaseModel
|
||||
import com.mango.core.bean.response.ServiceResult
|
||||
import com.mango.core.manager.AvRoomDataManager
|
||||
import com.mango.core.pay.bean.ChargeBean
|
||||
import com.mango.core.utils.net.launchRequest
|
||||
import com.mango.xchat_android_library.net.rxnet.RxNet
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.Query
|
||||
|
||||
object VipModel : BaseModel() {
|
||||
@@ -37,6 +39,25 @@ object VipModel : BaseModel() {
|
||||
api.changeInvisibleInRoom(open)
|
||||
}
|
||||
|
||||
suspend fun getVipRank(): VipRankInfo? =
|
||||
launchRequest {
|
||||
api.getVipRank()
|
||||
}
|
||||
|
||||
suspend fun getVipRankBanner(): List<VipMessageInfo>? =
|
||||
launchRequest {
|
||||
api.getVipRankBanner()
|
||||
}
|
||||
|
||||
suspend fun openVipWithDiamond(): Any? =
|
||||
launchRequest {
|
||||
api.openVipWithDiamond()
|
||||
}
|
||||
|
||||
suspend fun getOpenVipProd(): ChargeBean? =
|
||||
launchRequest {
|
||||
api.getOpenVipProd()
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
|
||||
@@ -83,6 +104,38 @@ object VipModel : BaseModel() {
|
||||
*/
|
||||
@GET("/vip/changeInvisibleInRoom")
|
||||
suspend fun changeInvisibleInRoom(@Query("open") open: Boolean): ServiceResult<String>
|
||||
|
||||
/**
|
||||
* 获取贵族排行榜信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/vip/listRank")
|
||||
suspend fun getVipRank(): ServiceResult<VipRankInfo>
|
||||
|
||||
/**
|
||||
* 获取贵族升级的轮播列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/vip/listUpgrade")
|
||||
suspend fun getVipRankBanner(): ServiceResult<List<VipMessageInfo>>
|
||||
|
||||
/**
|
||||
* 使用钻石开通贵族
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST("/vip/openWithDiamond")
|
||||
suspend fun openVipWithDiamond(): ServiceResult<Any>
|
||||
|
||||
/**
|
||||
* 获取开通贵族产品
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/vip/getOpenVipProd")
|
||||
suspend fun getOpenVipProd(): ServiceResult<ChargeBean>
|
||||
}
|
||||
|
||||
}
|
16
core/src/main/java/com/mango/core/vip/VipRankInfo.kt
Normal file
16
core/src/main/java/com/mango/core/vip/VipRankInfo.kt
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.mango.core.vip
|
||||
|
||||
data class VipRankInfo(
|
||||
val myRank: RankInfo? = null,
|
||||
val ranks: List<RankInfo>? = null,
|
||||
)
|
||||
|
||||
data class RankInfo(
|
||||
val uid: Long? = null,
|
||||
val erbanNo: Long? = null,
|
||||
val nick: String? = null,
|
||||
val avatar: String? = null,
|
||||
val vipLogo: String? = null,
|
||||
val score: Long? = null,
|
||||
val rankNo: Int? = null
|
||||
)
|
Reference in New Issue
Block a user