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
+40
View File
@@ -0,0 +1,40 @@
package userctrl
import (
"91porn-server/app/service/userser"
"91porn-server/common"
"91porn-server/common/stderr"
"github.com/gin-gonic/gin"
)
// ConsumePrivilege doc
// @Summary 消耗预售卡预付权益
// @Description 消耗预售卡预付权益
// @Tags user
// @Accept mpfd,json
// @Produce json,html
// @Param q body userser.ConsumeReq false "请求参数"
// @Success 200 {string} string "操作成功"
// @Failure 400 {string} json "{"msg": "操作失败"}"
// @Router /mine/privilege/consume [post]
func ConsumePrivilege(ctx *gin.Context) {
// 获取用户当前配置
uid, err := common.GetUID(ctx)
if err != nil {
common.ServeJSON(ctx, stderr.ErrNoToken, err)
return
}
var args userser.ConsumeReq
if err := ctx.ShouldBind(&args); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, nil)
return
}
err = userser.Consume(uid, args.PrivilegeType, args.Count)
if err != nil {
common.ServeJSON(ctx, stderr.Failure, nil)
}
common.ServeJSON(ctx, stderr.Success, nil)
}