新增资源位相关逻辑

This commit is contained in:
huangjian
2021-12-02 18:28:07 +08:00
parent 9b3653c163
commit aa806900f2
5 changed files with 123 additions and 32 deletions

View File

@@ -0,0 +1,10 @@
package com.yizhuan.xchat_android_core.home.bean
data class ResourceInfo(
val icon: String? = null,
val id: Int = 0,
val posSeq: Int? = null,
val resourceContent: String? = null,
val resourceType: Int? = null,
val strategySeq: Int? = null
)

View File

@@ -99,6 +99,16 @@ object HomeModel : BaseModel() {
api.getHotRoom()
}
suspend fun getHomeResource(): List<ResourceInfo>? =
launchRequest {
api.getHomeResource()
}
suspend fun getResourceJumpInfo(id: Int): List<ResourceInfo>? =
launchRequest {
api.getResourceJumpInfo(id)
}
suspend fun getCommonRoom(tabId: Int, pageNum: Int, pageSize: Int): List<HomeRoomInfo>? =
launchRequest {
api.getCommonRoom(tabId, pageNum, pageSize)
@@ -186,6 +196,22 @@ object HomeModel : BaseModel() {
@GET("/home/hotRoom")
suspend fun getHotRoom(): ServiceResult<List<HomeRoomInfo>>
/**
* 首页资源位
*
* @return
*/
@GET("/home/currentResource")
suspend fun getHomeResource(): ServiceResult<List<ResourceInfo>>
/**
* 首页资源位跳转
*
* @return
*/
@GET("/home/pickResource")
suspend fun getResourceJumpInfo(@Query("id") id: Int): ServiceResult<List<ResourceInfo>>
/**
* 首页热门房间
*