package api import ( "omc/core" "omc/core/manage" "omc/core/utils" "github.com/aceld/zinx/ziface" "github.com/aceld/zinx/zlog" "github.com/aceld/zinx/znet" ) var ReqCMCALoginAlarmMsgID uint32 = 11 var ReqCMCALoginAlarmMsgType uint32 = 11 var ReqCMCALoginAlarmMsgName string = "reqCMCALoginAlarm" // reqCMCALoginAlarm CMCA认证方式登录 type ReqCMCALoginAlarm struct { znet.BaseRouter } func (*ReqCMCALoginAlarm) Handle(request ziface.IRequest) { // 获取当前请求的通道 m := manage.GetManager(request.GetConnection().GetName()) if m == nil { zlog.Ins().ErrorF("server internal error") request.GetConnection().SendMsg(ReqLoginAlarmMsgType, core.ResultError(ReqLoginAlarmMsgName, "server internal error", "")) return } uid, err := request.GetConnection().GetProperty("UID") if err != nil { zlog.Ins().ErrorF("GetProperty UID error %s", err) request.GetConnection().Stop() return } // seqNo 32位长度 0-9A-Z seqNo := utils.SeqNo(32) m.SetSeqNo(uid.(string), seqNo) // 发送信息 msgData := map[string]string{ "seqNo": seqNo, } request.GetConnection().SendMsg(ReqCMCALoginAlarmMsgType, core.Result(ReqCMCALoginAlarmMsgName, msgData)) }