🎨 AI对话历史记录数量修改为20条
This commit is contained in:
parent
bc3622464f
commit
f3e2f6e429
@ -19,8 +19,12 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 已经通知过的群组或者好友map
|
||||||
var notifyMap = make(map[string]bool)
|
var notifyMap = make(map[string]bool)
|
||||||
|
|
||||||
|
// 拉取最近消息条数
|
||||||
|
const fetchMessageCount = 20
|
||||||
|
|
||||||
// AI
|
// AI
|
||||||
// @description: AI消息
|
// @description: AI消息
|
||||||
// @param m
|
// @param m
|
||||||
@ -198,7 +202,7 @@ func getGroupUserMessages(msgId int64, groupId, groupUserId string) (records []e
|
|||||||
Where("create_at >= DATE_SUB(NOW(),INTERVAL 30 MINUTE)").
|
Where("create_at >= DATE_SUB(NOW(),INTERVAL 30 MINUTE)").
|
||||||
Where(subQuery).
|
Where(subQuery).
|
||||||
Order("create_at desc").
|
Order("create_at desc").
|
||||||
Limit(4).Find(&records)
|
Limit(fetchMessageCount).Find(&records)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,6 +218,6 @@ func getUserPrivateMessages(userId string) (records []entity.Message) {
|
|||||||
Where("create_at >= DATE_SUB(NOW(),INTERVAL 30 MINUTE)").
|
Where("create_at >= DATE_SUB(NOW(),INTERVAL 30 MINUTE)").
|
||||||
Where(subQuery).
|
Where(subQuery).
|
||||||
Order("create_at desc").
|
Order("create_at desc").
|
||||||
Limit(4).Find(&records)
|
Limit(fetchMessageCount).Find(&records)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user