package com.gh.gamecenter.room.converter

import androidx.room.TypeConverter
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.common.utils.toObject
import com.gh.gamecenter.entity.VideoInfo

class VideoInfoConverter {
    @TypeConverter
    fun toVideoInfoString(data: VideoInfo?): String {
        return data?.toJson() ?: ""
    }

    @TypeConverter
    fun toVideoInfo(token: String?): VideoInfo {
        return token?.toObject() ?: VideoInfo()
    }
}
