package com.remax.visualnovel.entity.response

import android.os.Parcelable
import com.remax.visualnovel.constant.LockTypeConstant
import com.remax.visualnovel.entity.model.base.BasePhoto
import com.remax.visualnovel.manager.login.LoginManager
import kotlinx.parcelize.Parcelize

/**
 * Created by HJW on 2025/7/14
 */
@Parcelize
data class Album(
    val albumId: Long,
    var userId: String?,
    var aiId: String?,
    var imgUrl: String?,
    var img1: String?,
    var img2: String?,
    var img3: String?,
    var likedStatus: String?,
    var likedCount: Long,
    var width: Long,
    var height: Long,
    var unlockPrice: Long?,
    val imgOrder: Int,
    var lockStatus: String?,
    var isDefault: Boolean?
) : BasePhoto(), Parcelable {

    fun isLike() = LIKED == likedStatus

    /**
     * 该图片是否解锁
     */
    fun isUnLock() = LoginManager.isMyself(userId) || LockTypeConstant.isUnLock(lockStatus)

    /**
     * 该图片是否上锁
     */
    fun isOpen() = (unlockPrice ?: 0L) <= 0L

    override fun paramId(): Long = albumId

    companion object {
        const val CANCELED: String = "CANCELED"
        const val LIKED: String = "LIKED"

    }
}
