package msg import "leafstalk/covenant/model" // GetChatInfo 获取聊天数据 type GetChatInfo struct { PlayerId int64 `json:"userId"` } type ResponseGetChatInfo struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *GetChatInfoData `json:"data"` } type GetChatInfoData struct { ChatFrames map[int64]struct{} `json:"chatFrams"` // 聊天框 WearFrame int64 `json:"wearFrame"` //当前聊天框Id } // // EmojiUnlock 表情解锁 // type EmojiUnlock struct { // PlayerId int64 `json:"userId"` // EmojiId int64 `json:"emojiId"` //表情Id // } // type EmojiUnlockData struct { // EmojiId int64 `json:"emojiId"` //表情Id // Cost map[int64]int64 `json:"cost"` //消耗 // } // type ResponseEmojiUnlock struct { // ErrCode int `json:"errCode"` // Msg string `json:"msg,omitempty"` // Data *EmojiUnlockData `json:"data"` // } // // 材料消耗 // type EmojiUnlockIs struct { // PlayerId int64 `json:"playerId"` // Cost map[int64]int64 `json:"cost"` //消耗 // } // SendChat 发送聊天 type SendChat struct { PlayerId int64 `json:"userId"` ChatInfo *model.ChatContent `json:"sendChatInfo"` //新聊天信息 } // 聊天数据 // type SendChatData struct { // NewChat *model.ChatContent `json:"newChat"` // 一条新的聊天内容 // } type ResponseSendChat struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *model.ChatContent `json:"data"` } type NewChatNotify struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *model.ChatContent `json:"data"` } // GetChatChannel 获取频道聊天 type GetChatChannel struct { PlayerId int64 `json:"userId"` ChatType string `json:"chatType"` // 聊天类型 ReceiverId int64 `json:"receiverId"` // 接收者Id(私聊) CreateTime int64 `json:"createTime"` // 0: 表示全部; 大于0:表示最后一条消息时间(毫秒) } // type ChannelInfoShow struct { // ChatType string `json:"chatType"` // 聊天类型 // Content []*model.ChatContent `json:"content"` // 频道内容 // } type ResponseGetChatChannel struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *ChatChannelData `json:"data"` } type ChatChannelData struct { ChatType string `json:"chatType"` // 聊天类型 ReceiverId int64 `json:"receiverId"` // 接收者Id(私聊) Contents []*model.ChatContent `json:"content"` // 频道内容 } // DelPrivateChannel 删除私聊 type DelPrivateChannel struct { PlayerId int64 `json:"userId"` ReceiverId int64 `json:"receiverId"` } type ResponseDelPrivateChannel struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data int64 `json:"data"` } // GetChatFriends 获取私聊好友列表 type GetChatFriends struct { PlayerId int64 `json:"userId"` } type ResponseGetChatFriends struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data map[int64]*ChatFriend `json:"data"` } type ChatFriend struct { PlayerId int64 `json:"userId"` Name string `json:"name"` HeadId int64 `json:"headId"` FrameId int64 `json:"frameId"` Level int64 `json:"level"` LastMsgTime int64 `json:"lastMsgTime"` // 最后一条消息的产生时间 } type ChatFriendList []*ChatFriend func (m ChatFriendList) Len() int { return len(m) } func (m ChatFriendList) Swap(i, j int) { m[i], m[j] = m[j], m[i] } func (m ChatFriendList) Less(i, j int) bool { return m[i].LastMsgTime > m[j].LastMsgTime } // 选择聊天框 type SelectChatFrame struct { PlayerId int64 `json:"userId"` FrameId int64 `json:"frameId"` //聊天框Id } type ResponseSelectChatFrame struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data int64 `json:"data"` }