package com.gh.gamecenter.room.converter

import androidx.room.TypeConverter
import com.gh.gamecenter.core.utils.GsonUtils
import com.gh.gamecenter.feature.entity.MeEntity

class MeConverter {
    @TypeConverter
    fun toMeString(data: MeEntity?): String {
        return GsonUtils.toJson(data)
    }

    @TypeConverter
    fun toMe(token: String?): MeEntity {
        return GsonUtils.gson.fromJson(token, MeEntity::class.java) ?: MeEntity()
    }
}