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.qa.entity.CommunityVideoEntity

class CommunityVideoConverter {

    @TypeConverter
    fun toCommunityVideoString(data: List<CommunityVideoEntity>?): String {
        return data?.toJson() ?: ""
    }

    @TypeConverter
    fun toCommunityVideoEntity(token: String?): List<CommunityVideoEntity> {
        return token?.toObject() ?: arrayListOf()
    }
}