package com.adealink.weparty.room.list.data

import com.adealink.frame.network.data.PageReq
import com.adealink.weparty.commonui.recycleview.diffutil.BaseListItemData
import com.adealink.weparty.module.room.data.RoomInfo
import com.google.gson.annotations.GsonNullable
import com.google.gson.annotations.SerializedName

data class RoomListReq(
//    @SerializedName("keyword") val keyword: String?,
    @SerializedName("roomTypes") val roomTypes: List<Int>,
    @SerializedName("page") val page: PageReq
)

data class RoomListRes(
    @SerializedName("list") val list: List<RoomInfo>,
    @GsonNullable
    @SerializedName("next") val next: String?
)

data class RoomListItemData(
    val data: RoomInfo
) : BaseListItemData {
    override fun areContentsTheSame(newItem: Any): Boolean {
        val new = newItem as? RoomListItemData ?: return false
        return data.roomId == new.data.roomId
                && data.roomTitle == new.data.roomTitle
                && data.roomCover == new.data.roomCover
    }
}