package com.yidianling.tests.router

import android.app.Activity
import android.content.Intent
import com.yidianling.router.RouterManager
import com.yidianling.router.im.IMRequestCallback

/**
 * author : Zhangwenchao
 * e-mail : zhangwch@yidianling.com
 * time   : 2018/04/25
 */
object TestsIn {

    fun isLogin(): Boolean {
        return RouterManager.getUserRouter()?.isLogin()?:false
    }

    fun loginWayIntent(activity: Activity): Intent? {
        return RouterManager.getUserRouter()?.loginWayIntent(activity)
    }

    fun publishTrendIntent(activity: Activity, url: String, cover: String, title: String): Intent? {
        return RouterManager.getDynamicRouter()?.publishTrendIntent(activity, url, cover, title)
    }

    fun sendTestResultMessage(uid : String,content : String,title: String?,head : String?,url : String?,id : Int,share_url : String?, callback: IMRequestCallback<Void>) {
        RouterManager.getImRouter().sendTestResultMessage(uid, content, title, head, url, id, share_url, callback)
    }

    /**
     * 跳转红包
     */
    fun myRedPockIntent(activity: Activity){
        activity.startActivity(RouterManager.getAppRouter()?.myRedPockIntent(activity))
    }
}