This commit is contained in:
徐俊杰 2025-06-19 09:50:41 +08:00
parent eaf04ae02d
commit e97bd859fc
2 changed files with 3 additions and 3 deletions

View File

@ -194,8 +194,8 @@ func (o *ChatRoom) Register(c *Client) (sessionId string) {
// message: 消息内容 // message: 消息内容
func (o *ChatRoom) SendSessionMessage(sender *accountFiee.ChatUserData, sessionId string, msgType WsType, message any) (userIdInSession []int64, err error) { func (o *ChatRoom) SendSessionMessage(sender *accountFiee.ChatUserData, sessionId string, msgType WsType, message any) (userIdInSession []int64, err error) {
fmt.Println("ChatRoom.SendSessionMessage ------------------1") fmt.Println("ChatRoom.SendSessionMessage ------------------1")
//o.clientsRwLocker.Lock() o.clientsRwLocker.Lock()
//defer o.clientsRwLocker.Unlock() defer o.clientsRwLocker.Unlock()
var msg = WsSessionInfo{ var msg = WsSessionInfo{
Type: msgType, Type: msgType,
Content: message, Content: message,

View File

@ -99,7 +99,7 @@ func (cr ChatCache) GetChatRecord(sessionId string) (data []*accountFiee.ChatRec
//log.Print("获取聊天记录失败", zap.Error(err)) //log.Print("获取聊天记录失败", zap.Error(err))
return return
} }
fmt.Printf("cache data: %+v", string(messages)) //fmt.Printf("cache data: %+v", string(messages))
if len(messages) > 0 { if len(messages) > 0 {
_ = json.Unmarshal(messages, &data) _ = json.Unmarshal(messages, &data)
} }