sync: soul-api 接口逻辑、soul-api 后端 | 原因: 后端接口逻辑修改、后端代码修改
This commit is contained in:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user