package com.sambath.kunkhmer.remote

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class NewsDetailResponse(
    @Json(name = "code")
    val resultCode: Int,
    @Json(name = "message")
    val message: ResponseMessage,
    @Json(name = "data")
    val data: NewsDetailData?
)

@JsonClass(generateAdapter = true)
data class NewsDetailData(
    @Json(name = "object")
    val obj: NewsDetail,
)

@JsonClass(generateAdapter = true)
data class NewsDetail(
    @Json(name = "viewer")
    val viewer: Int = 0,

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

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

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

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

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

    @Json(name = "__v")
    val _v: Int = 0,

    @Json(name = "file_id")
    val filename: NewsFile? = null
)

@JsonClass(generateAdapter = true)
data class NewsFile(
    @Json(name = "originalname")
    val originalName: String,
    @Json(name = "mimetype")
    val mimetype: String,
    @Json(name = "id")
    val id: String,
    @Json(name = "filename")
    val filename: String,
)