37 lines
944 B
Go
37 lines
944 B
Go
package chat
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) CrossChannelCheck(session comm.IUserSession, req *pb.ChatCrossChannelReq) (errdata *pb.ErrorData) {
|
|
|
|
return
|
|
}
|
|
|
|
///请求跨服聊天频道
|
|
func (this *apiComp) CrossChannel(session comm.IUserSession, req *pb.ChatCrossChannelReq) (errdata *pb.ErrorData) {
|
|
var (
|
|
channel int32
|
|
err error
|
|
)
|
|
if code = this.CrossChannelCheck(session, req); code != pb.ErrorCode_Success {
|
|
return
|
|
}
|
|
if channel, err = this.module.modelChat.addCrossChannelMember(session); err != nil {
|
|
code = pb.ErrorCode_DBError
|
|
data = &pb.ErrorData{
|
|
Title: code.ToString(),
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{
|
|
"chatchannel": channel,
|
|
})
|
|
session.SendMsg(string(this.module.GetType()), "crosschannel", &pb.ChatCrossChannelResp{ChannelId: channel})
|
|
return
|
|
}
|