package chat import ( "go_dreamfactory/comm" "go_dreamfactory/pb" "google.golang.org/protobuf/proto" ) //参数校验 func (this *apiComp) ChanageChannelCheck(session comm.IUserSession, req *pb.ChatChanageChannelReq) (code pb.ErrorCode) { return } ///改变跨服聊天频道 func (this *apiComp) ChanageChannel(session comm.IUserSession, req *pb.ChatChanageChannelReq) (code pb.ErrorCode, data proto.Message) { var ( err error ok bool ) if err, ok = this.module.modelChat.ChanageChannel(session, req.ChannelId); err != nil { code = pb.ErrorCode_DBError return } if ok { if err = this.module.modelChat.RemoveCrossChannelMember(session); err != nil { code = pb.ErrorCode_DBError return } this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{ "chatchannel": req.ChannelId, }) } session.SendMsg(string(this.module.GetType()), "chanagechannel", &pb.ChatChanageChannelResp{ChannelId: req.ChannelId, IsSucc: ok}) return }