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
+42
View File
@@ -0,0 +1,42 @@
package userser
import (
"91porn-server/models/v/advanceordermod"
"errors"
)
const (
TypeCoinVideo = "coinVideo"
TypeLuckDraw = "luckDraw"
TypeAiUndress = "aiUndress"
TypeDownload = "download"
)
type ConsumeReq struct {
PrivilegeType string `form:"privilegeType" json:"privilegeType" binding:"required"` // coinVideo:金币视频 luckDraw:抽奖 aiUndress:AI脱衣 download:下载
Count int64 `form:"count" json:"count" binding:"required"`
}
// Consume 消费预付权益次数
func Consume(uid uint64, privilegeType string, count int64) error {
if count < 1 {
return errors.New("debit count illegal")
}
debitPlan := advanceordermod.DebitPlan{}
switch privilegeType {
case TypeCoinVideo:
debitPlan.CoinVideoCount = &count
//case TypeLuckDraw:
// debitPlan.LuckyDrawCount = &count
//case TypeAiUndress:
// debitPlan.AiUndressCount = &count
case TypeDownload:
debitPlan.DownloadCount = &count
default:
return errors.New("debit type illegal")
}
err := advanceordermod.Debit(nil, uid, debitPlan)
return err
}