package com.gh.common.util

import com.gh.gamecenter.db.GameTrendsDao
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.message.MessageUnreadRepository
import com.halo.assistant.HaloApp

object GameTrendsHelper {
    private val mGameTrendsDao = GameTrendsDao(HaloApp.getInstance().application)

    fun updateReadPostTime() {
        mGameTrendsDao.findGameTrendsInfo(UserManager.getInstance().userId)?.let { trendsInfo ->
            trendsInfo.readPostTime = System.currentTimeMillis()
            mGameTrendsDao.add(trendsInfo)
            MessageUnreadRepository.loadMessageUnreadTotal(true)
        }
    }
}