Files
huangguo_server/common/top/asistant/asistant.go
T
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

55 lines
1.1 KiB
Go

package topasist
import (
topser "91porn-server/common/top"
"91porn-server/common/top/dailytop"
"91porn-server/common/top/monthtop"
"91porn-server/common/top/weektop"
"91porn-server/common/top/yeartop"
"go.mongodb.org/mongo-driver/bson/primitive"
)
// Incr 增加
func Incr(tp topser.TopName, id string, count float64) {
// 如果是一个空的id
if primitive.NilObjectID.Hex() == id {
return
}
// 日榜
dailytop.Incr(tp, id, count)
// 周榜
weektop.Incr(tp, id, count)
// 月榜
monthtop.Incr(tp, id, count)
// 年榜
yeartop.Incr(tp, id, count)
}
// Decr 减少
func Decr(tp topser.TopName, id string, count float64) {
// 如果是一个空的id
if primitive.NilObjectID.Hex() == id {
return
}
// 日榜
dailytop.Decr(tp, id, count)
// 周榜
weektop.Decr(tp, id, count)
// 月榜
monthtop.Decr(tp, id, count)
// 年榜
yeartop.Decr(tp, id, count)
}
// Remove 移除排行榜
func Remove(tp topser.TopName, id string) {
// 日榜
dailytop.Remove(tp, id)
// 周榜
weektop.Remove(tp, id)
// 月榜
monthtop.Remove(tp, id)
// 年榜
yeartop.Remove(tp, id)
}