| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- package model
- import (
- "rocommon"
- )
- type AuthCheckMag struct {
- rocommon.UpdateModule
- authHttpList chan interface{}
- }
- func NewAuthCheckMag() *AuthCheckMag {
- mag := &AuthCheckMag{}
- mag.authHttpList = make(chan interface{}, 2000)
- return mag
- }
- func (this *AuthCheckMag) AddCheckList(response interface{}) {
- this.authHttpList <- response
- }
- func (this *AuthCheckMag) Update(ms uint64) {
- for {
- select {
- case msg := <-this.authHttpList:
- switch t := msg.(type) {
- case *SDKQuickLoginAuthCheckResp:
- DoLoginQuickVerifySign(t)
- case *SDKNBLoginAuthCheckResp:
- DoLoginNBSDKVerifySign(t)
- case *SDKUniLoginAuthCheckResp:
- DoLoginUniSDKVerifySign(t)
- case *SDKHwQuickLoginAuthCheckResp:
- DoLoginHwQuickVerifySign(t)
- }
- default:
- return
- }
- }
- }
- // //response of http
- type CommonInfo struct {
- ClintId uint64 //
- GateServiceNode string
- }
- type LoginCheckResponse struct {
- CInfo CommonInfo
- errorCode int32
- platform string
- openId string
- }
- type LoginCheckRequest struct {
- CommonInfo
- }
- // SDK Quick
- type SDKQuickLoginAuthCheckReq struct {
- Token string
- Product_code string
- Uid string //从客户端接口获取到的渠道原始uid,无需任何加工如拼接渠道ID等(openid)
- }
- type SDKQuickLoginAuthCheckResp struct {
- RetCode string
- ClientId uint64
- ServiceId string
- OpenId string
- Platform string
- }
- // SDK NB
- type SDKNBLoginAuthCheckResp struct {
- RetCode string
- ClientId uint64
- ServiceId string
- OpenId string
- Platform string
- }
- // SDK UniSDK
- type SDKUniLoginAuthCheckReq struct {
- KVList map[string]interface{}
- //GameId string `json:"gameid""` //游戏id(手游即游戏代号,小写)
- //HostId int `json:"hostid"` //大于等于0, 游戏服务器id(指游戏划分的区服),如果有则传,没有传0
- //LoginChannel string `json:"login_channel"` //登录渠道( 如用网易sdk登录login_channel=netease,苹果支付pay_chan nel=app_store)
- //AppChannel string `json:"app_channel"` //发行(分发)渠道,支持多级结构,通过UniSDK获取。格式如:netease.gs.123456
- //Platform string `json:"platform"` //平台名
- //Ip string `json:"ip"` //游戏登录时客户端用户ip, 形如255.255.255.255
- //SdkUid string `json:"sdkuid"` //渠道uid,不需要包含域名, 有些渠道的uid中包含有@符号 | wechat_mp_vr渠道传openid
- //SessionId string `json:"sessionid"` //sdk返回的session
- //SDKVersion string `json:"sdk_version"` //接入渠道sdk的版本号,从UniSDK获取
- //Udid string `json:"udid"` //玩家登录的移动设备号,通过UniSDK提供的接口获取
- }
- type SDKUniLoginAuthCheckResp struct {
- Code int `json:"code"` //接口返回码
- SubCode int `json:"subcode"` //接口返回子码
- Status string `json:"status"` //接口调用状态
- UniSDKLoginJson string `json:"unisdk_login_json"`
- RetCode string
- ClientId uint64
- ServiceId string
- OpenId string
- Platform string
- }
- type UniSDKLoginJsonSt struct {
- Aid string `json:"aid"`
- Sdkuid string `json:"sdkUid"`
- Username string `json:"username"`
- AccessToken string `json:"access_token"`
- ExpiresIn string `json:"expires_in"`
- }
- type SDKCheckUserInfo struct {
- Code int `json:"code"`
- Aid string `json:"aid"`
- ExpireTime uint64 `json:"expiretime"`
- LoginChannel string `json:"login_channel"` //登录渠道( 如用网易sdk登录login_channel=netease,苹果支付pay_chan nel=app_store)
- AppChannel string `json:"app_channel"` //发行(分发)渠道,支持多级结构,通过UniSDK获取。格式如:netease.gs.123456
- EnterSN string `json:"enter_sn"`
- }
- // SDK Quick海外
- type SDKHwQuickLoginAuthCheckReq struct {
- Token string
- Product_code string
- Uid string //从客户端接口获取到的渠道原始uid,无需任何加工如拼接渠道ID等(openid)
- }
- type SDKHwQuickLoginAuthCheckResp struct {
- RetCode string
- ClientId uint64
- ServiceId string
- OpenId string
- Platform string
- Status bool `json:"status"`
- Message string `json:"message"`
- Data interface{} `json:"data"`
- Uid string `json:"uid"`
- }
|