refactor: user cache logic

This commit is contained in:
CalciumIon
2024-12-29 16:50:26 +08:00
parent 837804927d
commit 966cdc1f7f
20 changed files with 548 additions and 225 deletions
+2 -2
View File
@@ -81,7 +81,7 @@ func RecordLog(userId int, logType int, content string) {
if logType == LogTypeConsume && !common.LogConsumeEnabled {
return
}
username, _ := CacheGetUsername(userId)
username, _ := GetUsernameById(userId, false)
log := &Log{
UserId: userId,
Username: username,
@@ -102,7 +102,7 @@ func RecordConsumeLog(ctx context.Context, userId int, channelId int, promptToke
if !common.LogConsumeEnabled {
return
}
username, _ := CacheGetUsername(userId)
username, _ := GetUsernameById(userId, false)
otherStr := common.MapToJsonStr(other)
log := &Log{
UserId: userId,