修改自动生成模板

This commit is contained in:
ayflying
2025-02-10 14:42:02 +08:00
parent 167f90b250
commit 2b51cc5f7c
5 changed files with 38 additions and 11 deletions

View File

@@ -86,6 +86,15 @@ func (r *F64CountRank) IncrScore(id int64, score int64) (curScore float64, err e
return
}
// todo暂时未使用
func (r *F64CountRank) GetCount() {
count, _ := g.Redis().ZCard(ctx, r.name)
if count > 9999 {
//删除超过9999的数据
g.Redis().ZRemRangeByRank(ctx, r.name, 0, -9999)
}
}
// 删除当前排行榜
func (r *F64CountRank) Delete() {
_, err := g.Redis().Del(ctx, r.name)