Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package commentser
import (
"91porn-server/app/appg"
"91porn-server/common/constant"
"91porn-server/common/constant/redisconst"
"time"
)
// 评论发表限制
func canPublishComment(uid uint64) (isCan bool, err error) {
var LimitExpire = time.Second * time.Duration(appg.Conf.CmtLimit.CmtLimitExpire)
var key = redisconst.AutoBlockKey(constant.FrequencyComment, uid)
cnt := appg.Redis.Incr(key)
if cnt == 1 {
_, _ = appg.Redis.ExpireKey(key, LimitExpire)
}
if cnt > appg.Conf.CmtLimit.CommentCount {
// err = usermod.UpdateById(nil, uid, time.Now().Add(12*time.Hour))
// if err != nil {
// return
// }
return
}
//code := CheckCountLimit(uid)
//if code != stderr.Success {
// return
//}
isCan = true
return
}