package com.gh.gamecenter.floatingwindow

import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.utils.NewFlatLogUtils

object LogUtils {

    private const val KEY_EVENT = "event"

    // 右下角悬浮窗用户产生点击行为
    @JvmStatic
    fun logFloatingWindowClicked(
        action: String,
        windowId: String,
        source: String,
        gameId: String,
        gameName: String,
        linkId: String,
        linkType: String,
        linkText: String,
    ) {
        val json = json {
            KEY_EVENT to "suspended_window_click"
            "action" to action
            "suspended_window_id" to windowId
            "game_id" to gameId
            "game_name" to gameName
            "source" to source
            "link_id" to linkId
            "link_type" to linkType
            "link_text" to linkText
            NewFlatLogUtils.parseAndPutMeta().invoke(this)
        }
        NewFlatLogUtils.log(json)
    }

}