package com.gh.gamecenter.feedback.provider

import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.entity.SimpleGameEntity
import com.gh.gamecenter.common.entity.SuggestType
import com.gh.gamecenter.common.provider.IHelpAndFeedbackProvider
import com.gh.gamecenter.feedback.view.help.QaFeedbackDialogFragment
import com.gh.gamecenter.feedback.view.suggest.SuggestionActivity

@Route(path = RouteConsts.provider.helpAndFeedback, name = "HelpAndFeedbackActivity暴露服务")
class HelpAndFeedbackProviderImpl : IHelpAndFeedbackProvider {

    override fun startSuggestionActivity(
        context: Context?,
        suggestType: SuggestType?,
        suggestHintType: String?,
        content: String?
    ) {
        SuggestionActivity.startSuggestionActivity(context, suggestType, suggestHintType, content)
    }

    override fun startSuggestionActivity(
        context: Context?,
        suggestType: SuggestType?,
        suggestHintType: String?,
        content: String?,
        isQaFeedback: Boolean,
        qaContentId: String?
    ) {
        SuggestionActivity.startSuggestionActivity(context, suggestType, suggestHintType, content)
    }

    override fun startSuggestionActivity(
        context: Context?,
        suggestType: SuggestType?,
        suggestHintType: String?,
        content: String?,
        game: SimpleGameEntity?
    ) {
        SuggestionActivity.startSuggestionActivity(context, suggestType, suggestHintType, content, game)
    }

    override fun startSuggestionActivity(
        context: Context?,
        suggestType: SuggestType?,
        suggestHintType: String?,
        content: String?,
        game: SimpleGameEntity?,
        gamePlatform: String?
    ) {
        SuggestionActivity.startSuggestionActivity(context, suggestType, suggestHintType, content, game, gamePlatform)
    }

    override fun startSuggestionActivity(context: Context?, suggestType: SuggestType?, hint: String?) {
        SuggestionActivity.startSuggestionActivity(context, suggestType, hint)
    }

    override fun getIntentFromNetworkDiagnosis(context: Context?, diagnosis: String?): Intent? {
        return SuggestionActivity.getIntentFromNetworkDiagnosis(context, diagnosis)
    }

    override fun getIntent(
        context: Context?,
        suggestType: SuggestType?,
        hiddenHint: String?,
        suggestHintType: String?,
        content: String?,
        platform: String?,
        game: SimpleGameEntity?,
        isQaFeedback: Boolean,
        qaContentId: String?,
        fromRatingKey: Boolean,
        diagnosis: String
    ): Intent? {
        return SuggestionActivity.getIntent(
            context,
            suggestType,
            hiddenHint,
            suggestHintType,
            content,
            platform,
            game,
            isQaFeedback,
            qaContentId,
            fromRatingKey,
            diagnosis
        )
    }

    override fun showQaFeedbackDialogFragment(activity: AppCompatActivity, contentId: String) {
        QaFeedbackDialogFragment.show(activity, contentId)
    }

    override fun init(context: Context?) {
        //Do nothing
    }
}