32 lines
813 B
Go
32 lines
813 B
Go
package chat
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) CrossChannelCheck(session comm.IUserSession, req *pb.ChatCrossChannelReq) (code pb.ErrorCode) {
|
|
|
|
return
|
|
}
|
|
|
|
///请求跨服聊天频道
|
|
func (this *apiComp) CrossChannel(session comm.IUserSession, req *pb.ChatCrossChannelReq) (code pb.ErrorCode, data proto.Message) {
|
|
var (
|
|
channel int32
|
|
err error
|
|
)
|
|
if channel, err = this.module.modelChat.AddCrossChannelMember(session); err != nil {
|
|
code = pb.ErrorCode_DBError
|
|
return
|
|
}
|
|
this.module.modelChat.ChanageUserExpand(session.GetUserId(), map[string]interface{}{
|
|
"catchannel": channel,
|
|
})
|
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ChatCrossChannelResp{ChannelId: channel})
|
|
return
|
|
}
|