资源位点击处理

This commit is contained in:
huangjian
2021-12-14 18:59:05 +08:00
parent 3024b050f8
commit 258b87f1b7
12 changed files with 182 additions and 20 deletions

View File

@@ -2,12 +2,13 @@ package com.yizhuan.xchat_android_core.home.bean;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
@Data
public class HomeRoomInfo implements MultiItemEntity {
public class HomeRoomInfo implements MultiItemEntity, Serializable {
public static final int TYPE_ROOM = 1;
public static final int TYPE_BANNER = 2;
@@ -40,6 +41,9 @@ public class HomeRoomInfo implements MultiItemEntity {
private int roomOnlineNum;
private String roomAvatar;
private String failContext;
private boolean isPick;
@Override
public int getItemType() {
return isBanner ? TYPE_BANNER : TYPE_ROOM;

View File

@@ -5,6 +5,6 @@ data class ResourceInfo(
val id: Int = 0,
val posSeq: Int? = null,
val resourceContent: String? = null,
val resourceType: Int? = null,
val resourceType: Int = 0,
val strategySeq: Int? = null
)

View File

@@ -119,7 +119,7 @@ object HomeModel : BaseModel() {
api.getHomeResource()
}
suspend fun getResourceJumpInfo(id: Int): List<ResourceInfo>? =
suspend fun getResourceJumpInfo(id: Int): HomeRoomInfo? =
launchRequest {
api.getResourceJumpInfo(id)
}
@@ -248,7 +248,7 @@ object HomeModel : BaseModel() {
* @return
*/
@GET("/home/pickResource")
suspend fun getResourceJumpInfo(@Query("id") id: Int): ServiceResult<List<ResourceInfo>>
suspend fun getResourceJumpInfo(@Query("id") id: Int): ServiceResult<HomeRoomInfo>
/**
* 首页热门房间