feat: 支持聊天记录存入以及查询的能力 (#158)

This commit is contained in:
二丫讲梵
2023-04-02 20:19:21 +08:00
committed by GitHub
parent 2a5ef877fa
commit b14d6eabcc
15 changed files with 338 additions and 20 deletions

View File

@@ -68,13 +68,22 @@ type At struct {
IsAtAll bool `json:"isAtAll"`
}
// 获取用户标识,兼容当 SenderStaffId 字段为空的场景
func (r ReceiveMsg) GetSenderIdentifier() string {
if r.SenderStaffId != "" {
return r.SenderStaffId
} else {
return r.SenderNick
// 获取用户标识,兼容当 SenderStaffId 字段为空的场景,此处提供给发送消息是艾特使用
func (r ReceiveMsg) GetSenderIdentifier() (uid string) {
uid = r.SenderStaffId
if uid == "" {
uid = r.SenderNick
}
return
}
// GetChatTitle 获取聊天的群名字,如果是私聊,则命名为 昵称_私聊
func (r ReceiveMsg) GetChatTitle() (chatType string) {
chatType = r.ConversationTitle
if chatType == "" {
chatType = r.SenderNick + "_私聊"
}
return
}
// 发消息给钉钉