go_dreamfactory/modules/chat/api_crosschannel.go
2022-07-19 19:35:58 +08:00

32 lines
808 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{}{
"ChatChannel": channel,
})
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ChatCrossChannelResp{ChannelId: channel})
return
}