package com.quansu.heifengwuliu.component

import android.util.Log
import com.billy.cc.core.component.CC
import com.billy.cc.core.component.CCResult
import com.billy.cc.core.component.IComponent
import com.hwangjr.rxbus.RxBus
import com.quansu.heifengwuliu.config.ConfigRx
import com.quansu.heifengwuliu.model.bean.OneLoginBean
import com.ysnows.base.ccextension.BIComponent
import com.ysnows.base.model.PositionBean

open class CpApp() : IComponent, BIComponent() {


     fun setLogin(cc: CC, token: String): Boolean {


         RxBus.get().post(ConfigRx.ADD_ONELOGIN, token)

         CC.sendCCResult(cc.callId, CCResult.success())

        return false
    }
     fun isError(cc: CC, code: Int, msg: String): Boolean {
         val oneLoginBean = OneLoginBean(code, msg)
         RxBus.get().post(ConfigRx.ONELOGIN_ERROR, oneLoginBean)
         CC.sendCCResult(cc.callId, CCResult.success())

         return false
    }
    fun setDatas(cc: CC, item: PositionBean): Boolean{

        var areaname=item.areaname
         Log.e("-shy-", "areaname11=: "+areaname )
        RxBus.get().post(ConfigRx.ADD_POSITION, item)

        CC.sendCCResult(cc.callId, CCResult.success())

        return false
    }

}
