package com.khmer9.yuki.remote

import com.gdtlib.lib.adapter.BaseListItem
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class MainModuleResponse(
    @Json(name = "code")
    val resultCode: String,

    @Json(name = "message")
    val message: MainModuleMessage,

    @Json(name = "data")
    val data: List<ModuleData>?
)

@JsonClass(generateAdapter = true)
data class MainModuleMessage(
    @Json(name = "code")
    val code: String,

    @Json(name = "descriptions")
    val description: String
)

@JsonClass(generateAdapter = true)
data class ModuleData(
    @Json(name = "_id")
    val id: String,

    @Json(name = "name")
    val name: String,

    @Json(name = "desc")
    val desc: String,

    @Json(name = "large_icon")
    val largeIcon: String,

    @Json(name = "small_icon")
    val smallIcon: String,

    @Json(name = "background_icon")
    val backgroundIcon: String,

    @Json(name = "app_id")
    val appId: String,

    @Json(name = "front_player_link")
    val frontPlayerLink: String,

    @Json(name = "number_of_sub")
    val numberSub: Int,

    @Json(name = "order")
    val order: Int,
) : BaseListItem() {
    override fun getUnique(): String = id
}