sync: soul-api 接口逻辑、soul-api 后端 | 原因: 后端接口逻辑修改、后端代码修改

This commit is contained in:
卡若
2026-03-09 04:57:05 +08:00
parent d236c2590f
commit 13e6c21953
2 changed files with 147 additions and 0 deletions

View File

@@ -125,9 +125,18 @@ func DBBookAction(c *gin.Context) {
id string
total float64
}
overrideMap := make(map[string]float64)
for _, r := range rows {
if r.HotScoreOverride != nil && *r.HotScoreOverride > 0 {
overrideMap[r.ID] = *r.HotScoreOverride
}
}
totals := make([]idTotal, 0, len(rows))
for _, r := range rows {
t := readWeight*readScore[r.ID] + recencyWeight*recencyScore[r.ID] + payWeight*payScore[r.ID]
if v, ok := overrideMap[r.ID]; ok {
t = v
}
totals = append(totals, idTotal{r.ID, t})
}
sort.Slice(totals, func(i, j int) bool { return totals[i].total > totals[j].total })