修复了聊天数据异常丢失的bug
This commit is contained in:
+13
-11
@@ -5,11 +5,12 @@ import (
|
||||
)
|
||||
|
||||
type ChatMessage struct {
|
||||
UserID string
|
||||
UserName string
|
||||
CreateTx time.Time
|
||||
Type string
|
||||
Text string
|
||||
UserID string // 发言对象
|
||||
UserName string // 发言对象名字
|
||||
TarUserID string // 接收对象
|
||||
CreateTx time.Time
|
||||
Type string
|
||||
Text string
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -17,13 +18,14 @@ const (
|
||||
ChatTypeCard = "CARD" // 工具卡片分享
|
||||
)
|
||||
|
||||
func NewTextChatMsg(user *Users, text string) *ChatMessage {
|
||||
func NewTextChatMsg(user *Users, tarUid string, text string) *ChatMessage {
|
||||
return &ChatMessage{
|
||||
UserID: user.ID,
|
||||
UserName: user.Name,
|
||||
CreateTx: time.Now(),
|
||||
Type: ChatTypeText,
|
||||
Text: text,
|
||||
UserID: user.ID,
|
||||
UserName: user.Name,
|
||||
TarUserID: tarUid,
|
||||
CreateTx: time.Now(),
|
||||
Type: ChatTypeText,
|
||||
Text: text,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user