feat:完成房间-游戏切换入口调整需求
This commit is contained in:
@@ -20,24 +20,37 @@ object GameModel : BaseModel() {
|
||||
.compose(RxHelper.handleSchAndExce())
|
||||
}
|
||||
|
||||
fun getGameList(): Single<List<GameInfo>> {
|
||||
return api.getGameList()
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchAndExce())
|
||||
fun getGameList(roomUid: Long?): Single<List<GameInfo>> {
|
||||
if (roomUid == null) {
|
||||
return api.getGameList()
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchAndExce())
|
||||
} else {
|
||||
return api.getGameList(roomUid)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchAndExce())
|
||||
}
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@POST("/miniGame/record/miniGameList")
|
||||
fun getGameList(
|
||||
): Single<ServiceResult<List<GameInfo>>>
|
||||
|
||||
/**
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/miniGame/record/miniGameList")
|
||||
fun getGameList(
|
||||
@Field("roomUid") uid: Long
|
||||
): Single<ServiceResult<List<GameInfo>>>
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
Reference in New Issue
Block a user