@@ -0,0 +1,54 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user