From e0db8751f3f0f039083a1b834548377aba037500 Mon Sep 17 00:00:00 2001 From: win Date: Fri, 27 Feb 2026 16:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/task_checker/main.go | 130 + docs/docs.go | 224 + docs/swagger.json | 26481 +++++++++-------- docs/swagger.yaml | 154 + docs/任务中心领取风险审查与测试计划.md | 62 + docs/活动大厅任务中心规则梳理.md | 64 + go.mod | 2 +- go.sum | 2 + internal/api/admin/dashboard_activity.go | 57 +- internal/service/douyin/order_sync.go | 5 +- internal/service/task_center/service.go | 241 +- internal/service/task_center/service_test.go | 272 +- 12 files changed, 14462 insertions(+), 13232 deletions(-) create mode 100644 cmd/task_checker/main.go create mode 100644 docs/任务中心领取风险审查与测试计划.md create mode 100644 docs/活动大厅任务中心规则梳理.md diff --git a/cmd/task_checker/main.go b/cmd/task_checker/main.go new file mode 100644 index 0000000..00ca1c4 --- /dev/null +++ b/cmd/task_checker/main.go @@ -0,0 +1,130 @@ +package main + +import ( + "context" + "flag" + "fmt" + "log" + "sort" + "strings" + + "bindbox-game/configs" + "bindbox-game/internal/pkg/env" + "bindbox-game/internal/pkg/logger" + "bindbox-game/internal/repository/mysql" + tcmodel "bindbox-game/internal/repository/mysql/task_center" + taskcenter "bindbox-game/internal/service/task_center" +) + +func main() { + userID := flag.Int64("user", 0, "用户ID") + taskID := flag.Int64("task", 0, "任务ID") + flag.Parse() + + if *userID == 0 || *taskID == 0 { + log.Fatalf("必须通过 -user 与 -task 指定用户与任务") + } + + // 确认环境 + env.Active() // 触发解析 -env 或 ACTIVE_ENV + configs.Init() + + repo, err := mysql.New() + if err != nil { + log.Fatalf("初始化 MySQL 失败: %v", err) + } + defer repo.DbRClose() + defer repo.DbWClose() + + logg, err := logger.NewCustomLogger() + if err != nil { + log.Fatalf("初始化 logger 失败: %v", err) + } + + svc := taskcenter.New(logg, repo, nil, nil, nil) + + ctx := context.Background() + progress, err := svc.GetUserProgress(ctx, *userID, *taskID) + if err != nil { + log.Fatalf("查询进度失败: %v", err) + } + + fmt.Printf("任务 %d 用户 %d 进度:\n", *taskID, *userID) + fmt.Printf(" OrderCount=%d OrderAmount=%.2f InviteCount=%d FirstOrder=%v\n", + progress.OrderCount, + float64(progress.OrderAmount)/100, + progress.InviteCount, + progress.FirstOrder, + ) + + claimed := make(map[int64]struct{}, len(progress.ClaimedTiers)) + for _, tid := range progress.ClaimedTiers { + claimed[tid] = struct{}{} + } + + tiers := make([]tcmodel.TaskTier, 0) + if err := repo.GetDbR().Where("task_id = ?", *taskID).Order("threshold ASC, id ASC").Find(&tiers).Error; err != nil { + log.Fatalf("加载档位失败: %v", err) + } + + fmt.Println("档位详情:") + for _, tier := range tiers { + tp := progress.TierProgressMap[tier.ID] + currentValue, display := extractMetricValue(tier.Metric, tp) + + status := "未达标" + if checkThreshold(tier, currentValue, progress.FirstOrder) { + status = "已达标" + } + if _, ok := claimed[tier.ID]; ok { + status += " (已领取)" + } + + fmt.Printf("- Tier %d | metric=%s threshold=%d operator=%s window=%s activity=%d\n", + tier.ID, tier.Metric, tier.Threshold, tier.Operator, tier.Window, tier.ActivityID) + fmt.Printf(" 当前值: %s -> %s\n", display, status) + } + + if len(progress.ClaimedTiers) > 0 { + sort.Slice(progress.ClaimedTiers, func(i, j int) bool { return progress.ClaimedTiers[i] < progress.ClaimedTiers[j] }) + fmt.Printf("已领取档位: %s\n", joinInt64s(progress.ClaimedTiers)) + } +} + +func extractMetricValue(metric string, tp taskcenter.TierProgress) (int64, string) { + switch metric { + case taskcenter.MetricOrderAmount: + return tp.OrderAmount, fmt.Sprintf("OrderAmount=%.2f", float64(tp.OrderAmount)/100) + case taskcenter.MetricOrderCount: + return tp.OrderCount, fmt.Sprintf("OrderCount=%d", tp.OrderCount) + case taskcenter.MetricInviteCount: + return tp.InviteCount, fmt.Sprintf("InviteCount=%d", tp.InviteCount) + case taskcenter.MetricFirstOrder: + if tp.FirstOrder { + return 1, "FirstOrder=true" + } + return 0, "FirstOrder=false" + default: + return 0, "(unknown metric)" + } +} + +func checkThreshold(tier tcmodel.TaskTier, currentValue int64, firstOrder bool) bool { + switch tier.Metric { + case taskcenter.MetricFirstOrder: + return firstOrder + default: + if tier.Operator == taskcenter.OperatorGTE { + return currentValue >= tier.Threshold + } + return currentValue == tier.Threshold + } +} + +func joinInt64s(vals []int64) string { + parts := make([]string, len(vals)) + for i, v := range vals { + parts[i] = fmt.Sprintf("%d", v) + } + return strings.Join(parts, ",") +} diff --git a/docs/docs.go b/docs/docs.go index efd7f4d..37cebac 100755 --- a/docs/docs.go +++ b/docs/docs.go @@ -15,6 +15,101 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { + "/admin/dashboard/activity-profit-loss/{activity_id}/logs": { + "get": { + "description": "查看活动的抽奖记录,支持按玩家/奖品关键词搜索", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.运营分析" + ], + "summary": "活动抽奖记录", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "default": 1, + "type": "integer", + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "default": 20, + "type": "integer", + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "用户ID过滤", + "name": "user_id", + "in": "query" + }, + { + "type": "string", + "description": "玩家关键词:昵称/手机号/邀请码/ID", + "name": "player_keyword", + "in": "query" + }, + { + "type": "string", + "description": "奖品关键词:名称或ID", + "name": "prize_keyword", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.activityLogsResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "403": { + "description": "无权限", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + }, + "security": [ + { + "LoginVerifyToken": [] + } + ] + } + }, "/admin/task_center/simulate/invite_success": { "post": { "description": "模拟用户邀请成功,触发任务进度更新", @@ -7606,6 +7701,135 @@ const docTemplate = `{ } } }, + "admin.activityPaymentDetails": { + "type": "object", + "properties": { + "coupon_discount": { + "description": "优惠券抵扣金额(分)", + "type": "integer" + }, + "coupon_name": { + "description": "优惠券名称", + "type": "string" + }, + "coupon_used": { + "description": "是否使用优惠券", + "type": "boolean" + }, + "game_pass_info": { + "description": "次数卡使用信息", + "type": "string" + }, + "game_pass_used": { + "description": "是否使用次数卡", + "type": "boolean" + }, + "item_card_name": { + "description": "道具卡名称", + "type": "string" + }, + "item_card_used": { + "description": "是否使用道具卡", + "type": "boolean" + }, + "points_discount": { + "description": "积分抵扣金额(分)", + "type": "integer" + }, + "points_used": { + "description": "是否使用积分", + "type": "boolean" + } + } + }, + "admin.activityLogItem": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "discount_amount": { + "description": "分摊优惠金额(分)", + "type": "integer" + }, + "id": { + "type": "integer" + }, + "nickname": { + "type": "string" + }, + "order_amount": { + "description": "分摊订单金额(分)", + "type": "integer" + }, + "order_no": { + "description": "订单号", + "type": "string" + }, + "order_status": { + "description": "订单状态", + "type": "integer" + }, + "pay_type": { + "description": "支付方式", + "type": "string" + }, + "payment_details": { + "$ref": "#/definitions/admin.activityPaymentDetails" + }, + "product_id": { + "type": "integer" + }, + "product_image": { + "type": "string" + }, + "product_name": { + "type": "string" + }, + "product_price": { + "description": "商品价格(分)", + "type": "integer" + }, + "product_quantity": { + "description": "中奖数量", + "type": "integer" + }, + "profit": { + "description": "单次抽奖盈亏(分)", + "type": "integer" + }, + "used_card": { + "description": "使用的卡券信息", + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "admin.activityLogsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.activityLogItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, "admin.ShippingOrderGroup": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 196d479..1d45501 100755 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1,13135 +1,13362 @@ { - "swagger": "2.0", - "info": { - "title": "mini-chat 接口文档", - "contact": {}, - "version": "v0.0.1" - }, - "basePath": "/", - "paths": { - "/admin/task_center/simulate/invite_success": { - "post": { - "description": "模拟用户邀请成功,触发任务进度更新", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(Admin)" - ], - "summary": "模拟邀请成功(Admin)", - "parameters": [ - { - "description": "模拟请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/taskcenter.simulateInviteSuccessRequest" - } - } - ], - "responses": { - "200": { - "description": "操作成功", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - } - }, - "/admin/task_center/simulate/order_paid": { - "post": { - "description": "模拟用户支付订单,触发任务进度更新", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(Admin)" - ], - "summary": "模拟订单支付(Admin)", - "parameters": [ - { - "description": "模拟请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/taskcenter.simulateOrderPaidRequest" - } - } - ], - "responses": { - "200": { - "description": "操作成功", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - } - }, - "/admin/task_center/tasks": { - "get": { - "description": "获取任务管理列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(Admin)" - ], - "summary": "任务列表(Admin)", - "responses": { - "200": { - "description": "任务列表", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - }, - "post": { - "description": "创建一个新的任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(Admin)" - ], - "summary": "创建任务(Admin)", - "parameters": [ - { - "description": "创建任务请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/taskcenter.createTaskRequest" - } - } - ], - "responses": { - "200": { - "description": "创建成功", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - } - }, - "/admin/task_center/tasks/{id}": { - "put": { - "description": "修改指定任务的信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(Admin)" - ], - "summary": "修改任务(Admin)", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "修改任务请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/taskcenter.modifyTaskRequest" - } - } - ], - "responses": { - "200": { - "description": "修改成功", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - }, - "delete": { - "description": "删除指定的任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(Admin)" - ], - "summary": "删除任务(Admin)", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - } - }, - "/admin/task_center/tasks/{id}/rewards": { - "get": { - "description": "获取任务层级对应的奖励列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(Admin)" - ], - "summary": "获取任务奖励(Admin)", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "奖励列表", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - }, - "post": { - "description": "设置任务层级对应的奖励", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(Admin)" - ], - "summary": "设置任务奖励(Admin)", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "设置奖励请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/taskcenter.upsertRewardsRequest" - } - } - ], - "responses": { - "200": { - "description": "设置成功", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - } - }, - "/admin/task_center/tasks/{id}/tiers": { - "get": { - "description": "获取任务的完成条件层级列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(Admin)" - ], - "summary": "获取任务层级(Admin)", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "层级列表", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - }, - "post": { - "description": "设置任务的完成条件层级", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(Admin)" - ], - "summary": "设置任务层级(Admin)", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "设置层级请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/taskcenter.upsertTiersRequest" - } - } - ], - "responses": { - "200": { - "description": "设置成功", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - } - }, - "/api/admin/activities": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "获取活动列表,支持分类、Boss、状态过滤与分页", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "活动列表", - "parameters": [ - { - "type": "string", - "description": "活动名称(模糊)", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "description": "活动分类ID", - "name": "category_id", - "in": "query" - }, - { - "type": "integer", - "description": "是否Boss(0/1)", - "name": "is_boss", - "in": "query" - }, - { - "type": "integer", - "description": "状态(1进行中 2下线)", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listActivitiesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "创建活动,配置基本信息与分类、Boss标签", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "创建活动", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.createActivityRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/activities/{activity_id}": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看指定活动的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "查看活动详情", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.activityDetailResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "修改活动基本信息、分类、Boss标签等", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "修改活动", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.modifyActivityRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "delete": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "删除指定活动", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "删除活动", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/activities/{activity_id}/copy": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "根据活动ID深度复制期次与奖品,生成新的活动", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "复制活动", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.copyActivityResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/activities/{activity_id}/game-passes/check": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "检查指定活动是否有用户持有未使用的次数卡,用于下架/删除前校验", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.次数卡" - ], - "summary": "检查活动次数卡", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.checkActivityGamePassesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/activities/{activity_id}/issues": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "获取指定活动的期数列表,支持分页", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "查看活动期数", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listIssuesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "为指定活动创建一个新的期数", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "创建活动期数", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.createIssueRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessage" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/activities/{activity_id}/issues/{issue_id}": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "修改指定期数的信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "修改活动期数", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "期ID", - "name": "issue_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.modifyIssueRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessage" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "delete": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "删除指定期数", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "删除活动期数", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "期ID", - "name": "issue_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessage" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/activities/{activity_id}/issues/{issue_id}/rewards": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看指定期数的奖励配置列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "查看期数奖品", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "期ID", - "name": "issue_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listRewardsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "为指定期数批量创建奖励配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "创建期数奖品", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "期ID", - "name": "issue_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.createRewardsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/activities/{activity_id}/issues/{issue_id}/rewards/batch": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "批量更新期数奖励", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "期ID", - "name": "issue_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.batchModifyRewardsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/activities/{activity_id}/issues/{issue_id}/rewards/{reward_id}": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "更新期数奖励", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "期ID", - "name": "issue_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "奖励ID", - "name": "reward_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.modifyRewardRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "delete": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "删除期数奖励", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "期ID", - "name": "issue_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "奖励ID", - "name": "reward_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/activity_categories": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "获取启用状态的活动分类列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.活动" - ], - "summary": "活动分类列表", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listCategoriesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/auth/refresh": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.登录" - ], - "summary": "管理端令牌刷新", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.refreshResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/banners": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.运营" - ], - "summary": "查看轮播图列表", - "parameters": [ - { - "type": "integer", - "description": "状态", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listBannersResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.运营" - ], - "summary": "创建轮播图", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.createBannerRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.createBannerResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/banners/{banner_id}": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.运营" - ], - "summary": "修改轮播图", - "parameters": [ - { - "type": "string", - "description": "轮播图ID", - "name": "banner_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.modifyBannerRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.pcSimpleMessage" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "delete": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.运营" - ], - "summary": "删除轮播图", - "parameters": [ - { - "type": "string", - "description": "轮播图ID", - "name": "banner_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.pcSimpleMessage" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/game-pass-packages": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查询次数卡套餐列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.次数卡套餐" - ], - "summary": "次数卡套餐列表", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "query" - }, - { - "type": "integer", - "description": "状态: 1=上架 2=下架", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listGamePassPackagesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "创建可购买的次数卡套餐", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.次数卡套餐" - ], - "summary": "创建次数卡套餐", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.createGamePassPackageRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.createGamePassPackageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/game-pass-packages/{package_id}": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "修改次数卡套餐配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.次数卡套餐" - ], - "summary": "修改次数卡套餐", - "parameters": [ - { - "type": "integer", - "description": "套餐ID", - "name": "package_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.modifyGamePassPackageRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "delete": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "软删除次数卡套餐", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.次数卡套餐" - ], - "summary": "删除次数卡套餐", - "parameters": [ - { - "type": "integer", - "description": "套餐ID", - "name": "package_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/game-passes/grant": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "管理员为用户发放游戏次数卡", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.次数卡" - ], - "summary": "发放次数卡", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.grantGamePassRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.grantGamePassResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/game-passes/list": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查询用户次数卡列表,支持按用户、活动过滤", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.次数卡" - ], - "summary": "次数卡列表", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "query" - }, - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listGamePassesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/login": { - "post": { - "description": "管理员登录", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.登录" - ], - "summary": "管理员登录", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.loginRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.loginResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/matching/audit/{order_no}": { - "get": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "运营通过单号查询发牌过程", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.对对碰" - ], - "summary": "获取对对碰审计数据", - "parameters": [ - { - "type": "string", - "description": "订单号", - "name": "order_no", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/activity.MatchingGame" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/matching_card_types": { - "get": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "获取所有卡牌类型配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.对对碰" - ], - "summary": "列出对对碰卡牌类型", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listMatchingCardTypesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "post": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "创建新的卡牌类型", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.对对碰" - ], - "summary": "创建卡牌类型", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.matchingCardTypeRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.matchingCardTypeResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/matching_card_types/{id}": { - "put": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "修改已有的卡牌类型", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.对对碰" - ], - "summary": "修改卡牌类型", - "parameters": [ - { - "type": "integer", - "description": "卡牌类型ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.matchingCardTypeRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.matchingCardTypeResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "delete": { - "security": [ - { - "AdminAuth": [] - } - ], - "description": "删除指定的卡牌类型", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.对对碰" - ], - "summary": "删除卡牌类型", - "parameters": [ - { - "type": "integer", - "description": "卡牌类型ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object", - "additionalProperties": true - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/orders/{order_id}/rollback": { - "post": { - "description": "基于快照将用户数据回滚到消费前状态,包括恢复积分、优惠券、道具卡,作废资产,调用微信退款", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Admin-Audit" - ], - "summary": "回滚订单到消费前状态", - "parameters": [ - { - "type": "integer", - "description": "订单ID", - "name": "order_id", - "in": "path", - "required": true - }, - { - "description": "回滚请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.rollbackOrderRequest" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/admin.rollbackOrderResponse" - } - } - } - } - }, - "/api/admin/orders/{order_id}/snapshots": { - "get": { - "description": "获取订单消费前后的完整用户状态快照", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Admin-Audit" - ], - "summary": "获取订单审计快照", - "parameters": [ - { - "type": "integer", - "description": "订单ID", - "name": "order_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/admin.getOrderSnapshotsResponse" - } - } - } - } - }, - "/api/admin/product_categories": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.商品" - ], - "summary": "查看商品分类列表", - "parameters": [ - { - "type": "string", - "description": "名称", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "description": "状态", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listProductCategoriesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.商品" - ], - "summary": "创建商品分类", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.createProductCategoryRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.createProductCategoryResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/product_categories/{category_id}": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.商品" - ], - "summary": "修改商品分类", - "parameters": [ - { - "type": "string", - "description": "分类ID", - "name": "category_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.modifyProductCategoryRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.pcSimpleMessage" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "delete": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.商品" - ], - "summary": "删除商品分类", - "parameters": [ - { - "type": "string", - "description": "分类ID", - "name": "category_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.pcSimpleMessage" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/products": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.商品" - ], - "summary": "查看商品列表", - "parameters": [ - { - "type": "string", - "description": "名称", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "description": "分类ID", - "name": "category_id", - "in": "query" - }, - { - "type": "integer", - "description": "状态", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listProductsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.商品" - ], - "summary": "创建商品", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.createProductRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.createProductResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/products/batch": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.商品" - ], - "summary": "批量更新商品(库存/上下架)", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.batchUpdateProductsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.batchUpdateProductsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/products/{product_id}": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.商品" - ], - "summary": "修改商品", - "parameters": [ - { - "type": "string", - "description": "商品ID", - "name": "product_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.modifyProductRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.pcSimpleMessage" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "delete": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.商品" - ], - "summary": "删除商品", - "parameters": [ - { - "type": "string", - "description": "商品ID", - "name": "product_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.pcSimpleMessage" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/shipping/orders": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "按批次号或运单号聚合显示发货记录,支持筛选状态、用户、时间等", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.发货管理" - ], - "summary": "发货订单列表", - "parameters": [ - { - "type": "integer", - "description": "页码,默认1", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量,最多100,默认20", - "name": "page_size", - "in": "query" - }, - { - "type": "integer", - "description": "状态:1待发货 2已发货 3已签收 4异常", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "批次号", - "name": "batch_no", - "in": "query" - }, - { - "type": "string", - "description": "运单号", - "name": "express_no", - "in": "query" - }, - { - "type": "string", - "description": "开始日期 2006-01-02", - "name": "start_date", - "in": "query" - }, - { - "type": "string", - "description": "结束日期 2006-01-02", - "name": "end_date", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listShippingOrdersResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/shipping/orders/batch": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "为多条发货记录填写运单号或更新状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.发货管理" - ], - "summary": "批量更新发货信息", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.updateShippingRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.updateShippingResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/shipping/orders/{id}": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "根据发货记录ID获取详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.发货管理" - ], - "summary": "获取发货订单详情", - "parameters": [ - { - "type": "integer", - "description": "发货记录ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/model.ShippingRecords" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/system_item_cards": { - "get": { - "description": "管理员获取道具卡列表,支持按名称、状态、类型等条件筛选", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.运营管理" - ], - "summary": "获取道具卡列表", - "parameters": [ - { - "type": "string", - "description": "道具卡名称", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "description": "状态:1启用 2禁用", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "道具卡类型:1抽奖卡 2加成卡 3保底卡", - "name": "card_type", - "in": "query" - }, - { - "type": "integer", - "description": "适用范围:1全局 2活动分类 3活动 4期次", - "name": "scope_type", - "in": "query" - }, - { - "type": "integer", - "description": "页码,默认1", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数,默认10", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listItemCardsResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "post": { - "description": "管理员创建新的道具卡,支持设置类型、效果、有效期等属性", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.运营管理" - ], - "summary": "创建道具卡", - "parameters": [ - { - "description": "创建道具卡请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.createItemCardRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.createItemCardResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "403": { - "description": "无权限,仅超管可操作", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/system_item_cards/{item_card_id}": { - "put": { - "description": "管理员修改道具卡信息,支持修改名称、价格、有效期等属性", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.运营管理" - ], - "summary": "修改道具卡", - "parameters": [ - { - "type": "integer", - "description": "道具卡ID", - "name": "item_card_id", - "in": "path", - "required": true - }, - { - "description": "修改道具卡请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.modifyItemCardRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "403": { - "description": "无权限,仅超管可操作", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "delete": { - "description": "管理员删除指定的道具卡", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.运营管理" - ], - "summary": "删除道具卡", - "parameters": [ - { - "type": "integer", - "description": "道具卡ID", - "name": "item_card_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "403": { - "description": "无权限,仅超管可操作", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看APP端用户分页列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "管理端用户列表", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "用户昵称", - "name": "nickname", - "in": "query" - }, - { - "type": "string", - "description": "邀请码", - "name": "inviteCode", - "in": "query" - }, - { - "type": "string", - "description": "开始日期(YYYY-MM-DD)", - "name": "startDate", - "in": "query" - }, - { - "type": "string", - "description": "结束日期(YYYY-MM-DD)", - "name": "endDate", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listUsersResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/coupons": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看指定用户持有的优惠券列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "查看用户优惠券列表", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listCouponsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/coupons/add": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "管理端为指定用户发放优惠券", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "给用户添加优惠券", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.addCouponRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.addCouponResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/game-passes": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查询指定用户的所有次数卡", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.次数卡" - ], - "summary": "查询用户次数卡", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.getUserGamePassesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/game_tickets": { - "get": { - "tags": [ - "管理端.游戏" - ], - "summary": "查询用户游戏资格日志", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - }, - "post": { - "tags": [ - "管理端.游戏" - ], - "summary": "发放游戏资格", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/game.grantTicketRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - } - }, - "/api/admin/users/{user_id}/inventory": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看指定用户的资产记录", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "查看用户资产列表", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listInventoryResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/invites": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看指定用户邀请的用户列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "查看用户邀请列表", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listInvitesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/item_cards": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看指定用户的道具卡持有记录", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "查看用户道具卡列表", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listUserItemCardsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "post": { - "description": "管理员给指定用户分配道具卡,可指定数量", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.运营管理" - ], - "summary": "给用户分配道具卡", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "分配道具卡请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.assignItemCardRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.simpleMessageResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "403": { - "description": "无权限,仅超管可操作", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/orders": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看指定用户的订单记录", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "查看用户订单列表", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listOrdersResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/points": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看指定用户的积分流水记录", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "查看用户积分记录", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.listPointsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/points/add": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "管理端为指定用户发放或扣减积分,正数为增加,负数为扣减", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "给用户增加或扣减积分", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.addPointsRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.addPointsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/points/balance": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看指定用户当前积分余额(过滤过期)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "查看用户积分余额", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.pointsBalanceResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/profile": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "聚合用户基本信息、生命周期财务指标、当前资产快照", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "获取用户综合画像", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.UserProfileResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/rewards/grant": { - "post": { - "description": "管理员给用户发放奖励,支持实物和虚拟奖品,可选择关联活动和奖励配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "给用户发放奖励", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.GrantRewardRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.GrantRewardResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/admin/users/{user_id}/token": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "仅超级管理员可用,用于测试或紧急场景下为指定用户签发APP令牌", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.用户" - ], - "summary": "管理端为APP用户签发令牌", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.issueUserTokenResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/activities": { - "get": { - "description": "获取活动列表,支持分类、Boss、状态过滤与分页", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "活动列表", - "parameters": [ - { - "type": "string", - "description": "活动名称(模糊)", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "description": "活动分类ID", - "name": "category_id", - "in": "query" - }, - { - "type": "integer", - "description": "是否Boss(0/1)", - "name": "is_boss", - "in": "query" - }, - { - "type": "integer", - "description": "状态(1进行中 2下线)", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listActivitiesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/activities/{activity_id}": { - "get": { - "description": "获取指定活动的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "活动详情", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.activityDetailResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/activities/{activity_id}/issues": { - "get": { - "description": "获取指定活动的期列表,支持分页", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "活动期列表", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listIssuesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/activities/{activity_id}/issues/{issue_id}/choices": { - "get": { - "description": "返回总位置数量、已占用位置列表以及当前可选位置列表。仅在活动玩法为 ichiban 时可用。", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "获取指定活动期的可选位置与已占用位置", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "期ID", - "name": "issue_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listIssueChoicesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/activities/{activity_id}/issues/{issue_id}/draw_logs": { - "get": { - "description": "查看指定活动期数的抽奖记录,支持等级筛选(默认返回最新的100条,不支持自定义翻页)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "抽奖记录列表", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "期ID", - "name": "issue_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "奖品等级过滤", - "name": "level", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listDrawLogsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/activities/{activity_id}/issues/{issue_id}/draw_logs_grouped": { - "get": { - "description": "查看指定活动期数的抽奖记录,按奖品等级分组返回", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "按奖品等级分类的抽奖记录", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "期ID", - "name": "issue_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listDrawLogsByLevelResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/activities/{activity_id}/issues/{issue_id}/rewards": { - "get": { - "description": "获取指定期的奖励配置列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "奖励配置列表", - "parameters": [ - { - "type": "integer", - "description": "活动ID", - "name": "activity_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "期ID", - "name": "issue_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listRewardsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/address-share/submit": { - "post": { - "description": "被邀请者使用分享令牌提交收件信息;服务端校验令牌有效并创建待发货记录(极简方案)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "提交共享地址", - "parameters": [ - { - "description": "请求参数:令牌与地址信息", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.addressShareSubmitRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.addressShareSubmitResponse" - } - }, - "400": { - "description": "令牌无效/已处理/资产不可用", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/banners": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.运营" - ], - "summary": "APP端轮播图列表", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listAppBannersResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/categories": { - "get": { - "description": "获取APP端商品分类列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.基础" - ], - "summary": "获取分类列表", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listAppCategoriesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/game-passes/available": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查询当前用户可用的游戏次数卡", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "获取用户次数卡", - "parameters": [ - { - "type": "integer", - "description": "活动ID,不传返回所有可用次数卡", - "name": "activity_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.getGamePassesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/game-passes/packages": { - "get": { - "description": "获取可购买的次数卡套餐列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "获取次数卡套餐", - "parameters": [ - { - "type": "integer", - "description": "活动ID,不传返回全局套餐", - "name": "activity_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.getPackagesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/game-passes/purchase": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "购买次数卡套餐,创建订单等待支付", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "购买次数卡套餐", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.purchasePackageRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.purchasePackageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/games/enter": { - "post": { - "tags": [ - "APP端.游戏" - ], - "summary": "进入游戏", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/game.enterGameRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/game.enterGameResponse" - } - } - } - } - }, - "/api/app/lottery/join": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "提交活动ID与期ID创建参与记录与订单,支持积分抵扣,返回参与ID、订单号、抽奖模式及是否进入队列", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.抽奖" - ], - "summary": "用户参与抽奖", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.joinLotteryRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.joinLotteryResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/lottery/result": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "根据订单号查询抽奖结果与进度,返回结果明细与可验证凭证;需登录", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.抽奖" - ], - "summary": "抽奖订单结果查询", - "parameters": [ - { - "type": "string", - "description": "订单号", - "name": "order_no", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.orderResultResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/matching/card_types": { - "get": { - "description": "获取所有启用的卡牌类型配置,用于App端预览或动画展示", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "列出对对碰卡牌类型", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/activity.CardTypeConfig" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/matching/cards": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "只有支付成功后才能获取游戏牌组数据,防止未支付用户获取牌组信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "获取对对碰游戏数据", - "parameters": [ - { - "type": "string", - "description": "游戏ID", - "name": "game_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.matchingGameCardsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/matching/check": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "前端游戏结束后上报结果,服务器发放奖励", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "游戏结束结算校验", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.matchingGameCheckRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.matchingGameCheckResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/matching/preorder": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "用户下单,服务器扣费并返回全量99张乱序卡牌,前端自行负责游戏流程", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "下单并获取对对碰全量数据", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.matchingGamePreOrderRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.matchingGamePreOrderResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/matching/state": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "获取当前游戏的完整状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.活动" - ], - "summary": "获取对对碰游戏状态", - "parameters": [ - { - "type": "string", - "description": "游戏ID", - "name": "game_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object", - "additionalProperties": true - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/notices": { - "get": { - "description": "获取APP首页滚动公告", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.基础" - ], - "summary": "获取公告列表", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listAppNoticesResponse" - } - } - } - } - }, - "/api/app/orders/{order_id}": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "获取指定订单的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "获取订单详情", - "parameters": [ - { - "type": "integer", - "description": "订单ID", - "name": "order_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/user.OrderWithItems" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/orders/{order_id}/cancel": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "取消指定订单(仅限待付款状态)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "取消订单", - "parameters": [ - { - "type": "integer", - "description": "订单ID", - "name": "order_id", - "in": "path", - "required": true - }, - { - "description": "取消原因", - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/app.cancelOrderRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.cancelOrderResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/pay/wechat/jsapi/preorder": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "根据`order_no`与`openid`创建或复用JSAPI预下单,返回`wx.requestPayment`调起参数;订单需为当前登录用户且状态为待支付", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.支付" - ], - "summary": "小程序微信支付预下单", - "parameters": [ - { - "description": "请求参数:业务订单号与openid", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.jsapiPreorderRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.jsapiPreorderResponse" - } - }, - "400": { - "description": "参数错误/配置缺失/订单不存在或状态不合法/微信预下单失败/签名构建失败", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/products": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "分页查询商品列表,支持分类筛选,返回分页信息与商品数组", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.商品" - ], - "summary": "商品列表", - "parameters": [ - { - "type": "integer", - "description": "页码,默认1", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量,默认20", - "name": "page_size", - "in": "query" - }, - { - "type": "integer", - "description": "分类ID", - "name": "category_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listAppProductsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/products/{id}": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "根据商品ID返回完整商品信息,含相册与同类推荐;校验下架/缺货状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.商品" - ], - "summary": "商品详情", - "parameters": [ - { - "type": "integer", - "description": "商品ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.getAppProductDetailResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/sms/login": { - "post": { - "description": "使用短信验证码登录或注册(新手机号自动创建账户)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "短信验证码登录", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.smsLoginRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.smsLoginResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/sms/send-code": { - "post": { - "description": "发送短信验证码到指定手机号(60秒内不可重复发送,每日最多10次)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "发送短信验证码", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.sendSmsCodeRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.sendSmsCodeResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/store/items": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "分页获取积分商城商品列表,支持按类型筛选(product/item_card/coupon)", - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.积分商城" - ], - "summary": "获取积分商城商品列表", - "parameters": [ - { - "type": "string", - "description": "商品类型: product(默认), item_card, coupon", - "name": "kind", - "in": "query" - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 20, - "description": "每页数量", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listStoreItemsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/task-center/tasks": { - "get": { - "description": "获取当前可用的任务列表,支持分页", - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(App)" - ], - "summary": "获取任务列表(App)", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 20, - "description": "每页数量", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "任务列表", - "schema": { - "$ref": "#/definitions/taskcenter.listTasksResponse" - } - } - } - } - }, - "/api/app/task-center/tasks/{id}/claim/{user_id}": { - "post": { - "description": "用户领取指定任务层级的奖励", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(App)" - ], - "summary": "领取任务奖励(App)", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "领取请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/taskcenter.claimTaskRequest" - } - } - ], - "responses": { - "200": { - "description": "领取成功", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - } - }, - "/api/app/task-center/tasks/{id}/progress/{user_id}": { - "get": { - "description": "获取指定用户在特定任务上的进度详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TaskCenter(App)" - ], - "summary": "获取用户任务进度(App)", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "任务进度详情", - "schema": { - "$ref": "#/definitions/taskcenter.taskProgressResponse" - } - } - } - } - }, - "/api/app/users/douyin/login": { - "post": { - "description": "抖音小程序登录(需传递 code 或 anonymous_code)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "抖音登录", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.douyinLoginRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.douyinLoginResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/profile": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "获取当前登录用户的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "获取用户信息", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.userItem" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/weixin/login": { - "post": { - "description": "微信静默登录(需传递 code;可选 invite_code)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "微信登录", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.weixinLoginRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.weixinLoginResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "修改用户昵称与头像", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "修改用户信息", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.modifyUserRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.modifyUserResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/addresses": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "分页获取当前登录用户的收货地址列表,默认地址优先", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "获取用户地址列表", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "页码,默认1", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数,默认20,最多100", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listAddressesResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "为当前登录用户新增收货地址,可选择设为默认", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "新增用户地址", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.addAddressRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.addAddressResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/addresses/{address_id}": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "更新当前登录用户的指定收货地址", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "更新用户地址", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "地址ID", - "name": "address_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.updateAddressRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.okResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - }, - "delete": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "删除当前登录用户的指定收货地址", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "删除用户地址", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "地址ID", - "name": "address_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.okDeleteResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/addresses/{address_id}/default": { - "put": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "将指定地址设置为当前登录用户的默认地址", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "设置默认用户地址", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "地址ID", - "name": "address_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.okResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/coupons": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看用户持有的优惠券列表,支持按状态过滤", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "查看用户优惠券", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "状态:1未使用 2已使用 3已过期,不传默认1", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listCouponsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/coupons/stats": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "获取用户优惠券各状态数量和累计金额", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "获取用户优惠券统计", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.couponStatsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/coupons/{user_coupon_id}/usage": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "获取指定优惠券的使用记录,包含优惠券详情、订单号、活动名称", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "获取单张优惠券使用记录", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "用户优惠券ID", - "name": "user_coupon_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "页码,默认1", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量,默认20", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listCouponUsageResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/douyin/phone/bind": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "使用抖音手机号 code 换取手机号并绑定到指定用户", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "抖音绑定手机号", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.bindDouyinPhoneRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.bindDouyinPhoneResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/game_tickets": { - "get": { - "tags": [ - "APP端.游戏" - ], - "summary": "获取我的游戏资格", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object", - "additionalProperties": { - "type": "integer" - } - } - } - } - } - }, - "/api/app/users/{user_id}/inventory": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "获取 APP 端当前登录用户在 user_inventory 的资产记录,支持分页", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "获取用户资产列表", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "页码,默认1", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量,最多100,默认20", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listInventoryResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/inventory/address-share/create": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "生成一次性分享令牌(不落库),用于邀请他人填写收货地址;令牌默认有效期1小时(无需传过期参数)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "创建共享地址链接", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数:资产ID(过期参数可不传,默认1小时)", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.addressShareCreateRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.addressShareCreateResponse" - } - }, - "400": { - "description": "参数错误/资产不可用", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/inventory/address-share/revoke": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "极简方案下为前端态操作:不落库令牌,撤销仅用于提示与禁用旧链接(可忽略服务端状态)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "撤销共享地址链接", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数:资产ID", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.addressShareRevokeRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.okResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/inventory/cancel-shipping": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "取消已提交但未发货的申请;恢复库存状态。支持按单个资产ID取消或按批次号批量取消", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "取消发货申请", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数:资产ID或批次号(二选一)", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.cancelShippingRequest" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/app.cancelShippingResponse" - } - }, - "400": { - "description": "参数错误/记录不存在/已处理", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/inventory/redeem": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "将资产按规则转换为积分,成功后资产不可再发货;默认兑换比率来自系统配置`points_exchange_per_cent`", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "资产兑换为积分", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数:资产ID", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.redeemInventoryRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.redeemInventoryResponse" - } - }, - "400": { - "description": "参数错误/资产不可用", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/inventory/request-shipping": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "用户已有默认地址时,申请对指定资产发货;幂等校验已存在发货记录时返回已处理", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "申请发货", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数:资产ID", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.requestShippingRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.requestShippingResponse" - } - }, - "400": { - "description": "参数错误/未设置默认地址/已处理", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/inventory/request-shipping-batch": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "为多个资产申请发货,校验所有权与状态;幂等:已申请的资产跳过", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "批量申请发货", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数:资产ID列表与可选地址ID", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.requestShippingBatchRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.requestShippingBatchResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/invites": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看被该用户邀请的用户列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "查看用户邀请记录", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listInvitesResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/item_cards": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "获取指定用户的道具卡列表,支持分页和状态过滤", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "获取用户道具卡列表", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "页码,默认1", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数,默认10", - "name": "page_size", - "in": "query" - }, - { - "type": "integer", - "description": "状态:1未使用 2已使用 3已过期,不传默认1", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listUserItemCardsResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/item_cards/uses": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "获取指定用户的道具卡使用记录,支持分页", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "获取用户道具卡使用记录", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "页码,默认1", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数,默认10", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listUserItemCardUsesResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/orders": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看用户抽奖来源订单记录", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "查看用户订单记录", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "订单状态:1待支付 2已支付 3已取消 4已退款", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "是否已消耗/履约:0否 1是", - "name": "is_consumed", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listOrdersResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/phone/bind": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "使用微信手机号 code 换取手机号并绑定到指定用户", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "绑定手机号", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.bindPhoneRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.bindPhoneResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/points": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看用户积分流水记录", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "查看用户积分记录", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量,最多100", - "name": "page_size", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listPointsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/points/balance": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "查看用户积分余额(过滤过期积分)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "查看用户积分余额", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.pointsBalanceResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/points/redeem-coupon": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "使用积分兑换指定直减金额券,按比率 1积分=1元(券面值为分)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.积分" - ], - "summary": "积分兑换优惠券", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.redeemCouponRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.redeemCouponResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/points/redeem-item-card": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "使用积分兑换指定数量的道具卡", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "积分兑换道具卡", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "description": "兑换请求参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.redeemItemCardRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.redeemItemCardResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/points/redeem-product": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "使用积分按比率1积分=1元兑换商品,生成系统发放订单与用户资产", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.积分" - ], - "summary": "积分兑换商品", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.redeemProductRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.redeemProductResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/shipments": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "按运单号聚合用户的发货记录,支持分页", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.发货" - ], - "summary": "获取用户发货分组列表", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "页码,默认1", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量,最多100,默认20", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.listShipmentsResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/app/users/{user_id}/stats": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "返回当前登录用户的道具卡数量、优惠券数量、积分余额", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "APP端.用户" - ], - "summary": "获取用户统计", - "parameters": [ - { - "type": "integer", - "description": "用户ID", - "name": "user_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/app.userStatsResponse" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "401": { - "description": "未授权", - "schema": { - "$ref": "#/definitions/code.Failure" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/role/list": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.系统" - ], - "summary": "角色列表", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "current", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量", - "name": "size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "角色名称", - "name": "roleName", - "in": "query" - }, - { - "type": "string", - "description": "角色编码", - "name": "roleCode", - "in": "query" - }, - { - "type": "boolean", - "description": "是否启用", - "name": "enabled", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.roleListResponse" - } - } - } - } - }, - "/api/user": { - "post": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "创建新的管理员账号", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.系统" - ], - "summary": "创建系统用户", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/admin.createUserRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.createUserResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/code.Failure" - } - } - } - } - }, - "/api/user/list": { - "get": { - "security": [ - { - "LoginVerifyToken": [] - } - ], - "description": "返回系统用户分页数据", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "管理端.系统" - ], - "summary": "系统用户列表", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "current", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "description": "每页数量", - "name": "size", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "用户名", - "name": "userName", - "in": "query" - }, - { - "type": "string", - "description": "邮箱", - "name": "userEmail", - "in": "query" - }, - { - "type": "string", - "description": "手机号", - "name": "userPhone", - "in": "query" - }, - { - "type": "string", - "description": "状态", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/admin.userListResponse" - } - } - } - } - }, - "/api/v3/system/menus/simple": { - "get": { - "responses": {} - } - }, - "/common/upload/wangeditor": { - "post": { - "description": "适配 WangEditor 的图片上传接口", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Common" - ], - "summary": "WangEditor图片上传", - "parameters": [ - { - "type": "file", - "description": "图片文件", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "上传成功", - "schema": { - "type": "object", - "additionalProperties": true - } - }, - "400": { - "description": "上传失败", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - } - }, - "/internal/game/consume-ticket": { - "post": { - "tags": [ - "Internal.游戏" - ], - "summary": "扣减游戏次数", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/game.consumeTicketRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/game.consumeTicketResponse" - } - } - } - } - }, - "/internal/game/minesweeper/config": { - "get": { - "tags": [ - "Internal.游戏" - ], - "summary": "获取扫雷配置", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - } - }, - "/internal/game/settle": { - "post": { - "description": "游戏结束后结算并发放奖励", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Internal" - ], - "summary": "结算游戏", - "parameters": [ - { - "description": "结算信息", - "name": "result", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/minesweeper.SettleGameRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/minesweeper.SettleGameResponse" - } - } - } - } - }, - "/internal/game/validate-token": { - "post": { - "tags": [ - "Internal.游戏" - ], - "summary": "验证GameToken", - "parameters": [ - { - "description": "请求参数", - "name": "RequestBody", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/game.validateTokenRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/game.validateTokenResponse" - } - } - } - } - }, - "/internal/game/verify": { - "post": { - "description": "验证游戏票据是否有效", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Internal" - ], - "summary": "验证游戏票据", - "parameters": [ - { - "description": "票据信息", - "name": "ticket", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/minesweeper.VerifyTicketRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/minesweeper.VerifyTicketResponse" - } - } - } - } - }, - "/pay/wechat/notify": { - "post": { - "description": "接收微信支付结果通知,验证签名并处理订单状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pay" - ], - "summary": "微信支付回调通知", - "responses": { - "200": { - "description": "处理成功", - "schema": { - "$ref": "#/definitions/pay.notifyAck" - } - }, - "400": { - "description": "请求参数错误", - "schema": { - "$ref": "#/definitions/pay.notifyAck" - } - }, - "500": { - "description": "服务器内部错误", - "schema": { - "$ref": "#/definitions/pay.notifyAck" - } - } - } - } + "swagger": "2.0", + "info": { + "title": "mini-chat 接口文档", + "contact": {}, + "version": "v0.0.1" + }, + "basePath": "/", + "paths": { + "/admin/task_center/simulate/invite_success": { + "post": { + "description": "模拟用户邀请成功,触发任务进度更新", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(Admin)" + ], + "summary": "模拟邀请成功(Admin)", + "parameters": [ + { + "description": "模拟请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/taskcenter.simulateInviteSuccessRequest" + } + } + ], + "responses": { + "200": { + "description": "操作成功", + "schema": { + "type": "object", + "additionalProperties": true + } + } } + } }, - "definitions": { - "activity.CardTypeConfig": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "image_url": { - "type": "string" - }, - "name": { - "type": "string" - }, - "quantity": { - "type": "integer" - } - } - }, - "activity.MatchingCard": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "activity.MatchingGame": { - "type": "object", - "properties": { - "activity_id": { - "type": "integer" - }, - "board": { - "type": "array", - "items": { - "$ref": "#/definitions/activity.MatchingCard" - } - }, - "card_configs": { - "type": "array", - "items": { - "$ref": "#/definitions/activity.CardTypeConfig" - } - }, - "card_id_counter": { - "type": "integer" - }, - "created_at": { - "description": "游戏创建时间,用于自动开奖超时判断", - "type": "string" - }, - "deck": { - "type": "array", - "items": { - "$ref": "#/definitions/activity.MatchingCard" - } - }, - "issue_id": { - "type": "integer" - }, - "last_activity": { - "type": "string" - }, - "max_possible_pairs": { - "type": "integer" - }, - "nonce": { - "type": "integer" - }, - "order_id": { - "type": "integer" - }, - "position": { - "description": "用户选择的类型,用于服务端验证", - "type": "string" - }, - "server_seed": { - "type": "array", - "items": { - "type": "integer" - } - }, - "server_seed_hash": { - "type": "string" - }, - "total_pairs": { - "type": "integer" - }, - "user_id": { - "type": "integer" - } - } - }, - "admin.GrantRewardRequest": { - "type": "object", - "required": [ - "product_id" - ], - "properties": { - "activity_id": { - "description": "活动ID(可选)", - "type": "integer" - }, - "address_id": { - "description": "收货地址ID(可选,实物商品需要)", - "type": "integer" - }, - "points_amount": { - "description": "消耗积分", - "type": "integer" - }, - "product_id": { - "description": "商品ID", - "type": "integer" - }, - "quantity": { - "description": "发放数量", - "type": "integer", - "minimum": 1 - }, - "remark": { - "description": "备注", - "type": "string" - }, - "reward_id": { - "description": "奖励配置ID(可选)", - "type": "integer" - } - } - }, - "admin.GrantRewardResponse": { - "type": "object", - "properties": { - "inventory_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "message": { - "type": "string" - }, - "order_id": { - "type": "integer" - }, - "success": { - "type": "boolean" - } - } - }, - "admin.ShippingOrderGroup": { - "type": "object", - "properties": { - "address_id": { - "description": "地址ID", - "type": "integer" - }, - "address_info": { - "description": "地址信息", - "type": "string" - }, - "batch_no": { - "description": "批次号", - "type": "string" - }, - "count": { - "description": "商品数量", - "type": "integer" - }, - "created_at": { - "type": "string" - }, - "express_code": { - "description": "快递公司编码", - "type": "string" - }, - "express_no": { - "description": "运单号", - "type": "string" - }, - "group_key": { - "description": "分组键(用于批量操作)", - "type": "string" - }, - "inventory_ids": { - "description": "资产ID列表", - "type": "array", - "items": { - "type": "integer" - } - }, - "product_ids": { - "description": "商品ID列表", - "type": "array", - "items": { - "type": "integer" - } - }, - "products": { - "description": "商品详情列表", - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "image": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "integer" - } - } - } - }, - "received_at": { - "type": "string" - }, - "record_ids": { - "description": "发货记录ID列表", - "type": "array", - "items": { - "type": "integer" - } - }, - "shipped_at": { - "type": "string" - }, - "status": { - "description": "状态(取最大值)", - "type": "integer" - }, - "total_price": { - "description": "总价格", - "type": "integer" - }, - "user_id": { - "description": "用户ID", - "type": "integer" - }, - "user_nickname": { - "description": "用户昵称", - "type": "string" - } - } - }, - "admin.UserProfileResponse": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "channel_id": { - "type": "integer" - }, - "created_at": { - "type": "string" - }, - "current_assets": { - "description": "当前资产快照", - "type": "object", - "properties": { - "coupon_count": { - "description": "持有优惠券数", - "type": "integer" - }, - "coupon_value": { - "description": "持有优惠券价值", - "type": "integer" - }, - "inventory_count": { - "description": "持有商品数", - "type": "integer" - }, - "inventory_value": { - "description": "持有商品价值", - "type": "integer" - }, - "item_card_count": { - "description": "持有道具卡数", - "type": "integer" - }, - "item_card_value": { - "description": "持有道具卡价值", - "type": "integer" - }, - "points_balance": { - "description": "积分余额", - "type": "integer" - }, - "profit_loss_ratio": { - "description": "累计盈亏比", - "type": "number" - }, - "total_asset_value": { - "description": "总资产估值", - "type": "integer" - } - } - }, - "douyin_id": { - "type": "string" - }, - "id": { - "description": "基本信息", - "type": "integer" - }, - "invite_code": { - "type": "string" - }, - "invite_count": { - "description": "邀请统计", - "type": "integer" - }, - "inviter_id": { - "type": "integer" - }, - "lifetime_stats": { - "description": "生命周期财务指标", - "type": "object", - "properties": { - "net_cash_cost": { - "description": "净现金支出", - "type": "integer" - }, - "order_count": { - "description": "订单数", - "type": "integer" - }, - "total_paid": { - "description": "累计支付", - "type": "integer" - }, - "total_refunded": { - "description": "累计退款", - "type": "integer" - } - } - }, - "mobile": { - "type": "string" - }, - "nickname": { - "type": "string" - } - } - }, - "admin.activityDetailResponse": { - "type": "object", - "properties": { - "activity_category_id": { - "type": "integer" - }, - "allow_coupons": { - "type": "boolean" - }, - "allow_item_cards": { - "type": "boolean" - }, - "banner": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "draw_mode": { - "type": "string" - }, - "end_time": { - "type": "string" - }, - "gameplay_intro": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "image": { - "type": "string" - }, - "interval_minutes": { - "type": "integer" - }, - "is_boss": { - "type": "integer" - }, - "last_settled_at": { - "type": "string" - }, - "min_participants": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "play_type": { - "type": "string" - }, - "price_draw": { - "type": "integer" - }, - "refund_coupon_id": { - "type": "integer" - }, - "scheduled_time": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "updated_at": { - "type": "string" - } - } - }, - "admin.activityItem": { - "type": "object", - "properties": { - "activity_category_id": { - "type": "integer" - }, - "banner": { - "type": "string" - }, - "category_name": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "image": { - "type": "string" - }, - "is_boss": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "price_draw": { - "type": "integer" - }, - "status": { - "type": "integer" - } - } - }, - "admin.activitysvcIssueData": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "issue_number": { - "type": "string" - }, - "prize_count": { - "type": "integer" - }, - "sort": { - "type": "integer" - }, - "status": { - "type": "integer" - } - } - }, - "admin.addCouponRequest": { - "type": "object", - "required": [ - "coupon_id" - ], - "properties": { - "coupon_id": { - "type": "integer" - } - } - }, - "admin.addCouponResponse": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - }, - "admin.addPointsRequest": { - "type": "object", - "properties": { - "kind": { - "type": "string" - }, - "points": { - "description": "正数=增加,负数=扣减", - "type": "integer" - }, - "remark": { - "type": "string" - }, - "valid_days": { - "type": "integer" - } - } - }, - "admin.addPointsResponse": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - }, - "admin.adminUserCouponItem": { - "type": "object", - "properties": { - "balance_amount": { - "type": "integer" - }, - "coupon_id": { - "type": "integer" - }, - "discount_type": { - "type": "integer" - }, - "discount_value": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "min_spend": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "scope_type": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "used_at": { - "type": "string" - }, - "used_order_id": { - "type": "integer" - }, - "valid_end": { - "type": "string" - }, - "valid_start": { - "type": "string" - } - } - }, - "admin.adminUserItem": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "channel_code": { - "type": "string" - }, - "channel_name": { - "type": "string" - }, - "coupons_count": { - "type": "integer" - }, - "created_at": { - "type": "string" - }, - "douyin_id": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "invite_code": { - "type": "string" - }, - "inviter_id": { - "type": "integer" - }, - "item_cards_count": { - "type": "integer" - }, - "nickname": { - "type": "string" - }, - "points_balance": { - "type": "integer" - }, - "seven_day_consume": { - "type": "integer" - }, - "today_consume": { - "type": "integer" - } - } - }, - "admin.assignItemCardRequest": { - "type": "object", - "required": [ - "card_id" - ], - "properties": { - "card_id": { - "type": "integer" - }, - "quantity": { - "type": "integer" - } - } - }, - "admin.bannerItem": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "image_url": { - "type": "string" - }, - "link_url": { - "type": "string" - }, - "sort": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "title": { - "type": "string" - } - } - }, - "admin.batchModifyRewardItem": { - "type": "object", - "required": [ - "reward_id" - ], - "properties": { - "reward_id": { - "type": "integer" - }, - "weight": { - "type": "number", - "minimum": 0 - } - } - }, - "admin.batchModifyRewardsRequest": { - "type": "object", - "required": [ - "rewards" - ], - "properties": { - "rewards": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.batchModifyRewardItem" - } - } - } - }, - "admin.batchUpdateProductsRequest": { - "type": "object", - "required": [ - "ids" - ], - "properties": { - "ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "status": { - "type": "integer" - }, - "stock": { - "type": "integer" - } - } - }, - "admin.batchUpdateProductsResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "updated_count": { - "type": "integer" - } - } - }, - "admin.categoryItem": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - }, - "admin.checkActivityGamePassesResponse": { - "type": "object", - "properties": { - "activity_id": { - "type": "integer" - }, - "can_delete": { - "type": "boolean" - }, - "message": { - "type": "string" - }, - "total_remaining": { - "type": "integer" - }, - "user_count": { - "type": "integer" - } - } - }, - "admin.copyActivityResponse": { - "type": "object", - "properties": { - "new_activity_id": { - "type": "integer" - }, - "status": { - "type": "string" - } - } - }, - "admin.createActivityRequest": { - "type": "object", - "required": [ - "activity_category_id", - "name" - ], - "properties": { - "activity_category_id": { - "type": "integer" - }, - "allow_coupons": { - "type": "integer" - }, - "allow_item_cards": { - "type": "integer" - }, - "banner": { - "type": "string" - }, - "draw_mode": { - "type": "string" - }, - "end_time": { - "type": "string" - }, - "gameplay_intro": { - "type": "string" - }, - "image": { - "type": "string" - }, - "interval_minutes": { - "type": "integer" - }, - "is_boss": { - "type": "integer" - }, - "min_participants": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "play_type": { - "type": "string" - }, - "price_draw": { - "type": "integer" - }, - "refund_coupon_amount": { - "type": "number" - }, - "refund_coupon_id": { - "type": "integer" - }, - "refund_coupon_type": { - "type": "string" - }, - "scheduled_delay_minutes": { - "type": "integer" - }, - "scheduled_time": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "status": { - "type": "integer" - } - } - }, - "admin.createBannerRequest": { - "type": "object", - "required": [ - "image_url", - "title" - ], - "properties": { - "image_url": { - "type": "string" - }, - "link_url": { - "type": "string" - }, - "sort": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "title": { - "type": "string" - } - } - }, - "admin.createBannerResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "message": { - "type": "string" - } - } - }, - "admin.createGamePassPackageRequest": { - "type": "object", - "required": [ - "name", - "pass_count", - "price" - ], - "properties": { - "activity_id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "original_price": { - "type": "integer" - }, - "pass_count": { - "type": "integer", - "minimum": 1 - }, - "price": { - "type": "integer", - "minimum": 0 - }, - "sort_order": { - "type": "integer" - }, - "status": { - "description": "1=上架 2=下架", - "type": "integer" - }, - "valid_days": { - "type": "integer" - } - } - }, - "admin.createGamePassPackageResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "message": { - "type": "string" - } - } - }, - "admin.createIssueRequest": { - "type": "object", - "required": [ - "issue_number" - ], - "properties": { - "issue_number": { - "type": "string" - }, - "sort": { - "type": "integer" - }, - "status": { - "type": "integer" - } - } - }, - "admin.createItemCardRequest": { - "type": "object", - "required": [ - "card_type", - "effect_type", - "name", - "price", - "scope_type" - ], - "properties": { - "activity_category_id": { - "type": "integer" - }, - "activity_id": { - "type": "integer" - }, - "boost_rate_x1000": { - "type": "integer" - }, - "card_type": { - "type": "integer" - }, - "effect_type": { - "type": "integer" - }, - "issue_id": { - "type": "integer" - }, - "max_effect_value_x1000": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "price": { - "type": "integer" - }, - "remark": { - "type": "string" - }, - "reward_multiplier_x1000": { - "type": "integer" - }, - "scope_type": { - "type": "integer" - }, - "stacking_strategy": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "valid_end_unix": { - "type": "integer" - }, - "valid_start_unix": { - "type": "integer" - } - } - }, - "admin.createItemCardResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "message": { - "type": "string" - } - } - }, - "admin.createProductCategoryRequest": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "parent_id": { - "type": "integer" - }, - "status": { - "type": "integer" - } - } - }, - "admin.createProductCategoryResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "message": { - "type": "string" - } - } - }, - "admin.createProductRequest": { - "type": "object", - "required": [ - "category_id", - "name", - "price", - "stock" - ], - "properties": { - "category_id": { - "type": "integer" - }, - "description": { - "type": "string" - }, - "images_json": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "stock": { - "type": "integer" - } - } - }, - "admin.createProductResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "message": { - "type": "string" - } - } - }, - "admin.createRewardsRequest": { - "type": "object", - "required": [ - "rewards" - ], - "properties": { - "rewards": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.rewardItem" - } - } - } - }, - "admin.createUserRequest": { - "type": "object", - "required": [ - "password", - "username" - ], - "properties": { - "avatar": { - "type": "string" - }, - "mobile": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "password": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "admin.createUserResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - }, - "admin.gamePassItem": { - "type": "object", - "properties": { - "activity_id": { - "type": "integer" - }, - "activity_name": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "expired_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "remaining": { - "type": "integer" - }, - "remark": { - "type": "string" - }, - "source": { - "type": "string" - }, - "total_granted": { - "type": "integer" - }, - "total_used": { - "type": "integer" - }, - "user_id": { - "type": "integer" - }, - "user_name": { - "type": "string" - } - } - }, - "admin.gamePassPackageItem": { - "type": "object", - "properties": { - "activity_id": { - "type": "integer" - }, - "activity_name": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "original_price": { - "type": "integer" - }, - "pass_count": { - "type": "integer" - }, - "price": { - "type": "integer" - }, - "sort_order": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "valid_days": { - "type": "integer" - } - } - }, - "admin.getOrderSnapshotsResponse": { - "type": "object", - "properties": { - "after_snapshot": { - "$ref": "#/definitions/snapshot.UserStateSnapshot" - }, - "before_snapshot": { - "$ref": "#/definitions/snapshot.UserStateSnapshot" - }, - "diff": { - "$ref": "#/definitions/snapshot.SnapshotDiff" - }, - "has_snapshots": { - "type": "boolean" - }, - "order": { - "type": "object", - "properties": { - "actual_amount": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "order_no": { - "type": "string" - }, - "paid_at": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "user_id": { - "type": "integer" - } - } - } - } - }, - "admin.getUserGamePassesResponse": { - "type": "object", - "properties": { - "activity_passes": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.gamePassItem" - } - }, - "global_remaining": { - "type": "integer" - }, - "total_remaining": { - "type": "integer" - }, - "user_id": { - "type": "integer" - } - } - }, - "admin.grantGamePassRequest": { - "type": "object", - "required": [ - "count", - "user_id" - ], - "properties": { - "activity_id": { - "description": "可选,NULL表示全局通用", - "type": "integer" - }, - "count": { - "type": "integer", - "minimum": 1 - }, - "remark": { - "type": "string" - }, - "user_id": { - "type": "integer" - }, - "valid_days": { - "description": "可选,NULL表示永久有效", - "type": "integer" - } - } - }, - "admin.grantGamePassResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "message": { - "type": "string" - } - } - }, - "admin.issueUserTokenResponse": { - "type": "object", - "properties": { - "expires_in": { - "type": "integer" - }, - "token": { - "type": "string" - } - } - }, - "admin.itemCardListItem": { - "type": "object", - "properties": { - "activity_category_id": { - "type": "integer" - }, - "activity_id": { - "type": "integer" - }, - "boost_rate_x1000": { - "type": "integer" - }, - "card_type": { - "type": "integer" - }, - "created_at": { - "type": "string" - }, - "effect_type": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "issue_id": { - "type": "integer" - }, - "max_effect_value_x1000": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "price": { - "type": "integer" - }, - "remark": { - "type": "string" - }, - "reward_multiplier_x1000": { - "type": "integer" - }, - "scope_type": { - "type": "integer" - }, - "stacking_strategy": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "updated_at": { - "type": "string" - }, - "valid_end": { - "type": "string" - }, - "valid_start": { - "type": "string" - } - } - }, - "admin.listActivitiesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.activityItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listBannersResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.bannerItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listCategoriesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.categoryItem" - } - } - } - }, - "admin.listCouponsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.adminUserCouponItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listGamePassPackagesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.gamePassPackageItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listGamePassesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.gamePassItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listInventoryResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/user.InventoryWithProduct" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listInvitesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.adminUserItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listIssuesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.activitysvcIssueData" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listItemCardsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.itemCardListItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listMatchingCardTypesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.matchingCardTypeResponse" - } - }, - "total": { - "type": "integer" - } - } - }, - "admin.listOrdersResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/user.OrderWithItems" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listPointsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/model.UserPointsLedger" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listProductCategoriesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.productCategoryListItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listProductsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.productItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listRewardsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.rewardItem" - } - } - } - }, - "admin.listShippingOrdersResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.ShippingOrderGroup" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listUserItemCardsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/user.ItemCardWithTemplate" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.listUsersResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.adminUserItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.loginRequest": { - "type": "object", - "required": [ - "password", - "username" - ], - "properties": { - "password": { - "description": "密码 (MD5加密后的密码)", - "type": "string" - }, - "username": { - "description": "用户名", - "type": "string" - } - } - }, - "admin.loginResponse": { - "type": "object", - "properties": { - "is_super": { - "description": "是否是超级管理员(1:是 0:否)", - "type": "integer" - }, - "token": { - "description": "登录成功后颁发的 Token", - "type": "string" - } - } - }, - "admin.matchingCardTypeRequest": { - "type": "object", - "required": [ - "code", - "name" - ], - "properties": { - "code": { - "type": "string" - }, - "image_url": { - "type": "string" - }, - "name": { - "type": "string" - }, - "quantity": { - "type": "integer" - }, - "sort": { - "type": "integer" - }, - "status": { - "type": "integer" - } - } - }, - "admin.matchingCardTypeResponse": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "image_url": { - "type": "string" - }, - "name": { - "type": "string" - }, - "quantity": { - "type": "integer" - }, - "sort": { - "type": "integer" - }, - "status": { - "type": "integer" - } - } - }, - "admin.modifyActivityRequest": { - "type": "object", - "properties": { - "activity_category_id": { - "type": "integer" - }, - "allow_coupons": { - "type": "integer" - }, - "allow_item_cards": { - "type": "integer" - }, - "banner": { - "type": "string" - }, - "draw_mode": { - "type": "string" - }, - "end_time": { - "type": "string" - }, - "force": { - "type": "boolean" - }, - "gameplay_intro": { - "type": "string" - }, - "image": { - "type": "string" - }, - "interval_minutes": { - "type": "integer" - }, - "is_boss": { - "type": "integer" - }, - "min_participants": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "play_type": { - "type": "string" - }, - "price_draw": { - "type": "integer" - }, - "refund_coupon_amount": { - "type": "number" - }, - "refund_coupon_id": { - "type": "integer" - }, - "refund_coupon_type": { - "type": "string" - }, - "scheduled_delay_minutes": { - "type": "integer" - }, - "scheduled_time": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "status": { - "type": "integer" - } - } - }, - "admin.modifyBannerRequest": { - "type": "object", - "properties": { - "image_url": { - "type": "string" - }, - "link_url": { - "type": "string" - }, - "sort": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "title": { - "type": "string" - } - } - }, - "admin.modifyGamePassPackageRequest": { - "type": "object", - "properties": { - "activity_id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "original_price": { - "type": "integer" - }, - "pass_count": { - "type": "integer" - }, - "price": { - "type": "integer" - }, - "sort_order": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "valid_days": { - "type": "integer" - } - } - }, - "admin.modifyIssueRequest": { - "type": "object", - "properties": { - "issue_number": { - "type": "string" - }, - "sort": { - "type": "integer" - }, - "status": { - "type": "integer" - } - } - }, - "admin.modifyItemCardRequest": { - "type": "object", - "properties": { - "activity_category_id": { - "type": "integer" - }, - "activity_id": { - "type": "integer" - }, - "boost_rate_x1000": { - "type": "integer" - }, - "card_type": { - "type": "integer" - }, - "effect_type": { - "type": "integer" - }, - "issue_id": { - "type": "integer" - }, - "max_effect_value_x1000": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "price": { - "type": "integer" - }, - "remark": { - "type": "string" - }, - "reward_multiplier_x1000": { - "type": "integer" - }, - "scope_type": { - "type": "integer" - }, - "stacking_strategy": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "valid_end_unix": { - "type": "integer" - }, - "valid_start_unix": { - "type": "integer" - } - } - }, - "admin.modifyProductCategoryRequest": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "parent_id": { - "type": "integer" - }, - "status": { - "type": "integer" - } - } - }, - "admin.modifyProductRequest": { - "type": "object", - "properties": { - "category_id": { - "type": "integer" - }, - "description": { - "type": "string" - }, - "images_json": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "stock": { - "type": "integer" - } - } - }, - "admin.modifyRewardRequest": { - "type": "object", - "properties": { - "is_boss": { - "type": "integer" - }, - "level": { - "type": "integer" - }, - "min_score": { - "type": "integer" - }, - "original_qty": { - "type": "integer" - }, - "product_id": { - "type": "integer" - }, - "quantity": { - "type": "integer" - }, - "sort": { - "type": "integer" - }, - "weight": { - "type": "number" - } - } - }, - "admin.pcSimpleMessage": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "admin.pointsBalanceResponse": { - "type": "object", - "properties": { - "balance": { - "type": "integer" - } - } - }, - "admin.productCategoryListItem": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "parent_id": { - "type": "integer" - }, - "status": { - "type": "integer" - } - } - }, - "admin.productItem": { - "type": "object", - "properties": { - "category_id": { - "type": "integer" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "images_json": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "integer" - }, - "sales": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "stock": { - "type": "integer" - } - } - }, - "admin.refreshResponse": { - "type": "object", - "properties": { - "expires_in": { - "type": "integer" - }, - "token": { - "type": "string" - } - } - }, - "admin.rewardItem": { - "type": "object", - "required": [ - "level", - "original_qty", - "quantity", - "weight" - ], - "properties": { - "id": { - "type": "integer" - }, - "is_boss": { - "type": "integer" - }, - "level": { - "type": "integer" - }, - "min_score": { - "type": "integer" - }, - "original_qty": { - "type": "integer" - }, - "product_id": { - "type": "integer" - }, - "product_image_url": { - "type": "string" - }, - "product_name": { - "type": "string" - }, - "product_price": { - "type": "number" - }, - "quantity": { - "type": "integer" - }, - "sort": { - "type": "integer" - }, - "weight": { - "type": "number" - } - } - }, - "admin.roleItem": { - "type": "object", - "properties": { - "createTime": { - "type": "string" - }, - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "roleCode": { - "type": "string" - }, - "roleId": { - "type": "integer" - }, - "roleName": { - "type": "string" - } - } - }, - "admin.roleListResponse": { - "type": "object", - "properties": { - "current": { - "type": "integer" - }, - "records": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.roleItem" - } - }, - "size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "admin.rollbackOrderRequest": { - "type": "object", - "properties": { - "confirm": { - "type": "boolean" - }, - "reason": { - "type": "string" - } - } - }, - "admin.rollbackOrderResponse": { - "type": "object", - "properties": { - "coupons_restored": { - "type": "integer" - }, - "error_msg": { - "type": "string" - }, - "inventory_revoked": { - "type": "integer" - }, - "item_cards_restored": { - "type": "integer" - }, - "points_restored": { - "type": "integer" - }, - "refund_amount": { - "type": "integer" - }, - "rollback_log_id": { - "type": "integer" - }, - "success": { - "type": "boolean" - } - } - }, - "admin.simpleMessage": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "admin.simpleMessageResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "admin.updateShippingRequest": { - "type": "object", - "properties": { - "express_code": { - "description": "快递公司编码", - "type": "string" - }, - "express_no": { - "description": "运单号", - "type": "string" - }, - "record_ids": { - "description": "发货记录ID列表", - "type": "array", - "items": { - "type": "integer" - } - }, - "status": { - "description": "状态", - "type": "integer" - } - } - }, - "admin.updateShippingResponse": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "updated_count": { - "type": "integer" - } - } - }, - "admin.userListItem": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "createBy": { - "type": "string" - }, - "createTime": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "nickName": { - "type": "string" - }, - "status": { - "type": "string" - }, - "updateBy": { - "type": "string" - }, - "updateTime": { - "type": "string" - }, - "userEmail": { - "type": "string" - }, - "userGender": { - "type": "string" - }, - "userName": { - "type": "string" - }, - "userPhone": { - "type": "string" - }, - "userRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "admin.userListResponse": { - "type": "object", - "properties": { - "current": { - "type": "integer" - }, - "records": { - "type": "array", - "items": { - "$ref": "#/definitions/admin.userListItem" - } - }, - "size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.MatchingRewardInfo": { - "type": "object", - "properties": { - "level": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "product_image": { - "description": "商品图片", - "type": "string" - }, - "product_name": { - "description": "商品原始名称", - "type": "string" - }, - "reward_id": { - "type": "integer" - } - } - }, - "app.activityDetailResponse": { - "type": "object", - "properties": { - "activity_category_id": { - "type": "integer" - }, - "allow_coupons": { - "type": "boolean" - }, - "allow_item_cards": { - "type": "boolean" - }, - "banner": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "draw_mode": { - "type": "string" - }, - "end_time": { - "type": "string" - }, - "gameplay_intro": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "image": { - "type": "string" - }, - "interval_minutes": { - "type": "integer" - }, - "is_boss": { - "type": "integer" - }, - "last_settled_at": { - "type": "string" - }, - "min_participants": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "play_type": { - "type": "string" - }, - "price_draw": { - "type": "integer" - }, - "refund_coupon_id": { - "type": "integer" - }, - "scheduled_time": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "updated_at": { - "type": "string" - } - } - }, - "app.activityItem": { - "type": "object", - "properties": { - "activity_category_id": { - "type": "integer" - }, - "banner": { - "type": "string" - }, - "category_name": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "image": { - "type": "string" - }, - "is_boss": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "price_draw": { - "type": "integer" - }, - "status": { - "type": "integer" - } - } - }, - "app.addAddressRequest": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "city": { - "type": "string" - }, - "district": { - "type": "string" - }, - "is_default": { - "type": "boolean" - }, - "mobile": { - "type": "string" - }, - "name": { - "type": "string" - }, - "province": { - "type": "string" - } - } - }, - "app.addAddressResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer" - } - } - }, - "app.addressShareCreateRequest": { - "type": "object", - "properties": { - "expires_at": { - "type": "string" - }, - "expires_in_minutes": { - "type": "integer" - }, - "inventory_id": { - "type": "integer" - } - } - }, - "app.addressShareCreateResponse": { - "type": "object", - "properties": { - "expires_at": { - "type": "string" - }, - "share_token": { - "type": "string" - }, - "share_url": { - "type": "string" - }, - "short_link": { - "type": "string" - } - } - }, - "app.addressShareRevokeRequest": { - "type": "object", - "properties": { - "inventory_id": { - "type": "integer" - } - } - }, - "app.addressShareSubmitRequest": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "city": { - "type": "string" - }, - "district": { - "type": "string" - }, - "mobile": { - "type": "string" - }, - "name": { - "type": "string" - }, - "province": { - "type": "string" - }, - "share_token": { - "type": "string" - } - } - }, - "app.addressShareSubmitResponse": { - "type": "object", - "properties": { - "address_id": { - "type": "integer" - } - } - }, - "app.appBannerItem": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "image_url": { - "type": "string" - }, - "link_url": { - "type": "string" - }, - "sort": { - "type": "integer" - }, - "title": { - "type": "string" - } - } - }, - "app.appCategoryItem": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - }, - "app.appNoticeItem": { - "type": "object", - "properties": { - "content": { - "type": "string" - } - } - }, - "app.bindDouyinPhoneRequest": { - "type": "object", - "properties": { - "code": { - "type": "string" - } - } - }, - "app.bindDouyinPhoneResponse": { - "type": "object", - "properties": { - "mobile": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - }, - "app.bindPhoneRequest": { - "type": "object", - "properties": { - "code": { - "type": "string" - } - } - }, - "app.bindPhoneResponse": { - "type": "object", - "properties": { - "mobile": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - }, - "app.cancelOrderRequest": { - "type": "object", - "properties": { - "reason": { - "type": "string" - } - } - }, - "app.cancelOrderResponse": { - "type": "object", - "properties": { - "cancelled_at": { - "type": "string" - }, - "order_id": { - "type": "integer" - }, - "order_no": { - "type": "string" - }, - "status": { - "type": "integer" - } - } - }, - "app.cancelShippingRequest": { - "type": "object", - "properties": { - "batch_no": { - "description": "批次号(与inventory_id二选一,取消整批)", - "type": "string" - }, - "inventory_id": { - "description": "单个资产ID(与batch_no二选一)", - "type": "integer" - } - } - }, - "app.cancelShippingResponse": { - "type": "object", - "properties": { - "cancelled_count": { - "description": "成功取消的数量", - "type": "integer" - } - } - }, - "app.couponDetail": { - "type": "object", - "properties": { - "amount": { - "description": "原始面值", - "type": "integer" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "remaining": { - "description": "剩余额度", - "type": "integer" - }, - "status": { - "type": "integer" - }, - "use_count": { - "description": "使用次数", - "type": "integer" - }, - "used_amount": { - "description": "累计已使用金额", - "type": "integer" - }, - "valid_end": { - "type": "string" - }, - "valid_start": { - "type": "string" - } - } - }, - "app.couponItem": { - "type": "object", - "properties": { - "amount": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "remaining": { - "type": "integer" - }, - "rules": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "used_at": { - "description": "使用时间(已使用时返回)", - "type": "string" - }, - "valid_end": { - "type": "string" - }, - "valid_start": { - "type": "string" - } - } - }, - "app.couponStatsResponse": { - "type": "object", - "properties": { - "expired_count": { - "description": "已过期优惠券数量", - "type": "integer" - }, - "total_remaining": { - "description": "可用优惠券总余额(分)", - "type": "integer" - }, - "total_saved": { - "description": "累计节省金额(分)", - "type": "integer" - }, - "unused_count": { - "description": "可用优惠券数量", - "type": "integer" - }, - "used_count": { - "description": "已使用优惠券数量", - "type": "integer" - } - } - }, - "app.couponUsageItem": { - "type": "object", - "properties": { - "activity_name": { - "description": "活动名称", - "type": "string" - }, - "amount": { - "description": "本次使用金额(正数)", - "type": "integer" - }, - "created_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "order_no": { - "description": "订单号", - "type": "string" - } - } - }, - "app.douyinLoginRequest": { - "type": "object", - "properties": { - "anonymous_code": { - "type": "string" - }, - "channel_code": { - "type": "string" - }, - "code": { - "type": "string" - }, - "invite_code": { - "type": "string" - } - } - }, - "app.douyinLoginResponse": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "invite_code": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "token": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - } - }, - "app.drawLogGroup": { - "type": "object", - "properties": { - "level": { - "type": "integer" - }, - "level_name": { - "type": "string" - }, - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.drawLogItem" - } - } - } - }, - "app.drawLogItem": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "current_level": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "is_winner": { - "type": "integer" - }, - "issue_id": { - "type": "integer" - }, - "level": { - "type": "integer" - }, - "order_id": { - "type": "integer" - }, - "reward_id": { - "type": "integer" - }, - "reward_image": { - "type": "string" - }, - "reward_name": { - "type": "string" - }, - "user_id": { - "type": "integer" - }, - "user_name": { - "type": "string" - } - } - }, - "app.getAppProductDetailResponse": { - "type": "object", - "properties": { - "album": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "points_required": { - "type": "integer" - }, - "price": { - "type": "integer" - }, - "recommendations": { - "type": "array", - "items": { - "$ref": "#/definitions/app.listAppProductsItem" - } - }, - "sales": { - "type": "integer" - }, - "service": { - "type": "array", - "items": { - "type": "string" - } - }, - "stock": { - "type": "integer" - } - } - }, - "app.getGamePassesResponse": { - "type": "object", - "properties": { - "global_remaining": { - "description": "全局通用次数", - "type": "integer" - }, - "passes": { - "type": "array", - "items": { - "$ref": "#/definitions/app.userGamePassItem" - } - }, - "total_remaining": { - "type": "integer" - } - } - }, - "app.getPackagesResponse": { - "type": "object", - "properties": { - "packages": { - "type": "array", - "items": { - "$ref": "#/definitions/app.packageItem" - } - } - } - }, - "app.inviteUserItem": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "invite_code": { - "type": "string" - }, - "nickname": { - "type": "string" - } - } - }, - "app.issueItem": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "issue_number": { - "type": "string" - }, - "remaining_prize_quantity": { - "type": "integer" - }, - "sort": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "total_prize_quantity": { - "type": "integer" - } - } - }, - "app.joinLotteryRequest": { - "type": "object", - "properties": { - "activity_id": { - "type": "integer" - }, - "channel": { - "type": "string" - }, - "count": { - "type": "integer" - }, - "coupon_id": { - "type": "integer" - }, - "issue_id": { - "type": "integer" - }, - "item_card_id": { - "type": "integer" - }, - "slot_index": { - "type": "array", - "items": { - "type": "integer" - } - }, - "use_game_pass": { - "type": "boolean" - }, - "use_points": { - "type": "integer" - } - } - }, - "app.joinLotteryResponse": { - "type": "object", - "properties": { - "actual_amount": { - "type": "integer" - }, - "draw_mode": { - "type": "string" - }, - "join_id": { - "type": "string" - }, - "order_no": { - "type": "string" - }, - "queued": { - "type": "boolean" - }, - "reward_id": { - "type": "integer" - }, - "reward_name": { - "type": "string" - }, - "status": { - "type": "integer" - } - } - }, - "app.jsapiPreorderRequest": { - "type": "object", - "properties": { - "openid": { - "type": "string" - }, - "order_no": { - "type": "string" - } - } - }, - "app.jsapiPreorderResponse": { - "type": "object", - "properties": { - "nonceStr": { - "type": "string" - }, - "package": { - "type": "string" - }, - "paySign": { - "type": "string" - }, - "signType": { - "type": "string" - }, - "timeStamp": { - "type": "string" - } - } - }, - "app.listActivitiesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.activityItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listAddressesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/model.UserAddresses" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listAppBannersResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.appBannerItem" - } - } - } - }, - "app.listAppCategoriesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.appCategoryItem" - } - } - } - }, - "app.listAppNoticesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.appNoticeItem" - } - } - } - }, - "app.listAppProductsItem": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "in_stock": { - "type": "boolean" - }, - "main_image": { - "type": "string" - }, - "name": { - "type": "string" - }, - "points_required": { - "type": "integer" - }, - "price": { - "type": "integer" - }, - "sales": { - "type": "integer" - } - } - }, - "app.listAppProductsResponse": { - "type": "object", - "properties": { - "currentPage": { - "type": "integer" - }, - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.listAppProductsItem" - } - }, - "pageSize": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listCouponUsageResponse": { - "type": "object", - "properties": { - "coupon": { - "$ref": "#/definitions/app.couponDetail" - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "records": { - "type": "array", - "items": { - "$ref": "#/definitions/app.couponUsageItem" - } - }, - "total": { - "type": "integer" - } - } - }, - "app.listCouponsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.couponItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listDrawLogsByLevelResponse": { - "type": "object", - "properties": { - "groups": { - "type": "array", - "items": { - "$ref": "#/definitions/app.drawLogGroup" - } - } - } - }, - "app.listDrawLogsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.drawLogItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listInventoryResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/user.AggregatedInventory" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listInvitesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.inviteUserItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listIssueChoicesResponse": { - "type": "object", - "properties": { - "available": { - "type": "array", - "items": { - "type": "integer" - } - }, - "claimed": { - "type": "array", - "items": { - "type": "integer" - } - }, - "total_slots": { - "type": "integer" - } - } - }, - "app.listIssuesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.issueItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listOrdersResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/user.OrderWithItems" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listPointsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/model.UserPointsLedger" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listRewardsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.rewardItem" - } - }, - "play_type": { - "description": "活动类型", - "type": "string" - } - } - }, - "app.listShipmentsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/user.ShipmentGroup" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listStoreItem": { - "type": "object", - "properties": { - "discount_type": { - "type": "integer" - }, - "discount_value": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "in_stock": { - "type": "boolean" - }, - "kind": { - "type": "string" - }, - "main_image": { - "type": "string" - }, - "min_spend": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "points_required": { - "type": "integer" - }, - "price": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "supported": { - "type": "boolean" - } - } - }, - "app.listStoreItemsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/app.listStoreItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listUserItemCardUsesResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/model.ActivityDrawEffects" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.listUserItemCardsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/user.ItemCardWithTemplate" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "app.matchingGameCardsResponse": { - "type": "object", - "properties": { - "all_cards": { - "type": "array", - "items": { - "$ref": "#/definitions/activity.MatchingCard" - } - }, - "game_id": { - "type": "string" - } - } - }, - "app.matchingGameCheckRequest": { - "type": "object", - "required": [ - "game_id" - ], - "properties": { - "game_id": { - "type": "string" - }, - "total_pairs": { - "description": "客户端上报的消除总对数", - "type": "integer" - } - } - }, - "app.matchingGameCheckResponse": { - "type": "object", - "properties": { - "finished": { - "type": "boolean" - }, - "game_id": { - "type": "string" - }, - "reward": { - "$ref": "#/definitions/app.MatchingRewardInfo" - }, - "total_pairs": { - "type": "integer" - } - } - }, - "app.matchingGamePreOrderRequest": { - "type": "object", - "properties": { - "coupon_id": { - "type": "integer" - }, - "issue_id": { - "type": "integer" - }, - "item_card_id": { - "type": "integer" - }, - "position": { - "type": "string" - }, - "use_game_pass": { - "description": "新增:是否使用次数卡", - "type": "boolean" - } - } - }, - "app.matchingGamePreOrderResponse": { - "type": "object", - "properties": { - "game_id": { - "type": "string" - }, - "order_no": { - "type": "string" - }, - "pay_status": { - "description": "1=Pending, 2=Paid", - "type": "integer" - }, - "server_seed_hash": { - "type": "string" - } - } - }, - "app.modifyUserRequest": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "nickname": { - "type": "string" - } - } - }, - "app.modifyUserResponse": { - "type": "object", - "properties": { - "user": { - "$ref": "#/definitions/app.userItem" - } - } - }, - "app.okDeleteResponse": { - "type": "object", - "properties": { - "ok": { - "type": "boolean" - } - } - }, - "app.okResponse": { - "type": "object", - "properties": { - "ok": { - "type": "boolean" - } - } - }, - "app.orderResultItem": { - "type": "object", - "properties": { - "draw_index": { - "type": "integer" - }, - "image": { - "type": "string" - }, - "level": { - "type": "integer" - }, - "reward_id": { - "type": "integer" - }, - "reward_name": { - "type": "string" - } - } - }, - "app.orderResultResponse": { - "type": "object", - "properties": { - "completed": { - "type": "integer" - }, - "count": { - "type": "integer" - }, - "draw_mode": { - "type": "string" - }, - "nextPollMs": { - "type": "integer" - }, - "next_draw_time": { - "type": "string" - }, - "receipt": { - "type": "object", - "additionalProperties": {} - }, - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/app.orderResultItem" - } - }, - "seed_hex": { - "type": "string" - }, - "status": { - "type": "string" - } - } - }, - "app.packageItem": { - "type": "object", - "properties": { - "activity_id": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "original_price": { - "type": "integer" - }, - "pass_count": { - "type": "integer" - }, - "price": { - "type": "integer" - }, - "valid_days": { - "type": "integer" - } - } - }, - "app.pointsBalanceResponse": { - "type": "object", - "properties": { - "balance": { - "type": "integer" - } - } - }, - "app.purchasePackageRequest": { - "type": "object", - "required": [ - "package_id" - ], - "properties": { - "count": { - "description": "购买数量", - "type": "integer" - }, - "package_id": { - "type": "integer" - } - } - }, - "app.purchasePackageResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "order_no": { - "type": "string" - } - } - }, - "app.redeemCouponRequest": { - "type": "object", - "properties": { - "coupon_id": { - "type": "integer" - } - } - }, - "app.redeemCouponResponse": { - "type": "object", - "properties": { - "coupon_id": { - "type": "integer" - }, - "ledger_id": { - "type": "integer" - }, - "message": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - }, - "app.redeemInventoryRequest": { - "type": "object", - "properties": { - "inventory_ids": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "app.redeemInventoryResponse": { - "type": "object", - "properties": { - "points": { - "type": "integer" - } - } - }, - "app.redeemItemCardRequest": { - "type": "object", - "properties": { - "card_id": { - "type": "integer" - }, - "quantity": { - "type": "integer" - } - } - }, - "app.redeemItemCardResponse": { - "type": "object", - "properties": { - "card_id": { - "type": "integer" - }, - "ledger_id": { - "type": "integer" - }, - "message": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - }, - "app.redeemProductRequest": { - "type": "object", - "properties": { - "product_id": { - "type": "integer" - }, - "quantity": { - "type": "integer" - } - } - }, - "app.redeemProductResponse": { - "type": "object", - "properties": { - "inventory_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "ledger_id": { - "type": "integer" - }, - "message": { - "type": "string" - }, - "order_id": { - "type": "integer" - }, - "success": { - "type": "boolean" - } - } - }, - "app.requestShippingBatchRequest": { - "type": "object", - "properties": { - "address_id": { - "type": "integer" - }, - "inventory_ids": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "app.requestShippingBatchResponse": { - "type": "object", - "properties": { - "address_id": { - "type": "integer" - }, - "batch_no": { - "type": "string" - }, - "failed": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "skipped": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - }, - "success_ids": { - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "app.requestShippingRequest": { - "type": "object", - "properties": { - "inventory_id": { - "type": "integer" - } - } - }, - "app.requestShippingResponse": { - "type": "object", - "properties": { - "address_id": { - "type": "integer" - } - } - }, - "app.resultResponse": { - "type": "object", - "properties": { - "receipt": { - "type": "object", - "additionalProperties": {} - }, - "result": { - "type": "object", - "additionalProperties": {} - }, - "results": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": {} - } - } - } - }, - "app.rewardItem": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "is_boss": { - "type": "integer" - }, - "level": { - "type": "integer" - }, - "min_score": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "original_qty": { - "type": "integer" - }, - "prize_level": { - "description": "兼容部分前端逻辑", - "type": "integer" - }, - "product_id": { - "type": "integer" - }, - "product_image": { - "type": "string" - }, - "quantity": { - "type": "integer" - }, - "sort": { - "type": "integer" - }, - "weight": { - "type": "integer" - } - } - }, - "app.sendSmsCodeRequest": { - "type": "object", - "required": [ - "mobile" - ], - "properties": { - "mobile": { - "type": "string" - } - } - }, - "app.sendSmsCodeResponse": { - "type": "object", - "properties": { - "expire_seconds": { - "type": "integer" - }, - "success": { - "type": "boolean" - } - } - }, - "app.smsLoginRequest": { - "type": "object", - "required": [ - "code", - "mobile" - ], - "properties": { - "code": { - "type": "string" - }, - "invite_code": { - "type": "string" - }, - "mobile": { - "type": "string" - } - } - }, - "app.smsLoginResponse": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "invite_code": { - "type": "string" - }, - "is_new_user": { - "type": "boolean" - }, - "mobile": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "openid": { - "type": "string" - }, - "token": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - } - }, - "app.updateAddressRequest": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "city": { - "type": "string" - }, - "district": { - "type": "string" - }, - "is_default": { - "type": "boolean" - }, - "mobile": { - "type": "string" - }, - "name": { - "type": "string" - }, - "province": { - "type": "string" - } - } - }, - "app.userGamePassItem": { - "type": "object", - "properties": { - "activity_id": { - "type": "integer" - }, - "activity_name": { - "type": "string" - }, - "expired_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "remaining": { - "type": "integer" - }, - "source": { - "type": "string" - } - } - }, - "app.userItem": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "balance": { - "description": "Points", - "type": "integer" - }, - "id": { - "type": "integer" - }, - "invite_code": { - "type": "string" - }, - "inviter_id": { - "type": "integer" - }, - "mobile": { - "type": "string" - }, - "nickname": { - "type": "string" - } - } - }, - "app.userStatsResponse": { - "type": "object", - "properties": { - "coupon_count": { - "type": "integer" - }, - "item_card_count": { - "type": "integer" - }, - "points_balance": { - "type": "integer" - } - } - }, - "app.weixinLoginRequest": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "douyin_id": { - "type": "string" - }, - "invite_code": { - "type": "string" - } - } - }, - "app.weixinLoginResponse": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "invite_code": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "openid": { - "type": "string" - }, - "token": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - } - }, - "code.Failure": { - "type": "object", - "properties": { - "code": { - "description": "业务码", - "type": "integer" - }, - "message": { - "description": "描述信息", - "type": "string" - } - } - }, - "game.consumeTicketRequest": { - "type": "object", - "properties": { - "game_code": { - "type": "string" - }, - "ticket": { - "type": "string" - }, - "user_id": { - "type": "string" - } - } - }, - "game.consumeTicketResponse": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - }, - "game.enterGameRequest": { - "type": "object", - "required": [ - "game_code" - ], - "properties": { - "game_code": { - "type": "string" - } - } - }, - "game.enterGameResponse": { - "type": "object", - "properties": { - "client_url": { - "type": "string" - }, - "expires_at": { - "type": "string" - }, - "game_token": { - "type": "string" - }, - "nakama_key": { - "type": "string" - }, - "nakama_server": { - "type": "string" - }, - "remaining_times": { - "type": "integer" - } - } - }, - "game.grantTicketRequest": { - "type": "object", - "required": [ - "amount", - "game_code" - ], - "properties": { - "amount": { - "type": "integer", - "minimum": 1 - }, - "game_code": { - "type": "string" - }, - "remark": { - "type": "string" - } - } - }, - "game.settleRequest": { - "type": "object", - "properties": { - "match_id": { - "type": "string" - }, - "score": { - "type": "integer" - }, - "ticket": { - "type": "string" - }, - "user_id": { - "type": "string" - }, - "win": { - "type": "boolean" - } - } - }, - "game.settleResponse": { - "type": "object", - "properties": { - "reward": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - }, - "game.validateTokenRequest": { - "type": "object", - "required": [ - "game_token" - ], - "properties": { - "game_token": { - "type": "string" - } - } - }, - "game.validateTokenResponse": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "error": { - "type": "string" - }, - "game_type": { - "type": "string" - }, - "ticket": { - "type": "string" - }, - "user_id": { - "type": "integer" - }, - "username": { - "type": "string" - }, - "valid": { - "type": "boolean" - } - } - }, - "game.verifyRequest": { - "type": "object", - "properties": { - "ticket": { - "type": "string" - }, - "user_id": { - "type": "string" - } - } - }, - "game.verifyResponse": { - "type": "object", - "properties": { - "game_config": { - "type": "object", - "additionalProperties": {} - }, - "user_id": { - "type": "string" - }, - "valid": { - "type": "boolean" - } - } - }, - "minesweeper.SettleGameRequest": { - "type": "object", - "properties": { - "match_id": { - "type": "string" - }, - "metadata": { - "type": "string" - }, - "score": { - "type": "integer" - }, - "ticket": { - "type": "string" - }, - "user_id": { - "type": "string" - }, - "win": { - "type": "boolean" - } - } - }, - "minesweeper.SettleGameResponse": { - "type": "object", - "properties": { - "reward": { - "type": "string" - }, - "success": { - "type": "boolean" - } - } - }, - "minesweeper.VerifyTicketRequest": { - "type": "object", - "properties": { - "ticket": { - "type": "string" - }, - "user_id": { - "type": "string" - } - } - }, - "minesweeper.VerifyTicketResponse": { - "type": "object", - "properties": { - "remaining_times": { - "type": "integer" - }, - "user_id": { - "type": "string" - }, - "valid": { - "type": "boolean" - } - } - }, - "model.ActivityDrawEffects": { - "type": "object", - "properties": { - "activity_category_id": { - "description": "范围快照-活动分类ID", - "type": "integer" - }, - "activity_id": { - "description": "范围快照-活动ID", - "type": "integer" - }, - "applied": { - "description": "是否生效:0否 1是", - "type": "integer" - }, - "card_type": { - "description": "卡类型快照", - "type": "integer" - }, - "created_at": { - "description": "创建时间", - "type": "string" - }, - "draw_log_id": { - "description": "抽奖日志ID(activity_draw_logs.id)", - "type": "integer" - }, - "effect_type": { - "description": "效果类型快照", - "type": "integer" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "issue_id": { - "description": "范围快照-期ID", - "type": "integer" - }, - "probability_delta_x1000": { - "description": "概率相对增益(千分比)", - "type": "integer" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "reward_multiplier_x1000": { - "description": "奖励倍数(千分比)", - "type": "integer" - }, - "scope_type": { - "description": "适用范围快照", - "type": "integer" - }, - "system_item_card_id": { - "description": "卡模板ID(system_item_cards.id)", - "type": "integer" - }, - "user_id": { - "description": "用户ID(users.id)", - "type": "integer" - }, - "user_item_card_id": { - "description": "用户卡实例ID(user_item_cards.id)", - "type": "integer" - } - } - }, - "model.OrderItems": { - "type": "object", - "properties": { - "created_at": { - "description": "创建时间", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "order_id": { - "description": "订单ID(orders.id)", - "type": "integer" - }, - "price": { - "description": "成交单价(分)", - "type": "integer" - }, - "product_id": { - "description": "商品ID(products.id)", - "type": "integer" - }, - "product_images": { - "description": "商品图片快照(JSON)", - "type": "string" - }, - "quantity": { - "description": "购买数量", - "type": "integer" - }, - "status": { - "description": "行状态:1正常 2取消", - "type": "integer" - }, - "title": { - "description": "商品标题快照", - "type": "string" - }, - "total_amount": { - "description": "行应付总额(分)", - "type": "integer" - } - } - }, - "model.ShippingRecords": { - "type": "object", - "properties": { - "address_id": { - "description": "收货地址ID(user_addresses.id)", - "type": "integer" - }, - "batch_no": { - "description": "批次号(批量发货时用于聚合)", - "type": "string" - }, - "created_at": { - "description": "创建时间", - "type": "string" - }, - "express_code": { - "description": "快递公司编码", - "type": "string" - }, - "express_no": { - "description": "运单号", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "inventory_id": { - "description": "资产ID(抽奖产物发货时使用)", - "type": "integer" - }, - "order_id": { - "description": "关联订单ID(orders.id,抽奖产物可为空)", - "type": "integer" - }, - "order_item_id": { - "description": "订单行ID(商城直发时使用)", - "type": "integer" - }, - "price": { - "description": "行价格(分,可选)", - "type": "integer" - }, - "product_id": { - "description": "商品ID(统计/冗余)", - "type": "integer" - }, - "quantity": { - "description": "发货数量", - "type": "integer" - }, - "received_at": { - "description": "签收时间", - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "shipped_at": { - "description": "发货时间", - "type": "string" - }, - "status": { - "description": "发货状态:1待发货 2已发货 3已签收 4异常", - "type": "integer" - }, - "updated_at": { - "description": "更新时间", - "type": "string" - }, - "user_id": { - "description": "收件用户ID(user_members.id)", - "type": "integer" - } - } - }, - "model.UserAddresses": { - "type": "object", - "properties": { - "address": { - "description": "详细地址", - "type": "string" - }, - "city": { - "description": "市", - "type": "string" - }, - "created_at": { - "description": "创建时间", - "type": "string" - }, - "default_user_unique": { - "description": "用于唯一约束的生成列:默认地址→user_id", - "type": "integer" - }, - "district": { - "description": "区/县", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "is_default": { - "description": "是否默认地址:0否 1是", - "type": "integer" - }, - "mobile": { - "description": "收件人手机号", - "type": "string" - }, - "name": { - "description": "收件人姓名", - "type": "string" - }, - "province": { - "description": "省", - "type": "string" - }, - "updated_at": { - "description": "更新时间", - "type": "string" - }, - "user_id": { - "description": "用户ID(user_members.id)", - "type": "integer" - } - } - }, - "model.UserPointsLedger": { - "type": "object", - "properties": { - "action": { - "description": "变更动作:signin/order_deduct/refund_restore/manual", - "type": "string" - }, - "created_at": { - "description": "创建时间", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "points": { - "description": "积分变动值(正增负减)", - "type": "integer" - }, - "ref_id": { - "description": "关联ID(如订单号/记录ID)", - "type": "string" - }, - "ref_table": { - "description": "关联表名(如orders/payment_refund)", - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "user_id": { - "description": "用户ID(user_members.id)", - "type": "integer" - } - } - }, - "pay.notifyAck": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - } - }, - "snapshot.CouponInfo": { - "type": "object", - "properties": { - "balance_amount": { - "type": "integer" - }, - "coupon_id": { - "type": "integer" - }, - "coupon_name": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "user_coupon_id": { - "type": "integer" - }, - "valid_end": { - "type": "string" - } - } - }, - "snapshot.ItemCardInfo": { - "type": "object", - "properties": { - "card_id": { - "type": "integer" - }, - "card_name": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "user_item_card_id": { - "type": "integer" - }, - "valid_end": { - "type": "string" - } - } - }, - "snapshot.PointsInfo": { - "type": "object", - "properties": { - "balance": { - "type": "integer" - }, - "version": { - "type": "integer" - } - } - }, - "snapshot.SnapshotDiff": { - "type": "object", - "properties": { - "coupons_used": { - "type": "array", - "items": { - "$ref": "#/definitions/snapshot.CouponInfo" - } - }, - "inventory_added": { - "type": "integer" - }, - "item_cards_used": { - "type": "array", - "items": { - "$ref": "#/definitions/snapshot.ItemCardInfo" - } - }, - "points_changed": { - "type": "integer" - } - } - }, - "snapshot.UserInfo": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "mobile": { - "type": "string" - }, - "nickname": { - "type": "string" - } - } - }, - "snapshot.UserStateSnapshot": { - "type": "object", - "properties": { - "coupons": { - "type": "array", - "items": { - "$ref": "#/definitions/snapshot.CouponInfo" - } - }, - "inventory_count": { - "type": "integer" - }, - "item_cards": { - "type": "array", - "items": { - "$ref": "#/definitions/snapshot.ItemCardInfo" - } - }, - "points": { - "$ref": "#/definitions/snapshot.PointsInfo" - }, - "snapshot_time": { - "type": "string" - }, - "user": { - "$ref": "#/definitions/snapshot.UserInfo" - } - } - }, - "taskcenter.claimTaskRequest": { - "type": "object", - "properties": { - "tier_id": { - "type": "integer" - } - } - }, - "taskcenter.createTaskRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "end_time": { - "type": "string" - }, - "name": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "visibility": { - "type": "integer" - } - } - }, - "taskcenter.listTasksResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/taskcenter.taskItem" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "taskcenter.modifyTaskRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "end_time": { - "type": "string" - }, - "name": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "visibility": { - "type": "integer" - } - } - }, - "taskcenter.simulateInviteSuccessRequest": { - "type": "object", - "properties": { - "invitee_id": { - "type": "integer" - }, - "inviter_id": { - "type": "integer" - } - } - }, - "taskcenter.simulateOrderPaidRequest": { - "type": "object", - "properties": { - "order_id": { - "type": "integer" - }, - "user_id": { - "type": "integer" - } - } - }, - "taskcenter.taskItem": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "end_time": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "rewards": { - "type": "array", - "items": { - "$ref": "#/definitions/taskcenter.taskRewardItem" - } - }, - "start_time": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "tiers": { - "type": "array", - "items": { - "$ref": "#/definitions/taskcenter.taskTierItem" - } - } - } - }, - "taskcenter.taskProgressResponse": { - "type": "object", - "properties": { - "claimed_tiers": { - "type": "array", - "items": { - "type": "integer" - } - }, - "first_order": { - "type": "boolean" - }, - "invite_count": { - "type": "integer" - }, - "order_amount": { - "type": "integer" - }, - "order_count": { - "type": "integer" - }, - "task_id": { - "type": "integer" - }, - "user_id": { - "type": "integer" - } - } - }, - "taskcenter.taskRewardItem": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "quantity": { - "type": "integer" - }, - "reward_name": { - "type": "string" - }, - "reward_payload": { - "type": "object", - "additionalProperties": {} - }, - "reward_type": { - "type": "string" - }, - "tier_id": { - "type": "integer" - } - } - }, - "taskcenter.taskTierItem": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "metric": { - "type": "string" - }, - "operator": { - "type": "string" - }, - "priority": { - "type": "integer" - }, - "repeatable": { - "type": "integer" - }, - "threshold": { - "type": "integer" - }, - "window": { - "type": "string" - } - } - }, - "taskcenter.upsertRewardsRequest": { - "type": "object", - "properties": { - "rewards": { - "type": "array", - "items": { - "type": "object", - "properties": { - "quantity": { - "type": "integer" - }, - "reward_payload": { - "type": "array", - "items": { - "type": "integer" - } - }, - "reward_type": { - "type": "string" - }, - "tier_id": { - "type": "integer" - } - } - } - } - } - }, - "taskcenter.upsertTiersRequest": { - "type": "object", - "properties": { - "tiers": { - "type": "array", - "items": { - "type": "object", - "properties": { - "activity_id": { - "type": "integer" - }, - "extra_params": { - "type": "array", - "items": { - "type": "integer" - } - }, - "metric": { - "type": "string" - }, - "operator": { - "type": "string" - }, - "priority": { - "type": "integer" - }, - "repeatable": { - "type": "integer" - }, - "threshold": { - "type": "integer" - }, - "window": { - "type": "string" - } - } - } - } - } - }, - "user.AggregatedInventory": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "has_shipment": { - "type": "boolean" - }, - "inventory_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "product_id": { - "type": "integer" - }, - "product_images": { - "type": "string" - }, - "product_name": { - "type": "string" - }, - "product_price": { - "type": "integer" - }, - "shipping_status": { - "type": "integer" - }, - "status": { - "description": "用于区分 1持有 3已处理", - "type": "integer" - }, - "updated_at": { - "type": "string" - } - } - }, - "user.CouponSimpleInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "description": "1:满减 2:折扣", - "type": "integer" - }, - "user_coupon_id": { - "type": "integer" - }, - "value": { - "type": "integer" - } - } - }, - "user.DrawReceiptInfo": { - "type": "object", - "properties": { - "algo_version": { - "type": "string" - }, - "client_id": { - "type": "integer" - }, - "client_seed": { - "type": "string" - }, - "draw_id": { - "type": "integer" - }, - "draw_index": { - "type": "integer" - }, - "draw_log_id": { - "type": "integer" - }, - "items_root": { - "type": "string" - }, - "items_snapshot": { - "type": "string" - }, - "nonce": { - "type": "integer" - }, - "rand_proof": { - "type": "string" - }, - "reward_id": { - "type": "integer" - }, - "round_id": { - "type": "integer" - }, - "selected_index": { - "type": "integer" - }, - "server_seed_hash": { - "type": "string" - }, - "server_sub_seed": { - "type": "string" - }, - "signature": { - "type": "string" - }, - "timestamp": { - "type": "integer" - }, - "weights_total": { - "type": "integer" - } - } - }, - "user.InventoryWithProduct": { - "type": "object", - "properties": { - "activity_id": { - "description": "来源活动ID", - "type": "integer" - }, - "created_at": { - "description": "创建时间", - "type": "string" - }, - "has_shipment": { - "type": "boolean" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "order_id": { - "description": "来源订单ID", - "type": "integer" - }, - "product_id": { - "description": "资产对应商品ID(实物奖/商品)", - "type": "integer" - }, - "product_images": { - "type": "string" - }, - "product_name": { - "type": "string" - }, - "product_price": { - "description": "新增价格字段", - "type": "integer" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "reward_id": { - "description": "来源奖励ID(activity_reward_settings.id)", - "type": "integer" - }, - "shipping_no": { - "description": "发货单号", - "type": "string" - }, - "shipping_status": { - "type": "integer" - }, - "status": { - "description": "状态:1持有 2作废 3已使用/发货", - "type": "integer" - }, - "updated_at": { - "description": "更新时间", - "type": "string" - }, - "user_id": { - "description": "资产归属用户ID", - "type": "integer" - } - } - }, - "user.ItemCardSimpleInfo": { - "type": "object", - "properties": { - "effect_type": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "user_card_id": { - "type": "integer" - } - } - }, - "user.ItemCardWithTemplate": { - "type": "object", - "properties": { - "card_id": { - "description": "卡模板ID(system_item_cards.id)", - "type": "integer" - }, - "card_type": { - "type": "integer" - }, - "count": { - "type": "integer" - }, - "created_at": { - "description": "创建时间", - "type": "string" - }, - "effect_type": { - "type": "integer" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "name": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "scope_type": { - "type": "integer" - }, - "stacking_strategy": { - "type": "integer" - }, - "status": { - "description": "状态:1未使用 2已使用 3已过期", - "type": "integer" - }, - "updated_at": { - "description": "更新时间", - "type": "string" - }, - "used_activity_id": { - "description": "使用时活动ID", - "type": "integer" - }, - "used_activity_name": { - "type": "string" - }, - "used_at": { - "description": "使用时间", - "type": "string" - }, - "used_draw_log_id": { - "description": "使用关联抽奖日志ID(activity_draw_logs.id)", - "type": "integer" - }, - "used_issue_id": { - "description": "使用时期ID", - "type": "integer" - }, - "used_issue_number": { - "type": "string" - }, - "used_reward_name": { - "type": "string" - }, - "user_id": { - "description": "用户ID(users.id)", - "type": "integer" - }, - "valid_end": { - "description": "有效期结束", - "type": "string" - }, - "valid_start": { - "description": "有效期开始", - "type": "string" - } - } - }, - "user.OrderWithItems": { - "type": "object", - "properties": { - "activity_id": { - "type": "integer" - }, - "activity_name": { - "type": "string" - }, - "actual_amount": { - "description": "实际支付金额(分)", - "type": "integer" - }, - "cancelled_at": { - "description": "取消时间", - "type": "string" - }, - "category_id": { - "type": "integer" - }, - "category_name": { - "type": "string" - }, - "coupon_id": { - "description": "使用的优惠券ID", - "type": "integer" - }, - "coupon_info": { - "$ref": "#/definitions/user.CouponSimpleInfo" - }, - "created_at": { - "description": "创建时间", - "type": "string" - }, - "discount_amount": { - "description": "优惠券抵扣金额(分)", - "type": "integer" - }, - "draw_receipts": { - "type": "array", - "items": { - "$ref": "#/definitions/user.DrawReceiptInfo" - } - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "is_consumed": { - "description": "是否已履约/消耗(对虚拟资产)", - "type": "integer" - }, - "is_draw": { - "type": "boolean" - }, - "is_winner": { - "type": "boolean" - }, - "issue_number": { - "type": "string" - }, - "item_card_id": { - "description": "使用的道具卡ID", - "type": "integer" - }, - "item_card_info": { - "$ref": "#/definitions/user.ItemCardSimpleInfo" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/model.OrderItems" - } - }, - "order_no": { - "description": "业务订单号(唯一)", - "type": "string" - }, - "paid_at": { - "description": "支付完成时间", - "type": "string" - }, - "pay_preorder_id": { - "description": "关联预支付单ID(payment_preorder.id)", - "type": "integer" - }, - "play_type": { - "type": "string" - }, - "points_amount": { - "description": "积分抵扣金额(分)", - "type": "integer" - }, - "points_ledger_id": { - "description": "积分扣减流水ID(user_points_ledger.id)", - "type": "integer" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "reward_level": { - "type": "integer" - }, - "source_type": { - "description": "来源:1商城直购 2抽奖票据 3其他", - "type": "integer" - }, - "status": { - "description": "订单状态:1待支付 2已支付 3已取消 4已退款", - "type": "integer" - }, - "total_amount": { - "description": "订单总金额(分)", - "type": "integer" - }, - "updated_at": { - "description": "更新时间", - "type": "string" - }, - "user_address_id": { - "description": "收货地址ID(user_addresses.id)", - "type": "integer" - }, - "user_id": { - "description": "下单用户ID(user_members.id)", - "type": "integer" - } - } - }, - "user.ProductInfo": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "image": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "integer" - } - } - }, - "user.ShipmentGroup": { - "type": "object", - "properties": { - "batch_no": { - "type": "string" - }, - "count": { - "type": "integer" - }, - "express_code": { - "type": "string" - }, - "express_no": { - "type": "string" - }, - "inventory_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "product_ids": { - "type": "array", - "items": { - "type": "integer" - } - }, - "products": { - "type": "array", - "items": { - "$ref": "#/definitions/user.ProductInfo" - } - }, - "received_at": { - "type": "string" - }, - "shipped_at": { - "type": "string" - }, - "status": { - "type": "integer" - } - } + "/admin/task_center/simulate/order_paid": { + "post": { + "description": "模拟用户支付订单,触发任务进度更新", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(Admin)" + ], + "summary": "模拟订单支付(Admin)", + "parameters": [ + { + "description": "模拟请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/taskcenter.simulateOrderPaidRequest" + } + } + ], + "responses": { + "200": { + "description": "操作成功", + "schema": { + "type": "object", + "additionalProperties": true + } + } } + } }, - "securityDefinitions": { - "LoginVerifyToken": { - "type": "apiKey", - "name": "Authorization", - "in": "header" + "/admin/task_center/tasks": { + "get": { + "description": "获取任务管理列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(Admin)" + ], + "summary": "任务列表(Admin)", + "responses": { + "200": { + "description": "任务列表", + "schema": { + "type": "object", + "additionalProperties": true + } + } } + }, + "post": { + "description": "创建一个新的任务", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(Admin)" + ], + "summary": "创建任务(Admin)", + "parameters": [ + { + "description": "创建任务请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/taskcenter.createTaskRequest" + } + } + ], + "responses": { + "200": { + "description": "创建成功", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "/admin/task_center/tasks/{id}": { + "put": { + "description": "修改指定任务的信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(Admin)" + ], + "summary": "修改任务(Admin)", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "修改任务请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/taskcenter.modifyTaskRequest" + } + } + ], + "responses": { + "200": { + "description": "修改成功", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "delete": { + "description": "删除指定的任务", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(Admin)" + ], + "summary": "删除任务(Admin)", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "/admin/task_center/tasks/{id}/rewards": { + "get": { + "description": "获取任务层级对应的奖励列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(Admin)" + ], + "summary": "获取任务奖励(Admin)", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "奖励列表", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "post": { + "description": "设置任务层级对应的奖励", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(Admin)" + ], + "summary": "设置任务奖励(Admin)", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "设置奖励请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/taskcenter.upsertRewardsRequest" + } + } + ], + "responses": { + "200": { + "description": "设置成功", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "/admin/task_center/tasks/{id}/tiers": { + "get": { + "description": "获取任务的完成条件层级列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(Admin)" + ], + "summary": "获取任务层级(Admin)", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "层级列表", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "post": { + "description": "设置任务的完成条件层级", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(Admin)" + ], + "summary": "设置任务层级(Admin)", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "设置层级请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/taskcenter.upsertTiersRequest" + } + } + ], + "responses": { + "200": { + "description": "设置成功", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "/api/admin/activities": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "获取活动列表,支持分类、Boss、状态过滤与分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "活动列表", + "parameters": [ + { + "type": "string", + "description": "活动名称(模糊)", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "description": "活动分类ID", + "name": "category_id", + "in": "query" + }, + { + "type": "integer", + "description": "是否Boss(0/1)", + "name": "is_boss", + "in": "query" + }, + { + "type": "integer", + "description": "状态(1进行中 2下线)", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listActivitiesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "创建活动,配置基本信息与分类、Boss标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "创建活动", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.createActivityRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/activities/{activity_id}": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看指定活动的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "查看活动详情", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.activityDetailResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "修改活动基本信息、分类、Boss标签等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "修改活动", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.modifyActivityRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "delete": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "删除指定活动", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "删除活动", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/activities/{activity_id}/copy": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "根据活动ID深度复制期次与奖品,生成新的活动", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "复制活动", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.copyActivityResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/activities/{activity_id}/game-passes/check": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "检查指定活动是否有用户持有未使用的次数卡,用于下架/删除前校验", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.次数卡" + ], + "summary": "检查活动次数卡", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.checkActivityGamePassesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/activities/{activity_id}/issues": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "获取指定活动的期数列表,支持分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "查看活动期数", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listIssuesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "为指定活动创建一个新的期数", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "创建活动期数", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.createIssueRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessage" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/activities/{activity_id}/issues/{issue_id}": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "修改指定期数的信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "修改活动期数", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "期ID", + "name": "issue_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.modifyIssueRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessage" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "delete": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "删除指定期数", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "删除活动期数", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "期ID", + "name": "issue_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessage" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/activities/{activity_id}/issues/{issue_id}/rewards": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看指定期数的奖励配置列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "查看期数奖品", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "期ID", + "name": "issue_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listRewardsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "为指定期数批量创建奖励配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "创建期数奖品", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "期ID", + "name": "issue_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.createRewardsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/activities/{activity_id}/issues/{issue_id}/rewards/batch": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "批量更新期数奖励", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "期ID", + "name": "issue_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.batchModifyRewardsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/activities/{activity_id}/issues/{issue_id}/rewards/{reward_id}": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "更新期数奖励", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "期ID", + "name": "issue_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "奖励ID", + "name": "reward_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.modifyRewardRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "delete": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "删除期数奖励", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "期ID", + "name": "issue_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "奖励ID", + "name": "reward_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/activity_categories": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "获取启用状态的活动分类列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.活动" + ], + "summary": "活动分类列表", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listCategoriesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/auth/refresh": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.登录" + ], + "summary": "管理端令牌刷新", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.refreshResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/banners": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.运营" + ], + "summary": "查看轮播图列表", + "parameters": [ + { + "type": "integer", + "description": "状态", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listBannersResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.运营" + ], + "summary": "创建轮播图", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.createBannerRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.createBannerResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/banners/{banner_id}": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.运营" + ], + "summary": "修改轮播图", + "parameters": [ + { + "type": "string", + "description": "轮播图ID", + "name": "banner_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.modifyBannerRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.pcSimpleMessage" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "delete": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.运营" + ], + "summary": "删除轮播图", + "parameters": [ + { + "type": "string", + "description": "轮播图ID", + "name": "banner_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.pcSimpleMessage" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/game-pass-packages": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查询次数卡套餐列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.次数卡套餐" + ], + "summary": "次数卡套餐列表", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "query" + }, + { + "type": "integer", + "description": "状态: 1=上架 2=下架", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listGamePassPackagesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "创建可购买的次数卡套餐", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.次数卡套餐" + ], + "summary": "创建次数卡套餐", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.createGamePassPackageRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.createGamePassPackageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/game-pass-packages/{package_id}": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "修改次数卡套餐配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.次数卡套餐" + ], + "summary": "修改次数卡套餐", + "parameters": [ + { + "type": "integer", + "description": "套餐ID", + "name": "package_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.modifyGamePassPackageRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "delete": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "软删除次数卡套餐", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.次数卡套餐" + ], + "summary": "删除次数卡套餐", + "parameters": [ + { + "type": "integer", + "description": "套餐ID", + "name": "package_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/game-passes/grant": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "管理员为用户发放游戏次数卡", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.次数卡" + ], + "summary": "发放次数卡", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.grantGamePassRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.grantGamePassResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/game-passes/list": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查询用户次数卡列表,支持按用户、活动过滤", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.次数卡" + ], + "summary": "次数卡列表", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "query" + }, + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listGamePassesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/login": { + "post": { + "description": "管理员登录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.登录" + ], + "summary": "管理员登录", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.loginRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.loginResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/matching/audit/{order_no}": { + "get": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "运营通过单号查询发牌过程", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.对对碰" + ], + "summary": "获取对对碰审计数据", + "parameters": [ + { + "type": "string", + "description": "订单号", + "name": "order_no", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/activity.MatchingGame" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/matching_card_types": { + "get": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "获取所有卡牌类型配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.对对碰" + ], + "summary": "列出对对碰卡牌类型", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listMatchingCardTypesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "post": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "创建新的卡牌类型", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.对对碰" + ], + "summary": "创建卡牌类型", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.matchingCardTypeRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.matchingCardTypeResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/matching_card_types/{id}": { + "put": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "修改已有的卡牌类型", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.对对碰" + ], + "summary": "修改卡牌类型", + "parameters": [ + { + "type": "integer", + "description": "卡牌类型ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.matchingCardTypeRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.matchingCardTypeResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "delete": { + "security": [ + { + "AdminAuth": [] + } + ], + "description": "删除指定的卡牌类型", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.对对碰" + ], + "summary": "删除卡牌类型", + "parameters": [ + { + "type": "integer", + "description": "卡牌类型ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/orders/{order_id}/rollback": { + "post": { + "description": "基于快照将用户数据回滚到消费前状态,包括恢复积分、优惠券、道具卡,作废资产,调用微信退款", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Admin-Audit" + ], + "summary": "回滚订单到消费前状态", + "parameters": [ + { + "type": "integer", + "description": "订单ID", + "name": "order_id", + "in": "path", + "required": true + }, + { + "description": "回滚请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.rollbackOrderRequest" + } + } + ], + "responses": { + "200": { + "description": "成功", + "schema": { + "$ref": "#/definitions/admin.rollbackOrderResponse" + } + } + } + } + }, + "/api/admin/orders/{order_id}/snapshots": { + "get": { + "description": "获取订单消费前后的完整用户状态快照", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Admin-Audit" + ], + "summary": "获取订单审计快照", + "parameters": [ + { + "type": "integer", + "description": "订单ID", + "name": "order_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "成功", + "schema": { + "$ref": "#/definitions/admin.getOrderSnapshotsResponse" + } + } + } + } + }, + "/api/admin/product_categories": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.商品" + ], + "summary": "查看商品分类列表", + "parameters": [ + { + "type": "string", + "description": "名称", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "description": "状态", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listProductCategoriesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.商品" + ], + "summary": "创建商品分类", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.createProductCategoryRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.createProductCategoryResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/product_categories/{category_id}": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.商品" + ], + "summary": "修改商品分类", + "parameters": [ + { + "type": "string", + "description": "分类ID", + "name": "category_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.modifyProductCategoryRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.pcSimpleMessage" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "delete": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.商品" + ], + "summary": "删除商品分类", + "parameters": [ + { + "type": "string", + "description": "分类ID", + "name": "category_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.pcSimpleMessage" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/products": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.商品" + ], + "summary": "查看商品列表", + "parameters": [ + { + "type": "string", + "description": "名称", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "description": "分类ID", + "name": "category_id", + "in": "query" + }, + { + "type": "integer", + "description": "状态", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listProductsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.商品" + ], + "summary": "创建商品", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.createProductRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.createProductResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/products/batch": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.商品" + ], + "summary": "批量更新商品(库存/上下架)", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.batchUpdateProductsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.batchUpdateProductsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/products/{product_id}": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.商品" + ], + "summary": "修改商品", + "parameters": [ + { + "type": "string", + "description": "商品ID", + "name": "product_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.modifyProductRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.pcSimpleMessage" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "delete": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.商品" + ], + "summary": "删除商品", + "parameters": [ + { + "type": "string", + "description": "商品ID", + "name": "product_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.pcSimpleMessage" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/shipping/orders": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "按批次号或运单号聚合显示发货记录,支持筛选状态、用户、时间等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.发货管理" + ], + "summary": "发货订单列表", + "parameters": [ + { + "type": "integer", + "description": "页码,默认1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量,最多100,默认20", + "name": "page_size", + "in": "query" + }, + { + "type": "integer", + "description": "状态:1待发货 2已发货 3已签收 4异常", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "query" + }, + { + "type": "string", + "description": "批次号", + "name": "batch_no", + "in": "query" + }, + { + "type": "string", + "description": "运单号", + "name": "express_no", + "in": "query" + }, + { + "type": "string", + "description": "开始日期 2006-01-02", + "name": "start_date", + "in": "query" + }, + { + "type": "string", + "description": "结束日期 2006-01-02", + "name": "end_date", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listShippingOrdersResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/shipping/orders/batch": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "为多条发货记录填写运单号或更新状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.发货管理" + ], + "summary": "批量更新发货信息", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.updateShippingRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.updateShippingResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/shipping/orders/{id}": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "根据发货记录ID获取详情", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.发货管理" + ], + "summary": "获取发货订单详情", + "parameters": [ + { + "type": "integer", + "description": "发货记录ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/model.ShippingRecords" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/system_item_cards": { + "get": { + "description": "管理员获取道具卡列表,支持按名称、状态、类型等条件筛选", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.运营管理" + ], + "summary": "获取道具卡列表", + "parameters": [ + { + "type": "string", + "description": "道具卡名称", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "description": "状态:1启用 2禁用", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "道具卡类型:1抽奖卡 2加成卡 3保底卡", + "name": "card_type", + "in": "query" + }, + { + "type": "integer", + "description": "适用范围:1全局 2活动分类 3活动 4期次", + "name": "scope_type", + "in": "query" + }, + { + "type": "integer", + "description": "页码,默认1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数,默认10", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listItemCardsResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "post": { + "description": "管理员创建新的道具卡,支持设置类型、效果、有效期等属性", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.运营管理" + ], + "summary": "创建道具卡", + "parameters": [ + { + "description": "创建道具卡请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.createItemCardRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.createItemCardResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "403": { + "description": "无权限,仅超管可操作", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/system_item_cards/{item_card_id}": { + "put": { + "description": "管理员修改道具卡信息,支持修改名称、价格、有效期等属性", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.运营管理" + ], + "summary": "修改道具卡", + "parameters": [ + { + "type": "integer", + "description": "道具卡ID", + "name": "item_card_id", + "in": "path", + "required": true + }, + { + "description": "修改道具卡请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.modifyItemCardRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "403": { + "description": "无权限,仅超管可操作", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "delete": { + "description": "管理员删除指定的道具卡", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.运营管理" + ], + "summary": "删除道具卡", + "parameters": [ + { + "type": "integer", + "description": "道具卡ID", + "name": "item_card_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "403": { + "description": "无权限,仅超管可操作", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看APP端用户分页列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "管理端用户列表", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "用户昵称", + "name": "nickname", + "in": "query" + }, + { + "type": "string", + "description": "邀请码", + "name": "inviteCode", + "in": "query" + }, + { + "type": "string", + "description": "开始日期(YYYY-MM-DD)", + "name": "startDate", + "in": "query" + }, + { + "type": "string", + "description": "结束日期(YYYY-MM-DD)", + "name": "endDate", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listUsersResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/coupons": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看指定用户持有的优惠券列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "查看用户优惠券列表", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listCouponsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/coupons/add": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "管理端为指定用户发放优惠券", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "给用户添加优惠券", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.addCouponRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.addCouponResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/game-passes": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查询指定用户的所有次数卡", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.次数卡" + ], + "summary": "查询用户次数卡", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.getUserGamePassesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/game_tickets": { + "get": { + "tags": [ + "管理端.游戏" + ], + "summary": "查询用户游戏资格日志", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "post": { + "tags": [ + "管理端.游戏" + ], + "summary": "发放游戏资格", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/game.grantTicketRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "/api/admin/users/{user_id}/inventory": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看指定用户的资产记录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "查看用户资产列表", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listInventoryResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/invites": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看指定用户邀请的用户列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "查看用户邀请列表", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listInvitesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/item_cards": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看指定用户的道具卡持有记录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "查看用户道具卡列表", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listUserItemCardsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "post": { + "description": "管理员给指定用户分配道具卡,可指定数量", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.运营管理" + ], + "summary": "给用户分配道具卡", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "分配道具卡请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.assignItemCardRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.simpleMessageResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "403": { + "description": "无权限,仅超管可操作", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/orders": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看指定用户的订单记录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "查看用户订单列表", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listOrdersResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/points": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看指定用户的积分流水记录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "查看用户积分记录", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.listPointsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/points/add": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "管理端为指定用户发放或扣减积分,正数为增加,负数为扣减", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "给用户增加或扣减积分", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.addPointsRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.addPointsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/points/balance": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看指定用户当前积分余额(过滤过期)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "查看用户积分余额", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.pointsBalanceResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/profile": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "聚合用户基本信息、生命周期财务指标、当前资产快照", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "获取用户综合画像", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.UserProfileResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/rewards/grant": { + "post": { + "description": "管理员给用户发放奖励,支持实物和虚拟奖品,可选择关联活动和奖励配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "给用户发放奖励", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.GrantRewardRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.GrantRewardResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/admin/users/{user_id}/token": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "仅超级管理员可用,用于测试或紧急场景下为指定用户签发APP令牌", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.用户" + ], + "summary": "管理端为APP用户签发令牌", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.issueUserTokenResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/activities": { + "get": { + "description": "获取活动列表,支持分类、Boss、状态过滤与分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "活动列表", + "parameters": [ + { + "type": "string", + "description": "活动名称(模糊)", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "description": "活动分类ID", + "name": "category_id", + "in": "query" + }, + { + "type": "integer", + "description": "是否Boss(0/1)", + "name": "is_boss", + "in": "query" + }, + { + "type": "integer", + "description": "状态(1进行中 2下线)", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listActivitiesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/activities/{activity_id}": { + "get": { + "description": "获取指定活动的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "活动详情", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.activityDetailResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/activities/{activity_id}/issues": { + "get": { + "description": "获取指定活动的期列表,支持分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "活动期列表", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listIssuesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/activities/{activity_id}/issues/{issue_id}/choices": { + "get": { + "description": "返回总位置数量、已占用位置列表以及当前可选位置列表。仅在活动玩法为 ichiban 时可用。", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "获取指定活动期的可选位置与已占用位置", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "期ID", + "name": "issue_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listIssueChoicesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/activities/{activity_id}/issues/{issue_id}/draw_logs": { + "get": { + "description": "查看指定活动期数的抽奖记录,支持等级筛选(默认返回最新的100条,不支持自定义翻页)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "抽奖记录列表", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "期ID", + "name": "issue_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "奖品等级过滤", + "name": "level", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listDrawLogsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/activities/{activity_id}/issues/{issue_id}/draw_logs_grouped": { + "get": { + "description": "查看指定活动期数的抽奖记录,按奖品等级分组返回", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "按奖品等级分类的抽奖记录", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "期ID", + "name": "issue_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listDrawLogsByLevelResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/activities/{activity_id}/issues/{issue_id}/rewards": { + "get": { + "description": "获取指定期的奖励配置列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "奖励配置列表", + "parameters": [ + { + "type": "integer", + "description": "活动ID", + "name": "activity_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "期ID", + "name": "issue_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listRewardsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/address-share/submit": { + "post": { + "description": "被邀请者使用分享令牌提交收件信息;服务端校验令牌有效并创建待发货记录(极简方案)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "提交共享地址", + "parameters": [ + { + "description": "请求参数:令牌与地址信息", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.addressShareSubmitRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.addressShareSubmitResponse" + } + }, + "400": { + "description": "令牌无效/已处理/资产不可用", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/banners": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.运营" + ], + "summary": "APP端轮播图列表", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listAppBannersResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/categories": { + "get": { + "description": "获取APP端商品分类列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.基础" + ], + "summary": "获取分类列表", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listAppCategoriesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/game-passes/available": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查询当前用户可用的游戏次数卡", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "获取用户次数卡", + "parameters": [ + { + "type": "integer", + "description": "活动ID,不传返回所有可用次数卡", + "name": "activity_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.getGamePassesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/game-passes/packages": { + "get": { + "description": "获取可购买的次数卡套餐列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "获取次数卡套餐", + "parameters": [ + { + "type": "integer", + "description": "活动ID,不传返回全局套餐", + "name": "activity_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.getPackagesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/game-passes/purchase": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "购买次数卡套餐,创建订单等待支付", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "购买次数卡套餐", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.purchasePackageRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.purchasePackageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/games/enter": { + "post": { + "tags": [ + "APP端.游戏" + ], + "summary": "进入游戏", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/game.enterGameRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/game.enterGameResponse" + } + } + } + } + }, + "/api/app/lottery/join": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "提交活动ID与期ID创建参与记录与订单,支持积分抵扣,返回参与ID、订单号、抽奖模式及是否进入队列", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.抽奖" + ], + "summary": "用户参与抽奖", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.joinLotteryRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.joinLotteryResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/lottery/result": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "根据订单号查询抽奖结果与进度,返回结果明细与可验证凭证;需登录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.抽奖" + ], + "summary": "抽奖订单结果查询", + "parameters": [ + { + "type": "string", + "description": "订单号", + "name": "order_no", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.orderResultResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/matching/card_types": { + "get": { + "description": "获取所有启用的卡牌类型配置,用于App端预览或动画展示", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "列出对对碰卡牌类型", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/activity.CardTypeConfig" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/matching/cards": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "只有支付成功后才能获取游戏牌组数据,防止未支付用户获取牌组信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "获取对对碰游戏数据", + "parameters": [ + { + "type": "string", + "description": "游戏ID", + "name": "game_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.matchingGameCardsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/matching/check": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "前端游戏结束后上报结果,服务器发放奖励", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "游戏结束结算校验", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.matchingGameCheckRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.matchingGameCheckResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/matching/preorder": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "用户下单,服务器扣费并返回全量99张乱序卡牌,前端自行负责游戏流程", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "下单并获取对对碰全量数据", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.matchingGamePreOrderRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.matchingGamePreOrderResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/matching/state": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "获取当前游戏的完整状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.活动" + ], + "summary": "获取对对碰游戏状态", + "parameters": [ + { + "type": "string", + "description": "游戏ID", + "name": "game_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/notices": { + "get": { + "description": "获取APP首页滚动公告", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.基础" + ], + "summary": "获取公告列表", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listAppNoticesResponse" + } + } + } + } + }, + "/api/app/orders/{order_id}": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "获取指定订单的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "获取订单详情", + "parameters": [ + { + "type": "integer", + "description": "订单ID", + "name": "order_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.OrderWithItems" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/orders/{order_id}/cancel": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "取消指定订单(仅限待付款状态)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "取消订单", + "parameters": [ + { + "type": "integer", + "description": "订单ID", + "name": "order_id", + "in": "path", + "required": true + }, + { + "description": "取消原因", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/app.cancelOrderRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.cancelOrderResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/pay/wechat/jsapi/preorder": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "根据`order_no`与`openid`创建或复用JSAPI预下单,返回`wx.requestPayment`调起参数;订单需为当前登录用户且状态为待支付", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.支付" + ], + "summary": "小程序微信支付预下单", + "parameters": [ + { + "description": "请求参数:业务订单号与openid", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.jsapiPreorderRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.jsapiPreorderResponse" + } + }, + "400": { + "description": "参数错误/配置缺失/订单不存在或状态不合法/微信预下单失败/签名构建失败", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/products": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "分页查询商品列表,支持分类筛选,返回分页信息与商品数组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.商品" + ], + "summary": "商品列表", + "parameters": [ + { + "type": "integer", + "description": "页码,默认1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量,默认20", + "name": "page_size", + "in": "query" + }, + { + "type": "integer", + "description": "分类ID", + "name": "category_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listAppProductsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/products/{id}": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "根据商品ID返回完整商品信息,含相册与同类推荐;校验下架/缺货状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.商品" + ], + "summary": "商品详情", + "parameters": [ + { + "type": "integer", + "description": "商品ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.getAppProductDetailResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/sms/login": { + "post": { + "description": "使用短信验证码登录或注册(新手机号自动创建账户)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "短信验证码登录", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.smsLoginRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.smsLoginResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/sms/send-code": { + "post": { + "description": "发送短信验证码到指定手机号(60秒内不可重复发送,每日最多10次)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "发送短信验证码", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.sendSmsCodeRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.sendSmsCodeResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/store/items": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "分页获取积分商城商品列表,支持按类型筛选(product/item_card/coupon)", + "consumes": [ + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.积分商城" + ], + "summary": "获取积分商城商品列表", + "parameters": [ + { + "type": "string", + "description": "商品类型: product(默认), item_card, coupon", + "name": "kind", + "in": "query" + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "default": 20, + "description": "每页数量", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listStoreItemsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/task-center/tasks": { + "get": { + "description": "获取当前可用的任务列表,支持分页", + "consumes": [ + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(App)" + ], + "summary": "获取任务列表(App)", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "default": 20, + "description": "每页数量", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "任务列表", + "schema": { + "$ref": "#/definitions/taskcenter.listTasksResponse" + } + } + } + } + }, + "/api/app/task-center/tasks/{id}/claim/{user_id}": { + "post": { + "description": "用户领取指定任务层级的奖励", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(App)" + ], + "summary": "领取任务奖励(App)", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "领取请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/taskcenter.claimTaskRequest" + } + } + ], + "responses": { + "200": { + "description": "领取成功", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "/api/app/task-center/tasks/{id}/progress/{user_id}": { + "get": { + "description": "获取指定用户在特定任务上的进度详情", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TaskCenter(App)" + ], + "summary": "获取用户任务进度(App)", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "任务进度详情", + "schema": { + "$ref": "#/definitions/taskcenter.taskProgressResponse" + } + } + } + } + }, + "/api/app/users/douyin/login": { + "post": { + "description": "抖音小程序登录(需传递 code 或 anonymous_code)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "抖音登录", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.douyinLoginRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.douyinLoginResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/profile": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "获取当前登录用户的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "获取用户信息", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.userItem" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/weixin/login": { + "post": { + "description": "微信静默登录(需传递 code;可选 invite_code)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "微信登录", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.weixinLoginRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.weixinLoginResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "修改用户昵称与头像", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "修改用户信息", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.modifyUserRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.modifyUserResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/addresses": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "分页获取当前登录用户的收货地址列表,默认地址优先", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "获取用户地址列表", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "页码,默认1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数,默认20,最多100", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listAddressesResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "为当前登录用户新增收货地址,可选择设为默认", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "新增用户地址", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.addAddressRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.addAddressResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/addresses/{address_id}": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "更新当前登录用户的指定收货地址", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "更新用户地址", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "地址ID", + "name": "address_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.updateAddressRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.okResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + }, + "delete": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "删除当前登录用户的指定收货地址", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "删除用户地址", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "地址ID", + "name": "address_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.okDeleteResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/addresses/{address_id}/default": { + "put": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "将指定地址设置为当前登录用户的默认地址", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "设置默认用户地址", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "地址ID", + "name": "address_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.okResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/coupons": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看用户持有的优惠券列表,支持按状态过滤", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "查看用户优惠券", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "状态:1未使用 2已使用 3已过期,不传默认1", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listCouponsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/coupons/stats": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "获取用户优惠券各状态数量和累计金额", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "获取用户优惠券统计", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.couponStatsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/coupons/{user_coupon_id}/usage": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "获取指定优惠券的使用记录,包含优惠券详情、订单号、活动名称", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "获取单张优惠券使用记录", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "用户优惠券ID", + "name": "user_coupon_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "页码,默认1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量,默认20", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listCouponUsageResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/douyin/phone/bind": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "使用抖音手机号 code 换取手机号并绑定到指定用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "抖音绑定手机号", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.bindDouyinPhoneRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.bindDouyinPhoneResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/game_tickets": { + "get": { + "tags": [ + "APP端.游戏" + ], + "summary": "获取我的游戏资格", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": { + "type": "integer" + } + } + } + } + } + }, + "/api/app/users/{user_id}/inventory": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "获取 APP 端当前登录用户在 user_inventory 的资产记录,支持分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "获取用户资产列表", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "页码,默认1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量,最多100,默认20", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listInventoryResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/inventory/address-share/create": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "生成一次性分享令牌(不落库),用于邀请他人填写收货地址;令牌默认有效期1小时(无需传过期参数)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "创建共享地址链接", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数:资产ID(过期参数可不传,默认1小时)", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.addressShareCreateRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.addressShareCreateResponse" + } + }, + "400": { + "description": "参数错误/资产不可用", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/inventory/address-share/revoke": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "极简方案下为前端态操作:不落库令牌,撤销仅用于提示与禁用旧链接(可忽略服务端状态)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "撤销共享地址链接", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数:资产ID", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.addressShareRevokeRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.okResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/inventory/cancel-shipping": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "取消已提交但未发货的申请;恢复库存状态。支持按单个资产ID取消或按批次号批量取消", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "取消发货申请", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数:资产ID或批次号(二选一)", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.cancelShippingRequest" + } + } + ], + "responses": { + "200": { + "description": "成功", + "schema": { + "$ref": "#/definitions/app.cancelShippingResponse" + } + }, + "400": { + "description": "参数错误/记录不存在/已处理", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/inventory/redeem": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "将资产按规则转换为积分,成功后资产不可再发货;默认兑换比率来自系统配置`points_exchange_per_cent`", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "资产兑换为积分", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数:资产ID", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.redeemInventoryRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.redeemInventoryResponse" + } + }, + "400": { + "description": "参数错误/资产不可用", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/inventory/request-shipping": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "用户已有默认地址时,申请对指定资产发货;幂等校验已存在发货记录时返回已处理", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "申请发货", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数:资产ID", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.requestShippingRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.requestShippingResponse" + } + }, + "400": { + "description": "参数错误/未设置默认地址/已处理", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/inventory/request-shipping-batch": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "为多个资产申请发货,校验所有权与状态;幂等:已申请的资产跳过", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "批量申请发货", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数:资产ID列表与可选地址ID", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.requestShippingBatchRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.requestShippingBatchResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/invites": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看被该用户邀请的用户列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "查看用户邀请记录", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listInvitesResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/item_cards": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "获取指定用户的道具卡列表,支持分页和状态过滤", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "获取用户道具卡列表", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "页码,默认1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数,默认10", + "name": "page_size", + "in": "query" + }, + { + "type": "integer", + "description": "状态:1未使用 2已使用 3已过期,不传默认1", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listUserItemCardsResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/item_cards/uses": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "获取指定用户的道具卡使用记录,支持分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "获取用户道具卡使用记录", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "页码,默认1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数,默认10", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listUserItemCardUsesResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/orders": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看用户抽奖来源订单记录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "查看用户订单记录", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "订单状态:1待支付 2已支付 3已取消 4已退款", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "是否已消耗/履约:0否 1是", + "name": "is_consumed", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listOrdersResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/phone/bind": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "使用微信手机号 code 换取手机号并绑定到指定用户", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "绑定手机号", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.bindPhoneRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.bindPhoneResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/points": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看用户积分流水记录", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "查看用户积分记录", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量,最多100", + "name": "page_size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listPointsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/points/balance": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "查看用户积分余额(过滤过期积分)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "查看用户积分余额", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.pointsBalanceResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/points/redeem-coupon": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "使用积分兑换指定直减金额券,按比率 1积分=1元(券面值为分)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.积分" + ], + "summary": "积分兑换优惠券", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.redeemCouponRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.redeemCouponResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/points/redeem-item-card": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "使用积分兑换指定数量的道具卡", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "积分兑换道具卡", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "description": "兑换请求参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.redeemItemCardRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.redeemItemCardResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/points/redeem-product": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "使用积分按比率1积分=1元兑换商品,生成系统发放订单与用户资产", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.积分" + ], + "summary": "积分兑换商品", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/app.redeemProductRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.redeemProductResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/shipments": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "按运单号聚合用户的发货记录,支持分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.发货" + ], + "summary": "获取用户发货分组列表", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "页码,默认1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量,最多100,默认20", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.listShipmentsResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/app/users/{user_id}/stats": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "返回当前登录用户的道具卡数量、优惠券数量、积分余额", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "APP端.用户" + ], + "summary": "获取用户统计", + "parameters": [ + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/app.userStatsResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/role/list": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.系统" + ], + "summary": "角色列表", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "current", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量", + "name": "size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "角色名称", + "name": "roleName", + "in": "query" + }, + { + "type": "string", + "description": "角色编码", + "name": "roleCode", + "in": "query" + }, + { + "type": "boolean", + "description": "是否启用", + "name": "enabled", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.roleListResponse" + } + } + } + } + }, + "/api/user": { + "post": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "创建新的管理员账号", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.系统" + ], + "summary": "创建系统用户", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.createUserRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.createUserResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + } + } + }, + "/api/user/list": { + "get": { + "security": [ + { + "LoginVerifyToken": [] + } + ], + "description": "返回系统用户分页数据", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.系统" + ], + "summary": "系统用户列表", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "current", + "in": "query", + "required": true + }, + { + "type": "integer", + "default": 20, + "description": "每页数量", + "name": "size", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "用户名", + "name": "userName", + "in": "query" + }, + { + "type": "string", + "description": "邮箱", + "name": "userEmail", + "in": "query" + }, + { + "type": "string", + "description": "手机号", + "name": "userPhone", + "in": "query" + }, + { + "type": "string", + "description": "状态", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.userListResponse" + } + } + } + } + }, + "/api/v3/system/menus/simple": { + "get": { + "responses": {} + } + }, + "/common/upload/wangeditor": { + "post": { + "description": "适配 WangEditor 的图片上传接口", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "WangEditor图片上传", + "parameters": [ + { + "type": "file", + "description": "图片文件", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "上传成功", + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "400": { + "description": "上传失败", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "/internal/game/consume-ticket": { + "post": { + "tags": [ + "Internal.游戏" + ], + "summary": "扣减游戏次数", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/game.consumeTicketRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/game.consumeTicketResponse" + } + } + } + } + }, + "/internal/game/minesweeper/config": { + "get": { + "tags": [ + "Internal.游戏" + ], + "summary": "获取扫雷配置", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "/internal/game/settle": { + "post": { + "description": "游戏结束后结算并发放奖励", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Internal" + ], + "summary": "结算游戏", + "parameters": [ + { + "description": "结算信息", + "name": "result", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/minesweeper.SettleGameRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/minesweeper.SettleGameResponse" + } + } + } + } + }, + "/internal/game/validate-token": { + "post": { + "tags": [ + "Internal.游戏" + ], + "summary": "验证GameToken", + "parameters": [ + { + "description": "请求参数", + "name": "RequestBody", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/game.validateTokenRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/game.validateTokenResponse" + } + } + } + } + }, + "/internal/game/verify": { + "post": { + "description": "验证游戏票据是否有效", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Internal" + ], + "summary": "验证游戏票据", + "parameters": [ + { + "description": "票据信息", + "name": "ticket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/minesweeper.VerifyTicketRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/minesweeper.VerifyTicketResponse" + } + } + } + } + }, + "/pay/wechat/notify": { + "post": { + "description": "接收微信支付结果通知,验证签名并处理订单状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pay" + ], + "summary": "微信支付回调通知", + "responses": { + "200": { + "description": "处理成功", + "schema": { + "$ref": "#/definitions/pay.notifyAck" + } + }, + "400": { + "description": "请求参数错误", + "schema": { + "$ref": "#/definitions/pay.notifyAck" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/pay.notifyAck" + } + } + } + } + }, + "/admin/dashboard/activity-profit-loss/{activity_id}/logs": { + "get": { + "description": "查看活动的抽奖记录,支持按玩家/奖品关键词搜索", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "管理端.运营分析" + ], + "summary": "活动抽奖记录", + "parameters": [ + { + "name": "activity_id", + "in": "path", + "description": "活动ID", + "required": true, + "type": "integer" + }, + { + "name": "page", + "in": "query", + "description": "页码", + "required": true, + "type": "integer", + "default": 1 + }, + { + "name": "page_size", + "in": "query", + "description": "每页数量,最多100", + "required": true, + "type": "integer", + "default": 20 + }, + { + "name": "user_id", + "in": "query", + "description": "用户ID过滤", + "required": false, + "type": "integer" + }, + { + "name": "player_keyword", + "in": "query", + "description": "玩家关键词:昵称/手机号/邀请码/ID", + "required": false, + "type": "string" + }, + { + "name": "prize_keyword", + "in": "query", + "description": "奖品关键词:名称或ID", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/admin.activityLogsResponse" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "401": { + "description": "未授权", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "403": { + "description": "无权限", + "schema": { + "$ref": "#/definitions/code.Failure" + } + }, + "500": { + "description": "服务器内部错误", + "schema": { + "$ref": "#/definitions/code.Failure" + } + } + }, + "security": [ + { + "LoginVerifyToken": [] + } + ] + } } + }, + "definitions": { + "activity.CardTypeConfig": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "image_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "quantity": { + "type": "integer" + } + } + }, + "activity.MatchingCard": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "activity.MatchingGame": { + "type": "object", + "properties": { + "activity_id": { + "type": "integer" + }, + "board": { + "type": "array", + "items": { + "$ref": "#/definitions/activity.MatchingCard" + } + }, + "card_configs": { + "type": "array", + "items": { + "$ref": "#/definitions/activity.CardTypeConfig" + } + }, + "card_id_counter": { + "type": "integer" + }, + "created_at": { + "description": "游戏创建时间,用于自动开奖超时判断", + "type": "string" + }, + "deck": { + "type": "array", + "items": { + "$ref": "#/definitions/activity.MatchingCard" + } + }, + "issue_id": { + "type": "integer" + }, + "last_activity": { + "type": "string" + }, + "max_possible_pairs": { + "type": "integer" + }, + "nonce": { + "type": "integer" + }, + "order_id": { + "type": "integer" + }, + "position": { + "description": "用户选择的类型,用于服务端验证", + "type": "string" + }, + "server_seed": { + "type": "array", + "items": { + "type": "integer" + } + }, + "server_seed_hash": { + "type": "string" + }, + "total_pairs": { + "type": "integer" + }, + "user_id": { + "type": "integer" + } + } + }, + "admin.GrantRewardRequest": { + "type": "object", + "required": [ + "product_id" + ], + "properties": { + "activity_id": { + "description": "活动ID(可选)", + "type": "integer" + }, + "address_id": { + "description": "收货地址ID(可选,实物商品需要)", + "type": "integer" + }, + "points_amount": { + "description": "消耗积分", + "type": "integer" + }, + "product_id": { + "description": "商品ID", + "type": "integer" + }, + "quantity": { + "description": "发放数量", + "type": "integer", + "minimum": 1 + }, + "remark": { + "description": "备注", + "type": "string" + }, + "reward_id": { + "description": "奖励配置ID(可选)", + "type": "integer" + } + } + }, + "admin.GrantRewardResponse": { + "type": "object", + "properties": { + "inventory_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "message": { + "type": "string" + }, + "order_id": { + "type": "integer" + }, + "success": { + "type": "boolean" + } + } + }, + "admin.ShippingOrderGroup": { + "type": "object", + "properties": { + "address_id": { + "description": "地址ID", + "type": "integer" + }, + "address_info": { + "description": "地址信息", + "type": "string" + }, + "batch_no": { + "description": "批次号", + "type": "string" + }, + "count": { + "description": "商品数量", + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "express_code": { + "description": "快递公司编码", + "type": "string" + }, + "express_no": { + "description": "运单号", + "type": "string" + }, + "group_key": { + "description": "分组键(用于批量操作)", + "type": "string" + }, + "inventory_ids": { + "description": "资产ID列表", + "type": "array", + "items": { + "type": "integer" + } + }, + "product_ids": { + "description": "商品ID列表", + "type": "array", + "items": { + "type": "integer" + } + }, + "products": { + "description": "商品详情列表", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "image": { + "type": "string" + }, + "name": { + "type": "string" + }, + "price": { + "type": "integer" + } + } + } + }, + "received_at": { + "type": "string" + }, + "record_ids": { + "description": "发货记录ID列表", + "type": "array", + "items": { + "type": "integer" + } + }, + "shipped_at": { + "type": "string" + }, + "status": { + "description": "状态(取最大值)", + "type": "integer" + }, + "total_price": { + "description": "总价格", + "type": "integer" + }, + "user_id": { + "description": "用户ID", + "type": "integer" + }, + "user_nickname": { + "description": "用户昵称", + "type": "string" + } + } + }, + "admin.UserProfileResponse": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "channel_id": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "current_assets": { + "description": "当前资产快照", + "type": "object", + "properties": { + "coupon_count": { + "description": "持有优惠券数", + "type": "integer" + }, + "coupon_value": { + "description": "持有优惠券价值", + "type": "integer" + }, + "inventory_count": { + "description": "持有商品数", + "type": "integer" + }, + "inventory_value": { + "description": "持有商品价值", + "type": "integer" + }, + "item_card_count": { + "description": "持有道具卡数", + "type": "integer" + }, + "item_card_value": { + "description": "持有道具卡价值", + "type": "integer" + }, + "points_balance": { + "description": "积分余额", + "type": "integer" + }, + "profit_loss_ratio": { + "description": "累计盈亏比", + "type": "number" + }, + "total_asset_value": { + "description": "总资产估值", + "type": "integer" + } + } + }, + "douyin_id": { + "type": "string" + }, + "id": { + "description": "基本信息", + "type": "integer" + }, + "invite_code": { + "type": "string" + }, + "invite_count": { + "description": "邀请统计", + "type": "integer" + }, + "inviter_id": { + "type": "integer" + }, + "lifetime_stats": { + "description": "生命周期财务指标", + "type": "object", + "properties": { + "net_cash_cost": { + "description": "净现金支出", + "type": "integer" + }, + "order_count": { + "description": "订单数", + "type": "integer" + }, + "total_paid": { + "description": "累计支付", + "type": "integer" + }, + "total_refunded": { + "description": "累计退款", + "type": "integer" + } + } + }, + "mobile": { + "type": "string" + }, + "nickname": { + "type": "string" + } + } + }, + "admin.activityDetailResponse": { + "type": "object", + "properties": { + "activity_category_id": { + "type": "integer" + }, + "allow_coupons": { + "type": "boolean" + }, + "allow_item_cards": { + "type": "boolean" + }, + "banner": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "draw_mode": { + "type": "string" + }, + "end_time": { + "type": "string" + }, + "gameplay_intro": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "image": { + "type": "string" + }, + "interval_minutes": { + "type": "integer" + }, + "is_boss": { + "type": "integer" + }, + "last_settled_at": { + "type": "string" + }, + "min_participants": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "play_type": { + "type": "string" + }, + "price_draw": { + "type": "integer" + }, + "refund_coupon_id": { + "type": "integer" + }, + "scheduled_time": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "updated_at": { + "type": "string" + } + } + }, + "admin.activityItem": { + "type": "object", + "properties": { + "activity_category_id": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "category_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "image": { + "type": "string" + }, + "is_boss": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "price_draw": { + "type": "integer" + }, + "status": { + "type": "integer" + } + } + }, + "admin.activitysvcIssueData": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "issue_number": { + "type": "string" + }, + "prize_count": { + "type": "integer" + }, + "sort": { + "type": "integer" + }, + "status": { + "type": "integer" + } + } + }, + "admin.addCouponRequest": { + "type": "object", + "required": [ + "coupon_id" + ], + "properties": { + "coupon_id": { + "type": "integer" + } + } + }, + "admin.addCouponResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + }, + "admin.addPointsRequest": { + "type": "object", + "properties": { + "kind": { + "type": "string" + }, + "points": { + "description": "正数=增加,负数=扣减", + "type": "integer" + }, + "remark": { + "type": "string" + }, + "valid_days": { + "type": "integer" + } + } + }, + "admin.addPointsResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + }, + "admin.adminUserCouponItem": { + "type": "object", + "properties": { + "balance_amount": { + "type": "integer" + }, + "coupon_id": { + "type": "integer" + }, + "discount_type": { + "type": "integer" + }, + "discount_value": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "min_spend": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "scope_type": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "used_at": { + "type": "string" + }, + "used_order_id": { + "type": "integer" + }, + "valid_end": { + "type": "string" + }, + "valid_start": { + "type": "string" + } + } + }, + "admin.adminUserItem": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "channel_code": { + "type": "string" + }, + "channel_name": { + "type": "string" + }, + "coupons_count": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "douyin_id": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "invite_code": { + "type": "string" + }, + "inviter_id": { + "type": "integer" + }, + "item_cards_count": { + "type": "integer" + }, + "nickname": { + "type": "string" + }, + "points_balance": { + "type": "integer" + }, + "seven_day_consume": { + "type": "integer" + }, + "today_consume": { + "type": "integer" + } + } + }, + "admin.assignItemCardRequest": { + "type": "object", + "required": [ + "card_id" + ], + "properties": { + "card_id": { + "type": "integer" + }, + "quantity": { + "type": "integer" + } + } + }, + "admin.bannerItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "image_url": { + "type": "string" + }, + "link_url": { + "type": "string" + }, + "sort": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "title": { + "type": "string" + } + } + }, + "admin.batchModifyRewardItem": { + "type": "object", + "required": [ + "reward_id" + ], + "properties": { + "reward_id": { + "type": "integer" + }, + "weight": { + "type": "number", + "minimum": 0 + } + } + }, + "admin.batchModifyRewardsRequest": { + "type": "object", + "required": [ + "rewards" + ], + "properties": { + "rewards": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.batchModifyRewardItem" + } + } + } + }, + "admin.batchUpdateProductsRequest": { + "type": "object", + "required": [ + "ids" + ], + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "status": { + "type": "integer" + }, + "stock": { + "type": "integer" + } + } + }, + "admin.batchUpdateProductsResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "updated_count": { + "type": "integer" + } + } + }, + "admin.categoryItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "admin.checkActivityGamePassesResponse": { + "type": "object", + "properties": { + "activity_id": { + "type": "integer" + }, + "can_delete": { + "type": "boolean" + }, + "message": { + "type": "string" + }, + "total_remaining": { + "type": "integer" + }, + "user_count": { + "type": "integer" + } + } + }, + "admin.copyActivityResponse": { + "type": "object", + "properties": { + "new_activity_id": { + "type": "integer" + }, + "status": { + "type": "string" + } + } + }, + "admin.createActivityRequest": { + "type": "object", + "required": [ + "activity_category_id", + "name" + ], + "properties": { + "activity_category_id": { + "type": "integer" + }, + "allow_coupons": { + "type": "integer" + }, + "allow_item_cards": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "draw_mode": { + "type": "string" + }, + "end_time": { + "type": "string" + }, + "gameplay_intro": { + "type": "string" + }, + "image": { + "type": "string" + }, + "interval_minutes": { + "type": "integer" + }, + "is_boss": { + "type": "integer" + }, + "min_participants": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "play_type": { + "type": "string" + }, + "price_draw": { + "type": "integer" + }, + "refund_coupon_amount": { + "type": "number" + }, + "refund_coupon_id": { + "type": "integer" + }, + "refund_coupon_type": { + "type": "string" + }, + "scheduled_delay_minutes": { + "type": "integer" + }, + "scheduled_time": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "status": { + "type": "integer" + } + } + }, + "admin.createBannerRequest": { + "type": "object", + "required": [ + "image_url", + "title" + ], + "properties": { + "image_url": { + "type": "string" + }, + "link_url": { + "type": "string" + }, + "sort": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "title": { + "type": "string" + } + } + }, + "admin.createBannerResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "admin.createGamePassPackageRequest": { + "type": "object", + "required": [ + "name", + "pass_count", + "price" + ], + "properties": { + "activity_id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "original_price": { + "type": "integer" + }, + "pass_count": { + "type": "integer", + "minimum": 1 + }, + "price": { + "type": "integer", + "minimum": 0 + }, + "sort_order": { + "type": "integer" + }, + "status": { + "description": "1=上架 2=下架", + "type": "integer" + }, + "valid_days": { + "type": "integer" + } + } + }, + "admin.createGamePassPackageResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "admin.createIssueRequest": { + "type": "object", + "required": [ + "issue_number" + ], + "properties": { + "issue_number": { + "type": "string" + }, + "sort": { + "type": "integer" + }, + "status": { + "type": "integer" + } + } + }, + "admin.createItemCardRequest": { + "type": "object", + "required": [ + "card_type", + "effect_type", + "name", + "price", + "scope_type" + ], + "properties": { + "activity_category_id": { + "type": "integer" + }, + "activity_id": { + "type": "integer" + }, + "boost_rate_x1000": { + "type": "integer" + }, + "card_type": { + "type": "integer" + }, + "effect_type": { + "type": "integer" + }, + "issue_id": { + "type": "integer" + }, + "max_effect_value_x1000": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "price": { + "type": "integer" + }, + "remark": { + "type": "string" + }, + "reward_multiplier_x1000": { + "type": "integer" + }, + "scope_type": { + "type": "integer" + }, + "stacking_strategy": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "valid_end_unix": { + "type": "integer" + }, + "valid_start_unix": { + "type": "integer" + } + } + }, + "admin.createItemCardResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "admin.createProductCategoryRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "parent_id": { + "type": "integer" + }, + "status": { + "type": "integer" + } + } + }, + "admin.createProductCategoryResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "admin.createProductRequest": { + "type": "object", + "required": [ + "category_id", + "name", + "price", + "stock" + ], + "properties": { + "category_id": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "images_json": { + "type": "string" + }, + "name": { + "type": "string" + }, + "price": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "stock": { + "type": "integer" + } + } + }, + "admin.createProductResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "admin.createRewardsRequest": { + "type": "object", + "required": [ + "rewards" + ], + "properties": { + "rewards": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.rewardItem" + } + } + } + }, + "admin.createUserRequest": { + "type": "object", + "required": [ + "password", + "username" + ], + "properties": { + "avatar": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "admin.createUserResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "admin.gamePassItem": { + "type": "object", + "properties": { + "activity_id": { + "type": "integer" + }, + "activity_name": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "expired_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "remaining": { + "type": "integer" + }, + "remark": { + "type": "string" + }, + "source": { + "type": "string" + }, + "total_granted": { + "type": "integer" + }, + "total_used": { + "type": "integer" + }, + "user_id": { + "type": "integer" + }, + "user_name": { + "type": "string" + } + } + }, + "admin.gamePassPackageItem": { + "type": "object", + "properties": { + "activity_id": { + "type": "integer" + }, + "activity_name": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "original_price": { + "type": "integer" + }, + "pass_count": { + "type": "integer" + }, + "price": { + "type": "integer" + }, + "sort_order": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "valid_days": { + "type": "integer" + } + } + }, + "admin.getOrderSnapshotsResponse": { + "type": "object", + "properties": { + "after_snapshot": { + "$ref": "#/definitions/snapshot.UserStateSnapshot" + }, + "before_snapshot": { + "$ref": "#/definitions/snapshot.UserStateSnapshot" + }, + "diff": { + "$ref": "#/definitions/snapshot.SnapshotDiff" + }, + "has_snapshots": { + "type": "boolean" + }, + "order": { + "type": "object", + "properties": { + "actual_amount": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "order_no": { + "type": "string" + }, + "paid_at": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "user_id": { + "type": "integer" + } + } + } + } + }, + "admin.getUserGamePassesResponse": { + "type": "object", + "properties": { + "activity_passes": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.gamePassItem" + } + }, + "global_remaining": { + "type": "integer" + }, + "total_remaining": { + "type": "integer" + }, + "user_id": { + "type": "integer" + } + } + }, + "admin.grantGamePassRequest": { + "type": "object", + "required": [ + "count", + "user_id" + ], + "properties": { + "activity_id": { + "description": "可选,NULL表示全局通用", + "type": "integer" + }, + "count": { + "type": "integer", + "minimum": 1 + }, + "remark": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "valid_days": { + "description": "可选,NULL表示永久有效", + "type": "integer" + } + } + }, + "admin.grantGamePassResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + "admin.issueUserTokenResponse": { + "type": "object", + "properties": { + "expires_in": { + "type": "integer" + }, + "token": { + "type": "string" + } + } + }, + "admin.itemCardListItem": { + "type": "object", + "properties": { + "activity_category_id": { + "type": "integer" + }, + "activity_id": { + "type": "integer" + }, + "boost_rate_x1000": { + "type": "integer" + }, + "card_type": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "effect_type": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "issue_id": { + "type": "integer" + }, + "max_effect_value_x1000": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "price": { + "type": "integer" + }, + "remark": { + "type": "string" + }, + "reward_multiplier_x1000": { + "type": "integer" + }, + "scope_type": { + "type": "integer" + }, + "stacking_strategy": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "updated_at": { + "type": "string" + }, + "valid_end": { + "type": "string" + }, + "valid_start": { + "type": "string" + } + } + }, + "admin.listActivitiesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.activityItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listBannersResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.bannerItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listCategoriesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.categoryItem" + } + } + } + }, + "admin.listCouponsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.adminUserCouponItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listGamePassPackagesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.gamePassPackageItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listGamePassesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.gamePassItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listInventoryResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/user.InventoryWithProduct" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listInvitesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.adminUserItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listIssuesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.activitysvcIssueData" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listItemCardsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.itemCardListItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listMatchingCardTypesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.matchingCardTypeResponse" + } + }, + "total": { + "type": "integer" + } + } + }, + "admin.listOrdersResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/user.OrderWithItems" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listPointsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.UserPointsLedger" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listProductCategoriesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.productCategoryListItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listProductsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.productItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listRewardsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.rewardItem" + } + } + } + }, + "admin.listShippingOrdersResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.ShippingOrderGroup" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listUserItemCardsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/user.ItemCardWithTemplate" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.listUsersResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.adminUserItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.loginRequest": { + "type": "object", + "required": [ + "password", + "username" + ], + "properties": { + "password": { + "description": "密码 (MD5加密后的密码)", + "type": "string" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "admin.loginResponse": { + "type": "object", + "properties": { + "is_super": { + "description": "是否是超级管理员(1:是 0:否)", + "type": "integer" + }, + "token": { + "description": "登录成功后颁发的 Token", + "type": "string" + } + } + }, + "admin.matchingCardTypeRequest": { + "type": "object", + "required": [ + "code", + "name" + ], + "properties": { + "code": { + "type": "string" + }, + "image_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "quantity": { + "type": "integer" + }, + "sort": { + "type": "integer" + }, + "status": { + "type": "integer" + } + } + }, + "admin.matchingCardTypeResponse": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "image_url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "quantity": { + "type": "integer" + }, + "sort": { + "type": "integer" + }, + "status": { + "type": "integer" + } + } + }, + "admin.modifyActivityRequest": { + "type": "object", + "properties": { + "activity_category_id": { + "type": "integer" + }, + "allow_coupons": { + "type": "integer" + }, + "allow_item_cards": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "draw_mode": { + "type": "string" + }, + "end_time": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "gameplay_intro": { + "type": "string" + }, + "image": { + "type": "string" + }, + "interval_minutes": { + "type": "integer" + }, + "is_boss": { + "type": "integer" + }, + "min_participants": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "play_type": { + "type": "string" + }, + "price_draw": { + "type": "integer" + }, + "refund_coupon_amount": { + "type": "number" + }, + "refund_coupon_id": { + "type": "integer" + }, + "refund_coupon_type": { + "type": "string" + }, + "scheduled_delay_minutes": { + "type": "integer" + }, + "scheduled_time": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "status": { + "type": "integer" + } + } + }, + "admin.modifyBannerRequest": { + "type": "object", + "properties": { + "image_url": { + "type": "string" + }, + "link_url": { + "type": "string" + }, + "sort": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "title": { + "type": "string" + } + } + }, + "admin.modifyGamePassPackageRequest": { + "type": "object", + "properties": { + "activity_id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "original_price": { + "type": "integer" + }, + "pass_count": { + "type": "integer" + }, + "price": { + "type": "integer" + }, + "sort_order": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "valid_days": { + "type": "integer" + } + } + }, + "admin.modifyIssueRequest": { + "type": "object", + "properties": { + "issue_number": { + "type": "string" + }, + "sort": { + "type": "integer" + }, + "status": { + "type": "integer" + } + } + }, + "admin.modifyItemCardRequest": { + "type": "object", + "properties": { + "activity_category_id": { + "type": "integer" + }, + "activity_id": { + "type": "integer" + }, + "boost_rate_x1000": { + "type": "integer" + }, + "card_type": { + "type": "integer" + }, + "effect_type": { + "type": "integer" + }, + "issue_id": { + "type": "integer" + }, + "max_effect_value_x1000": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "price": { + "type": "integer" + }, + "remark": { + "type": "string" + }, + "reward_multiplier_x1000": { + "type": "integer" + }, + "scope_type": { + "type": "integer" + }, + "stacking_strategy": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "valid_end_unix": { + "type": "integer" + }, + "valid_start_unix": { + "type": "integer" + } + } + }, + "admin.modifyProductCategoryRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parent_id": { + "type": "integer" + }, + "status": { + "type": "integer" + } + } + }, + "admin.modifyProductRequest": { + "type": "object", + "properties": { + "category_id": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "images_json": { + "type": "string" + }, + "name": { + "type": "string" + }, + "price": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "stock": { + "type": "integer" + } + } + }, + "admin.modifyRewardRequest": { + "type": "object", + "properties": { + "is_boss": { + "type": "integer" + }, + "level": { + "type": "integer" + }, + "min_score": { + "type": "integer" + }, + "original_qty": { + "type": "integer" + }, + "product_id": { + "type": "integer" + }, + "quantity": { + "type": "integer" + }, + "sort": { + "type": "integer" + }, + "weight": { + "type": "number" + } + } + }, + "admin.pcSimpleMessage": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "admin.pointsBalanceResponse": { + "type": "object", + "properties": { + "balance": { + "type": "integer" + } + } + }, + "admin.productCategoryListItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "parent_id": { + "type": "integer" + }, + "status": { + "type": "integer" + } + } + }, + "admin.productItem": { + "type": "object", + "properties": { + "category_id": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "images_json": { + "type": "string" + }, + "name": { + "type": "string" + }, + "price": { + "type": "integer" + }, + "sales": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "stock": { + "type": "integer" + } + } + }, + "admin.refreshResponse": { + "type": "object", + "properties": { + "expires_in": { + "type": "integer" + }, + "token": { + "type": "string" + } + } + }, + "admin.rewardItem": { + "type": "object", + "required": [ + "level", + "original_qty", + "quantity", + "weight" + ], + "properties": { + "id": { + "type": "integer" + }, + "is_boss": { + "type": "integer" + }, + "level": { + "type": "integer" + }, + "min_score": { + "type": "integer" + }, + "original_qty": { + "type": "integer" + }, + "product_id": { + "type": "integer" + }, + "product_image_url": { + "type": "string" + }, + "product_name": { + "type": "string" + }, + "product_price": { + "type": "number" + }, + "quantity": { + "type": "integer" + }, + "sort": { + "type": "integer" + }, + "weight": { + "type": "number" + } + } + }, + "admin.roleItem": { + "type": "object", + "properties": { + "createTime": { + "type": "string" + }, + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "roleCode": { + "type": "string" + }, + "roleId": { + "type": "integer" + }, + "roleName": { + "type": "string" + } + } + }, + "admin.roleListResponse": { + "type": "object", + "properties": { + "current": { + "type": "integer" + }, + "records": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.roleItem" + } + }, + "size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "admin.rollbackOrderRequest": { + "type": "object", + "properties": { + "confirm": { + "type": "boolean" + }, + "reason": { + "type": "string" + } + } + }, + "admin.rollbackOrderResponse": { + "type": "object", + "properties": { + "coupons_restored": { + "type": "integer" + }, + "error_msg": { + "type": "string" + }, + "inventory_revoked": { + "type": "integer" + }, + "item_cards_restored": { + "type": "integer" + }, + "points_restored": { + "type": "integer" + }, + "refund_amount": { + "type": "integer" + }, + "rollback_log_id": { + "type": "integer" + }, + "success": { + "type": "boolean" + } + } + }, + "admin.simpleMessage": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "admin.simpleMessageResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "admin.updateShippingRequest": { + "type": "object", + "properties": { + "express_code": { + "description": "快递公司编码", + "type": "string" + }, + "express_no": { + "description": "运单号", + "type": "string" + }, + "record_ids": { + "description": "发货记录ID列表", + "type": "array", + "items": { + "type": "integer" + } + }, + "status": { + "description": "状态", + "type": "integer" + } + } + }, + "admin.updateShippingResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "updated_count": { + "type": "integer" + } + } + }, + "admin.userListItem": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "createBy": { + "type": "string" + }, + "createTime": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "nickName": { + "type": "string" + }, + "status": { + "type": "string" + }, + "updateBy": { + "type": "string" + }, + "updateTime": { + "type": "string" + }, + "userEmail": { + "type": "string" + }, + "userGender": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "userPhone": { + "type": "string" + }, + "userRoles": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "admin.userListResponse": { + "type": "object", + "properties": { + "current": { + "type": "integer" + }, + "records": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.userListItem" + } + }, + "size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.MatchingRewardInfo": { + "type": "object", + "properties": { + "level": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "product_image": { + "description": "商品图片", + "type": "string" + }, + "product_name": { + "description": "商品原始名称", + "type": "string" + }, + "reward_id": { + "type": "integer" + } + } + }, + "app.activityDetailResponse": { + "type": "object", + "properties": { + "activity_category_id": { + "type": "integer" + }, + "allow_coupons": { + "type": "boolean" + }, + "allow_item_cards": { + "type": "boolean" + }, + "banner": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "draw_mode": { + "type": "string" + }, + "end_time": { + "type": "string" + }, + "gameplay_intro": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "image": { + "type": "string" + }, + "interval_minutes": { + "type": "integer" + }, + "is_boss": { + "type": "integer" + }, + "last_settled_at": { + "type": "string" + }, + "min_participants": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "play_type": { + "type": "string" + }, + "price_draw": { + "type": "integer" + }, + "refund_coupon_id": { + "type": "integer" + }, + "scheduled_time": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "updated_at": { + "type": "string" + } + } + }, + "app.activityItem": { + "type": "object", + "properties": { + "activity_category_id": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "category_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "image": { + "type": "string" + }, + "is_boss": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "price_draw": { + "type": "integer" + }, + "status": { + "type": "integer" + } + } + }, + "app.addAddressRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "city": { + "type": "string" + }, + "district": { + "type": "string" + }, + "is_default": { + "type": "boolean" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "province": { + "type": "string" + } + } + }, + "app.addAddressResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, + "app.addressShareCreateRequest": { + "type": "object", + "properties": { + "expires_at": { + "type": "string" + }, + "expires_in_minutes": { + "type": "integer" + }, + "inventory_id": { + "type": "integer" + } + } + }, + "app.addressShareCreateResponse": { + "type": "object", + "properties": { + "expires_at": { + "type": "string" + }, + "share_token": { + "type": "string" + }, + "share_url": { + "type": "string" + }, + "short_link": { + "type": "string" + } + } + }, + "app.addressShareRevokeRequest": { + "type": "object", + "properties": { + "inventory_id": { + "type": "integer" + } + } + }, + "app.addressShareSubmitRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "city": { + "type": "string" + }, + "district": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "province": { + "type": "string" + }, + "share_token": { + "type": "string" + } + } + }, + "app.addressShareSubmitResponse": { + "type": "object", + "properties": { + "address_id": { + "type": "integer" + } + } + }, + "app.appBannerItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "image_url": { + "type": "string" + }, + "link_url": { + "type": "string" + }, + "sort": { + "type": "integer" + }, + "title": { + "type": "string" + } + } + }, + "app.appCategoryItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "app.appNoticeItem": { + "type": "object", + "properties": { + "content": { + "type": "string" + } + } + }, + "app.bindDouyinPhoneRequest": { + "type": "object", + "properties": { + "code": { + "type": "string" + } + } + }, + "app.bindDouyinPhoneResponse": { + "type": "object", + "properties": { + "mobile": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "app.bindPhoneRequest": { + "type": "object", + "properties": { + "code": { + "type": "string" + } + } + }, + "app.bindPhoneResponse": { + "type": "object", + "properties": { + "mobile": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "app.cancelOrderRequest": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + } + }, + "app.cancelOrderResponse": { + "type": "object", + "properties": { + "cancelled_at": { + "type": "string" + }, + "order_id": { + "type": "integer" + }, + "order_no": { + "type": "string" + }, + "status": { + "type": "integer" + } + } + }, + "app.cancelShippingRequest": { + "type": "object", + "properties": { + "batch_no": { + "description": "批次号(与inventory_id二选一,取消整批)", + "type": "string" + }, + "inventory_id": { + "description": "单个资产ID(与batch_no二选一)", + "type": "integer" + } + } + }, + "app.cancelShippingResponse": { + "type": "object", + "properties": { + "cancelled_count": { + "description": "成功取消的数量", + "type": "integer" + } + } + }, + "app.couponDetail": { + "type": "object", + "properties": { + "amount": { + "description": "原始面值", + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "remaining": { + "description": "剩余额度", + "type": "integer" + }, + "status": { + "type": "integer" + }, + "use_count": { + "description": "使用次数", + "type": "integer" + }, + "used_amount": { + "description": "累计已使用金额", + "type": "integer" + }, + "valid_end": { + "type": "string" + }, + "valid_start": { + "type": "string" + } + } + }, + "app.couponItem": { + "type": "object", + "properties": { + "amount": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "remaining": { + "type": "integer" + }, + "rules": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "used_at": { + "description": "使用时间(已使用时返回)", + "type": "string" + }, + "valid_end": { + "type": "string" + }, + "valid_start": { + "type": "string" + } + } + }, + "app.couponStatsResponse": { + "type": "object", + "properties": { + "expired_count": { + "description": "已过期优惠券数量", + "type": "integer" + }, + "total_remaining": { + "description": "可用优惠券总余额(分)", + "type": "integer" + }, + "total_saved": { + "description": "累计节省金额(分)", + "type": "integer" + }, + "unused_count": { + "description": "可用优惠券数量", + "type": "integer" + }, + "used_count": { + "description": "已使用优惠券数量", + "type": "integer" + } + } + }, + "app.couponUsageItem": { + "type": "object", + "properties": { + "activity_name": { + "description": "活动名称", + "type": "string" + }, + "amount": { + "description": "本次使用金额(正数)", + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "order_no": { + "description": "订单号", + "type": "string" + } + } + }, + "app.douyinLoginRequest": { + "type": "object", + "properties": { + "anonymous_code": { + "type": "string" + }, + "channel_code": { + "type": "string" + }, + "code": { + "type": "string" + }, + "invite_code": { + "type": "string" + } + } + }, + "app.douyinLoginResponse": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "invite_code": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "token": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "app.drawLogGroup": { + "type": "object", + "properties": { + "level": { + "type": "integer" + }, + "level_name": { + "type": "string" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.drawLogItem" + } + } + } + }, + "app.drawLogItem": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "current_level": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "is_winner": { + "type": "integer" + }, + "issue_id": { + "type": "integer" + }, + "level": { + "type": "integer" + }, + "order_id": { + "type": "integer" + }, + "reward_id": { + "type": "integer" + }, + "reward_image": { + "type": "string" + }, + "reward_name": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "user_name": { + "type": "string" + } + } + }, + "app.getAppProductDetailResponse": { + "type": "object", + "properties": { + "album": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "points_required": { + "type": "integer" + }, + "price": { + "type": "integer" + }, + "recommendations": { + "type": "array", + "items": { + "$ref": "#/definitions/app.listAppProductsItem" + } + }, + "sales": { + "type": "integer" + }, + "service": { + "type": "array", + "items": { + "type": "string" + } + }, + "stock": { + "type": "integer" + } + } + }, + "app.getGamePassesResponse": { + "type": "object", + "properties": { + "global_remaining": { + "description": "全局通用次数", + "type": "integer" + }, + "passes": { + "type": "array", + "items": { + "$ref": "#/definitions/app.userGamePassItem" + } + }, + "total_remaining": { + "type": "integer" + } + } + }, + "app.getPackagesResponse": { + "type": "object", + "properties": { + "packages": { + "type": "array", + "items": { + "$ref": "#/definitions/app.packageItem" + } + } + } + }, + "app.inviteUserItem": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "invite_code": { + "type": "string" + }, + "nickname": { + "type": "string" + } + } + }, + "app.issueItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "issue_number": { + "type": "string" + }, + "remaining_prize_quantity": { + "type": "integer" + }, + "sort": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "total_prize_quantity": { + "type": "integer" + } + } + }, + "app.joinLotteryRequest": { + "type": "object", + "properties": { + "activity_id": { + "type": "integer" + }, + "channel": { + "type": "string" + }, + "count": { + "type": "integer" + }, + "coupon_id": { + "type": "integer" + }, + "issue_id": { + "type": "integer" + }, + "item_card_id": { + "type": "integer" + }, + "slot_index": { + "type": "array", + "items": { + "type": "integer" + } + }, + "use_game_pass": { + "type": "boolean" + }, + "use_points": { + "type": "integer" + } + } + }, + "app.joinLotteryResponse": { + "type": "object", + "properties": { + "actual_amount": { + "type": "integer" + }, + "draw_mode": { + "type": "string" + }, + "join_id": { + "type": "string" + }, + "order_no": { + "type": "string" + }, + "queued": { + "type": "boolean" + }, + "reward_id": { + "type": "integer" + }, + "reward_name": { + "type": "string" + }, + "status": { + "type": "integer" + } + } + }, + "app.jsapiPreorderRequest": { + "type": "object", + "properties": { + "openid": { + "type": "string" + }, + "order_no": { + "type": "string" + } + } + }, + "app.jsapiPreorderResponse": { + "type": "object", + "properties": { + "nonceStr": { + "type": "string" + }, + "package": { + "type": "string" + }, + "paySign": { + "type": "string" + }, + "signType": { + "type": "string" + }, + "timeStamp": { + "type": "string" + } + } + }, + "app.listActivitiesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.activityItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listAddressesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.UserAddresses" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listAppBannersResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.appBannerItem" + } + } + } + }, + "app.listAppCategoriesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.appCategoryItem" + } + } + } + }, + "app.listAppNoticesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.appNoticeItem" + } + } + } + }, + "app.listAppProductsItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "in_stock": { + "type": "boolean" + }, + "main_image": { + "type": "string" + }, + "name": { + "type": "string" + }, + "points_required": { + "type": "integer" + }, + "price": { + "type": "integer" + }, + "sales": { + "type": "integer" + } + } + }, + "app.listAppProductsResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.listAppProductsItem" + } + }, + "pageSize": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listCouponUsageResponse": { + "type": "object", + "properties": { + "coupon": { + "$ref": "#/definitions/app.couponDetail" + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "records": { + "type": "array", + "items": { + "$ref": "#/definitions/app.couponUsageItem" + } + }, + "total": { + "type": "integer" + } + } + }, + "app.listCouponsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.couponItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listDrawLogsByLevelResponse": { + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "$ref": "#/definitions/app.drawLogGroup" + } + } + } + }, + "app.listDrawLogsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.drawLogItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listInventoryResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/user.AggregatedInventory" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listInvitesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.inviteUserItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listIssueChoicesResponse": { + "type": "object", + "properties": { + "available": { + "type": "array", + "items": { + "type": "integer" + } + }, + "claimed": { + "type": "array", + "items": { + "type": "integer" + } + }, + "total_slots": { + "type": "integer" + } + } + }, + "app.listIssuesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.issueItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listOrdersResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/user.OrderWithItems" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listPointsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.UserPointsLedger" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listRewardsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.rewardItem" + } + }, + "play_type": { + "description": "活动类型", + "type": "string" + } + } + }, + "app.listShipmentsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/user.ShipmentGroup" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listStoreItem": { + "type": "object", + "properties": { + "discount_type": { + "type": "integer" + }, + "discount_value": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "in_stock": { + "type": "boolean" + }, + "kind": { + "type": "string" + }, + "main_image": { + "type": "string" + }, + "min_spend": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "points_required": { + "type": "integer" + }, + "price": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "supported": { + "type": "boolean" + } + } + }, + "app.listStoreItemsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/app.listStoreItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listUserItemCardUsesResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ActivityDrawEffects" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.listUserItemCardsResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/user.ItemCardWithTemplate" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "app.matchingGameCardsResponse": { + "type": "object", + "properties": { + "all_cards": { + "type": "array", + "items": { + "$ref": "#/definitions/activity.MatchingCard" + } + }, + "game_id": { + "type": "string" + } + } + }, + "app.matchingGameCheckRequest": { + "type": "object", + "required": [ + "game_id" + ], + "properties": { + "game_id": { + "type": "string" + }, + "total_pairs": { + "description": "客户端上报的消除总对数", + "type": "integer" + } + } + }, + "app.matchingGameCheckResponse": { + "type": "object", + "properties": { + "finished": { + "type": "boolean" + }, + "game_id": { + "type": "string" + }, + "reward": { + "$ref": "#/definitions/app.MatchingRewardInfo" + }, + "total_pairs": { + "type": "integer" + } + } + }, + "app.matchingGamePreOrderRequest": { + "type": "object", + "properties": { + "coupon_id": { + "type": "integer" + }, + "issue_id": { + "type": "integer" + }, + "item_card_id": { + "type": "integer" + }, + "position": { + "type": "string" + }, + "use_game_pass": { + "description": "新增:是否使用次数卡", + "type": "boolean" + } + } + }, + "app.matchingGamePreOrderResponse": { + "type": "object", + "properties": { + "game_id": { + "type": "string" + }, + "order_no": { + "type": "string" + }, + "pay_status": { + "description": "1=Pending, 2=Paid", + "type": "integer" + }, + "server_seed_hash": { + "type": "string" + } + } + }, + "app.modifyUserRequest": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "nickname": { + "type": "string" + } + } + }, + "app.modifyUserResponse": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/app.userItem" + } + } + }, + "app.okDeleteResponse": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + } + } + }, + "app.okResponse": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + } + } + }, + "app.orderResultItem": { + "type": "object", + "properties": { + "draw_index": { + "type": "integer" + }, + "image": { + "type": "string" + }, + "level": { + "type": "integer" + }, + "reward_id": { + "type": "integer" + }, + "reward_name": { + "type": "string" + } + } + }, + "app.orderResultResponse": { + "type": "object", + "properties": { + "completed": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "draw_mode": { + "type": "string" + }, + "nextPollMs": { + "type": "integer" + }, + "next_draw_time": { + "type": "string" + }, + "receipt": { + "type": "object", + "additionalProperties": {} + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/app.orderResultItem" + } + }, + "seed_hex": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "app.packageItem": { + "type": "object", + "properties": { + "activity_id": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "original_price": { + "type": "integer" + }, + "pass_count": { + "type": "integer" + }, + "price": { + "type": "integer" + }, + "valid_days": { + "type": "integer" + } + } + }, + "app.pointsBalanceResponse": { + "type": "object", + "properties": { + "balance": { + "type": "integer" + } + } + }, + "app.purchasePackageRequest": { + "type": "object", + "required": [ + "package_id" + ], + "properties": { + "count": { + "description": "购买数量", + "type": "integer" + }, + "package_id": { + "type": "integer" + } + } + }, + "app.purchasePackageResponse": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "order_no": { + "type": "string" + } + } + }, + "app.redeemCouponRequest": { + "type": "object", + "properties": { + "coupon_id": { + "type": "integer" + } + } + }, + "app.redeemCouponResponse": { + "type": "object", + "properties": { + "coupon_id": { + "type": "integer" + }, + "ledger_id": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "app.redeemInventoryRequest": { + "type": "object", + "properties": { + "inventory_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "app.redeemInventoryResponse": { + "type": "object", + "properties": { + "points": { + "type": "integer" + } + } + }, + "app.redeemItemCardRequest": { + "type": "object", + "properties": { + "card_id": { + "type": "integer" + }, + "quantity": { + "type": "integer" + } + } + }, + "app.redeemItemCardResponse": { + "type": "object", + "properties": { + "card_id": { + "type": "integer" + }, + "ledger_id": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "app.redeemProductRequest": { + "type": "object", + "properties": { + "product_id": { + "type": "integer" + }, + "quantity": { + "type": "integer" + } + } + }, + "app.redeemProductResponse": { + "type": "object", + "properties": { + "inventory_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "ledger_id": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "order_id": { + "type": "integer" + }, + "success": { + "type": "boolean" + } + } + }, + "app.requestShippingBatchRequest": { + "type": "object", + "properties": { + "address_id": { + "type": "integer" + }, + "inventory_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "app.requestShippingBatchResponse": { + "type": "object", + "properties": { + "address_id": { + "type": "integer" + }, + "batch_no": { + "type": "string" + }, + "failed": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} + } + }, + "skipped": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} + } + }, + "success_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "app.requestShippingRequest": { + "type": "object", + "properties": { + "inventory_id": { + "type": "integer" + } + } + }, + "app.requestShippingResponse": { + "type": "object", + "properties": { + "address_id": { + "type": "integer" + } + } + }, + "app.resultResponse": { + "type": "object", + "properties": { + "receipt": { + "type": "object", + "additionalProperties": {} + }, + "result": { + "type": "object", + "additionalProperties": {} + }, + "results": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} + } + } + } + }, + "app.rewardItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "is_boss": { + "type": "integer" + }, + "level": { + "type": "integer" + }, + "min_score": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "original_qty": { + "type": "integer" + }, + "prize_level": { + "description": "兼容部分前端逻辑", + "type": "integer" + }, + "product_id": { + "type": "integer" + }, + "product_image": { + "type": "string" + }, + "quantity": { + "type": "integer" + }, + "sort": { + "type": "integer" + }, + "weight": { + "type": "integer" + } + } + }, + "app.sendSmsCodeRequest": { + "type": "object", + "required": [ + "mobile" + ], + "properties": { + "mobile": { + "type": "string" + } + } + }, + "app.sendSmsCodeResponse": { + "type": "object", + "properties": { + "expire_seconds": { + "type": "integer" + }, + "success": { + "type": "boolean" + } + } + }, + "app.smsLoginRequest": { + "type": "object", + "required": [ + "code", + "mobile" + ], + "properties": { + "code": { + "type": "string" + }, + "invite_code": { + "type": "string" + }, + "mobile": { + "type": "string" + } + } + }, + "app.smsLoginResponse": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "invite_code": { + "type": "string" + }, + "is_new_user": { + "type": "boolean" + }, + "mobile": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "openid": { + "type": "string" + }, + "token": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "app.updateAddressRequest": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "city": { + "type": "string" + }, + "district": { + "type": "string" + }, + "is_default": { + "type": "boolean" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "province": { + "type": "string" + } + } + }, + "app.userGamePassItem": { + "type": "object", + "properties": { + "activity_id": { + "type": "integer" + }, + "activity_name": { + "type": "string" + }, + "expired_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "remaining": { + "type": "integer" + }, + "source": { + "type": "string" + } + } + }, + "app.userItem": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "balance": { + "description": "Points", + "type": "integer" + }, + "id": { + "type": "integer" + }, + "invite_code": { + "type": "string" + }, + "inviter_id": { + "type": "integer" + }, + "mobile": { + "type": "string" + }, + "nickname": { + "type": "string" + } + } + }, + "app.userStatsResponse": { + "type": "object", + "properties": { + "coupon_count": { + "type": "integer" + }, + "item_card_count": { + "type": "integer" + }, + "points_balance": { + "type": "integer" + } + } + }, + "app.weixinLoginRequest": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "douyin_id": { + "type": "string" + }, + "invite_code": { + "type": "string" + } + } + }, + "app.weixinLoginResponse": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "invite_code": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "openid": { + "type": "string" + }, + "token": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "code.Failure": { + "type": "object", + "properties": { + "code": { + "description": "业务码", + "type": "integer" + }, + "message": { + "description": "描述信息", + "type": "string" + } + } + }, + "game.consumeTicketRequest": { + "type": "object", + "properties": { + "game_code": { + "type": "string" + }, + "ticket": { + "type": "string" + }, + "user_id": { + "type": "string" + } + } + }, + "game.consumeTicketResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "game.enterGameRequest": { + "type": "object", + "required": [ + "game_code" + ], + "properties": { + "game_code": { + "type": "string" + } + } + }, + "game.enterGameResponse": { + "type": "object", + "properties": { + "client_url": { + "type": "string" + }, + "expires_at": { + "type": "string" + }, + "game_token": { + "type": "string" + }, + "nakama_key": { + "type": "string" + }, + "nakama_server": { + "type": "string" + }, + "remaining_times": { + "type": "integer" + } + } + }, + "game.grantTicketRequest": { + "type": "object", + "required": [ + "amount", + "game_code" + ], + "properties": { + "amount": { + "type": "integer", + "minimum": 1 + }, + "game_code": { + "type": "string" + }, + "remark": { + "type": "string" + } + } + }, + "game.settleRequest": { + "type": "object", + "properties": { + "match_id": { + "type": "string" + }, + "score": { + "type": "integer" + }, + "ticket": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "win": { + "type": "boolean" + } + } + }, + "game.settleResponse": { + "type": "object", + "properties": { + "reward": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "game.validateTokenRequest": { + "type": "object", + "required": [ + "game_token" + ], + "properties": { + "game_token": { + "type": "string" + } + } + }, + "game.validateTokenResponse": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "error": { + "type": "string" + }, + "game_type": { + "type": "string" + }, + "ticket": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "valid": { + "type": "boolean" + } + } + }, + "game.verifyRequest": { + "type": "object", + "properties": { + "ticket": { + "type": "string" + }, + "user_id": { + "type": "string" + } + } + }, + "game.verifyResponse": { + "type": "object", + "properties": { + "game_config": { + "type": "object", + "additionalProperties": {} + }, + "user_id": { + "type": "string" + }, + "valid": { + "type": "boolean" + } + } + }, + "minesweeper.SettleGameRequest": { + "type": "object", + "properties": { + "match_id": { + "type": "string" + }, + "metadata": { + "type": "string" + }, + "score": { + "type": "integer" + }, + "ticket": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "win": { + "type": "boolean" + } + } + }, + "minesweeper.SettleGameResponse": { + "type": "object", + "properties": { + "reward": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "minesweeper.VerifyTicketRequest": { + "type": "object", + "properties": { + "ticket": { + "type": "string" + }, + "user_id": { + "type": "string" + } + } + }, + "minesweeper.VerifyTicketResponse": { + "type": "object", + "properties": { + "remaining_times": { + "type": "integer" + }, + "user_id": { + "type": "string" + }, + "valid": { + "type": "boolean" + } + } + }, + "model.ActivityDrawEffects": { + "type": "object", + "properties": { + "activity_category_id": { + "description": "范围快照-活动分类ID", + "type": "integer" + }, + "activity_id": { + "description": "范围快照-活动ID", + "type": "integer" + }, + "applied": { + "description": "是否生效:0否 1是", + "type": "integer" + }, + "card_type": { + "description": "卡类型快照", + "type": "integer" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "draw_log_id": { + "description": "抽奖日志ID(activity_draw_logs.id)", + "type": "integer" + }, + "effect_type": { + "description": "效果类型快照", + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "issue_id": { + "description": "范围快照-期ID", + "type": "integer" + }, + "probability_delta_x1000": { + "description": "概率相对增益(千分比)", + "type": "integer" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "reward_multiplier_x1000": { + "description": "奖励倍数(千分比)", + "type": "integer" + }, + "scope_type": { + "description": "适用范围快照", + "type": "integer" + }, + "system_item_card_id": { + "description": "卡模板ID(system_item_cards.id)", + "type": "integer" + }, + "user_id": { + "description": "用户ID(users.id)", + "type": "integer" + }, + "user_item_card_id": { + "description": "用户卡实例ID(user_item_cards.id)", + "type": "integer" + } + } + }, + "model.OrderItems": { + "type": "object", + "properties": { + "created_at": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "order_id": { + "description": "订单ID(orders.id)", + "type": "integer" + }, + "price": { + "description": "成交单价(分)", + "type": "integer" + }, + "product_id": { + "description": "商品ID(products.id)", + "type": "integer" + }, + "product_images": { + "description": "商品图片快照(JSON)", + "type": "string" + }, + "quantity": { + "description": "购买数量", + "type": "integer" + }, + "status": { + "description": "行状态:1正常 2取消", + "type": "integer" + }, + "title": { + "description": "商品标题快照", + "type": "string" + }, + "total_amount": { + "description": "行应付总额(分)", + "type": "integer" + } + } + }, + "model.ShippingRecords": { + "type": "object", + "properties": { + "address_id": { + "description": "收货地址ID(user_addresses.id)", + "type": "integer" + }, + "batch_no": { + "description": "批次号(批量发货时用于聚合)", + "type": "string" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "express_code": { + "description": "快递公司编码", + "type": "string" + }, + "express_no": { + "description": "运单号", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "inventory_id": { + "description": "资产ID(抽奖产物发货时使用)", + "type": "integer" + }, + "order_id": { + "description": "关联订单ID(orders.id,抽奖产物可为空)", + "type": "integer" + }, + "order_item_id": { + "description": "订单行ID(商城直发时使用)", + "type": "integer" + }, + "price": { + "description": "行价格(分,可选)", + "type": "integer" + }, + "product_id": { + "description": "商品ID(统计/冗余)", + "type": "integer" + }, + "quantity": { + "description": "发货数量", + "type": "integer" + }, + "received_at": { + "description": "签收时间", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "shipped_at": { + "description": "发货时间", + "type": "string" + }, + "status": { + "description": "发货状态:1待发货 2已发货 3已签收 4异常", + "type": "integer" + }, + "updated_at": { + "description": "更新时间", + "type": "string" + }, + "user_id": { + "description": "收件用户ID(user_members.id)", + "type": "integer" + } + } + }, + "model.UserAddresses": { + "type": "object", + "properties": { + "address": { + "description": "详细地址", + "type": "string" + }, + "city": { + "description": "市", + "type": "string" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "default_user_unique": { + "description": "用于唯一约束的生成列:默认地址→user_id", + "type": "integer" + }, + "district": { + "description": "区/县", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "is_default": { + "description": "是否默认地址:0否 1是", + "type": "integer" + }, + "mobile": { + "description": "收件人手机号", + "type": "string" + }, + "name": { + "description": "收件人姓名", + "type": "string" + }, + "province": { + "description": "省", + "type": "string" + }, + "updated_at": { + "description": "更新时间", + "type": "string" + }, + "user_id": { + "description": "用户ID(user_members.id)", + "type": "integer" + } + } + }, + "model.UserPointsLedger": { + "type": "object", + "properties": { + "action": { + "description": "变更动作:signin/order_deduct/refund_restore/manual", + "type": "string" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "points": { + "description": "积分变动值(正增负减)", + "type": "integer" + }, + "ref_id": { + "description": "关联ID(如订单号/记录ID)", + "type": "string" + }, + "ref_table": { + "description": "关联表名(如orders/payment_refund)", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "user_id": { + "description": "用户ID(user_members.id)", + "type": "integer" + } + } + }, + "pay.notifyAck": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "snapshot.CouponInfo": { + "type": "object", + "properties": { + "balance_amount": { + "type": "integer" + }, + "coupon_id": { + "type": "integer" + }, + "coupon_name": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "user_coupon_id": { + "type": "integer" + }, + "valid_end": { + "type": "string" + } + } + }, + "snapshot.ItemCardInfo": { + "type": "object", + "properties": { + "card_id": { + "type": "integer" + }, + "card_name": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "user_item_card_id": { + "type": "integer" + }, + "valid_end": { + "type": "string" + } + } + }, + "snapshot.PointsInfo": { + "type": "object", + "properties": { + "balance": { + "type": "integer" + }, + "version": { + "type": "integer" + } + } + }, + "snapshot.SnapshotDiff": { + "type": "object", + "properties": { + "coupons_used": { + "type": "array", + "items": { + "$ref": "#/definitions/snapshot.CouponInfo" + } + }, + "inventory_added": { + "type": "integer" + }, + "item_cards_used": { + "type": "array", + "items": { + "$ref": "#/definitions/snapshot.ItemCardInfo" + } + }, + "points_changed": { + "type": "integer" + } + } + }, + "snapshot.UserInfo": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "mobile": { + "type": "string" + }, + "nickname": { + "type": "string" + } + } + }, + "snapshot.UserStateSnapshot": { + "type": "object", + "properties": { + "coupons": { + "type": "array", + "items": { + "$ref": "#/definitions/snapshot.CouponInfo" + } + }, + "inventory_count": { + "type": "integer" + }, + "item_cards": { + "type": "array", + "items": { + "$ref": "#/definitions/snapshot.ItemCardInfo" + } + }, + "points": { + "$ref": "#/definitions/snapshot.PointsInfo" + }, + "snapshot_time": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/snapshot.UserInfo" + } + } + }, + "taskcenter.claimTaskRequest": { + "type": "object", + "properties": { + "tier_id": { + "type": "integer" + } + } + }, + "taskcenter.createTaskRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "end_time": { + "type": "string" + }, + "name": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "visibility": { + "type": "integer" + } + } + }, + "taskcenter.listTasksResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/taskcenter.taskItem" + } + }, + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "taskcenter.modifyTaskRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "end_time": { + "type": "string" + }, + "name": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "visibility": { + "type": "integer" + } + } + }, + "taskcenter.simulateInviteSuccessRequest": { + "type": "object", + "properties": { + "invitee_id": { + "type": "integer" + }, + "inviter_id": { + "type": "integer" + } + } + }, + "taskcenter.simulateOrderPaidRequest": { + "type": "object", + "properties": { + "order_id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + } + } + }, + "taskcenter.taskItem": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "end_time": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "rewards": { + "type": "array", + "items": { + "$ref": "#/definitions/taskcenter.taskRewardItem" + } + }, + "start_time": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "tiers": { + "type": "array", + "items": { + "$ref": "#/definitions/taskcenter.taskTierItem" + } + } + } + }, + "taskcenter.taskProgressResponse": { + "type": "object", + "properties": { + "claimed_tiers": { + "type": "array", + "items": { + "type": "integer" + } + }, + "first_order": { + "type": "boolean" + }, + "invite_count": { + "type": "integer" + }, + "order_amount": { + "type": "integer" + }, + "order_count": { + "type": "integer" + }, + "task_id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + } + } + }, + "taskcenter.taskRewardItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "quantity": { + "type": "integer" + }, + "reward_name": { + "type": "string" + }, + "reward_payload": { + "type": "object", + "additionalProperties": {} + }, + "reward_type": { + "type": "string" + }, + "tier_id": { + "type": "integer" + } + } + }, + "taskcenter.taskTierItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "metric": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "priority": { + "type": "integer" + }, + "repeatable": { + "type": "integer" + }, + "threshold": { + "type": "integer" + }, + "window": { + "type": "string" + } + } + }, + "taskcenter.upsertRewardsRequest": { + "type": "object", + "properties": { + "rewards": { + "type": "array", + "items": { + "type": "object", + "properties": { + "quantity": { + "type": "integer" + }, + "reward_payload": { + "type": "array", + "items": { + "type": "integer" + } + }, + "reward_type": { + "type": "string" + }, + "tier_id": { + "type": "integer" + } + } + } + } + } + }, + "taskcenter.upsertTiersRequest": { + "type": "object", + "properties": { + "tiers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "activity_id": { + "type": "integer" + }, + "extra_params": { + "type": "array", + "items": { + "type": "integer" + } + }, + "metric": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "priority": { + "type": "integer" + }, + "repeatable": { + "type": "integer" + }, + "threshold": { + "type": "integer" + }, + "window": { + "type": "string" + } + } + } + } + } + }, + "user.AggregatedInventory": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "has_shipment": { + "type": "boolean" + }, + "inventory_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "product_id": { + "type": "integer" + }, + "product_images": { + "type": "string" + }, + "product_name": { + "type": "string" + }, + "product_price": { + "type": "integer" + }, + "shipping_status": { + "type": "integer" + }, + "status": { + "description": "用于区分 1持有 3已处理", + "type": "integer" + }, + "updated_at": { + "type": "string" + } + } + }, + "user.CouponSimpleInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "description": "1:满减 2:折扣", + "type": "integer" + }, + "user_coupon_id": { + "type": "integer" + }, + "value": { + "type": "integer" + } + } + }, + "user.DrawReceiptInfo": { + "type": "object", + "properties": { + "algo_version": { + "type": "string" + }, + "client_id": { + "type": "integer" + }, + "client_seed": { + "type": "string" + }, + "draw_id": { + "type": "integer" + }, + "draw_index": { + "type": "integer" + }, + "draw_log_id": { + "type": "integer" + }, + "items_root": { + "type": "string" + }, + "items_snapshot": { + "type": "string" + }, + "nonce": { + "type": "integer" + }, + "rand_proof": { + "type": "string" + }, + "reward_id": { + "type": "integer" + }, + "round_id": { + "type": "integer" + }, + "selected_index": { + "type": "integer" + }, + "server_seed_hash": { + "type": "string" + }, + "server_sub_seed": { + "type": "string" + }, + "signature": { + "type": "string" + }, + "timestamp": { + "type": "integer" + }, + "weights_total": { + "type": "integer" + } + } + }, + "user.InventoryWithProduct": { + "type": "object", + "properties": { + "activity_id": { + "description": "来源活动ID", + "type": "integer" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "has_shipment": { + "type": "boolean" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "order_id": { + "description": "来源订单ID", + "type": "integer" + }, + "product_id": { + "description": "资产对应商品ID(实物奖/商品)", + "type": "integer" + }, + "product_images": { + "type": "string" + }, + "product_name": { + "type": "string" + }, + "product_price": { + "description": "新增价格字段", + "type": "integer" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "reward_id": { + "description": "来源奖励ID(activity_reward_settings.id)", + "type": "integer" + }, + "shipping_no": { + "description": "发货单号", + "type": "string" + }, + "shipping_status": { + "type": "integer" + }, + "status": { + "description": "状态:1持有 2作废 3已使用/发货", + "type": "integer" + }, + "updated_at": { + "description": "更新时间", + "type": "string" + }, + "user_id": { + "description": "资产归属用户ID", + "type": "integer" + } + } + }, + "user.ItemCardSimpleInfo": { + "type": "object", + "properties": { + "effect_type": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "user_card_id": { + "type": "integer" + } + } + }, + "user.ItemCardWithTemplate": { + "type": "object", + "properties": { + "card_id": { + "description": "卡模板ID(system_item_cards.id)", + "type": "integer" + }, + "card_type": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "effect_type": { + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "scope_type": { + "type": "integer" + }, + "stacking_strategy": { + "type": "integer" + }, + "status": { + "description": "状态:1未使用 2已使用 3已过期", + "type": "integer" + }, + "updated_at": { + "description": "更新时间", + "type": "string" + }, + "used_activity_id": { + "description": "使用时活动ID", + "type": "integer" + }, + "used_activity_name": { + "type": "string" + }, + "used_at": { + "description": "使用时间", + "type": "string" + }, + "used_draw_log_id": { + "description": "使用关联抽奖日志ID(activity_draw_logs.id)", + "type": "integer" + }, + "used_issue_id": { + "description": "使用时期ID", + "type": "integer" + }, + "used_issue_number": { + "type": "string" + }, + "used_reward_name": { + "type": "string" + }, + "user_id": { + "description": "用户ID(users.id)", + "type": "integer" + }, + "valid_end": { + "description": "有效期结束", + "type": "string" + }, + "valid_start": { + "description": "有效期开始", + "type": "string" + } + } + }, + "user.OrderWithItems": { + "type": "object", + "properties": { + "activity_id": { + "type": "integer" + }, + "activity_name": { + "type": "string" + }, + "actual_amount": { + "description": "实际支付金额(分)", + "type": "integer" + }, + "cancelled_at": { + "description": "取消时间", + "type": "string" + }, + "category_id": { + "type": "integer" + }, + "category_name": { + "type": "string" + }, + "coupon_id": { + "description": "使用的优惠券ID", + "type": "integer" + }, + "coupon_info": { + "$ref": "#/definitions/user.CouponSimpleInfo" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "discount_amount": { + "description": "优惠券抵扣金额(分)", + "type": "integer" + }, + "draw_receipts": { + "type": "array", + "items": { + "$ref": "#/definitions/user.DrawReceiptInfo" + } + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "is_consumed": { + "description": "是否已履约/消耗(对虚拟资产)", + "type": "integer" + }, + "is_draw": { + "type": "boolean" + }, + "is_winner": { + "type": "boolean" + }, + "issue_number": { + "type": "string" + }, + "item_card_id": { + "description": "使用的道具卡ID", + "type": "integer" + }, + "item_card_info": { + "$ref": "#/definitions/user.ItemCardSimpleInfo" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/model.OrderItems" + } + }, + "order_no": { + "description": "业务订单号(唯一)", + "type": "string" + }, + "paid_at": { + "description": "支付完成时间", + "type": "string" + }, + "pay_preorder_id": { + "description": "关联预支付单ID(payment_preorder.id)", + "type": "integer" + }, + "play_type": { + "type": "string" + }, + "points_amount": { + "description": "积分抵扣金额(分)", + "type": "integer" + }, + "points_ledger_id": { + "description": "积分扣减流水ID(user_points_ledger.id)", + "type": "integer" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "reward_level": { + "type": "integer" + }, + "source_type": { + "description": "来源:1商城直购 2抽奖票据 3其他", + "type": "integer" + }, + "status": { + "description": "订单状态:1待支付 2已支付 3已取消 4已退款", + "type": "integer" + }, + "total_amount": { + "description": "订单总金额(分)", + "type": "integer" + }, + "updated_at": { + "description": "更新时间", + "type": "string" + }, + "user_address_id": { + "description": "收货地址ID(user_addresses.id)", + "type": "integer" + }, + "user_id": { + "description": "下单用户ID(user_members.id)", + "type": "integer" + } + } + }, + "user.ProductInfo": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "image": { + "type": "string" + }, + "name": { + "type": "string" + }, + "price": { + "type": "integer" + } + } + }, + "user.ShipmentGroup": { + "type": "object", + "properties": { + "batch_no": { + "type": "string" + }, + "count": { + "type": "integer" + }, + "express_code": { + "type": "string" + }, + "express_no": { + "type": "string" + }, + "inventory_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "product_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "products": { + "type": "array", + "items": { + "$ref": "#/definitions/user.ProductInfo" + } + }, + "received_at": { + "type": "string" + }, + "shipped_at": { + "type": "string" + }, + "status": { + "type": "integer" + } + } + }, + "admin.activityPaymentDetails": { + "type": "object", + "properties": { + "coupon_used": { + "type": "boolean", + "description": "是否使用优惠券" + }, + "coupon_name": { + "type": "string", + "description": "优惠券名称" + }, + "coupon_discount": { + "type": "integer", + "description": "优惠券抵扣金额(分)" + }, + "item_card_used": { + "type": "boolean", + "description": "是否使用道具卡" + }, + "item_card_name": { + "type": "string", + "description": "道具卡名称" + }, + "game_pass_used": { + "type": "boolean", + "description": "是否使用次数卡" + }, + "game_pass_info": { + "type": "string", + "description": "次数卡使用信息" + }, + "points_used": { + "type": "boolean", + "description": "是否使用积分" + }, + "points_discount": { + "type": "integer", + "description": "积分抵扣金额(分)" + } + } + }, + "admin.activityLogItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "product_id": { + "type": "integer" + }, + "product_name": { + "type": "string" + }, + "product_image": { + "type": "string" + }, + "product_price": { + "type": "integer", + "description": "商品价格(分)" + }, + "product_quantity": { + "type": "integer", + "description": "中奖数量" + }, + "order_amount": { + "type": "integer", + "description": "分摊订单金额(分)" + }, + "order_no": { + "type": "string", + "description": "订单号" + }, + "discount_amount": { + "type": "integer", + "description": "分摊优惠金额(分)" + }, + "pay_type": { + "type": "string", + "description": "支付方式" + }, + "used_card": { + "type": "string", + "description": "使用的卡券信息" + }, + "order_status": { + "type": "integer", + "description": "订单状态" + }, + "profit": { + "type": "integer", + "description": "单次抽奖盈亏(分)" + }, + "created_at": { + "type": "string" + }, + "payment_details": { + "$ref": "#/definitions/admin.activityPaymentDetails" + } + } + }, + "admin.activityLogsResponse": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "page_size": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/admin.activityLogItem" + } + } + } + } + }, + "securityDefinitions": { + "LoginVerifyToken": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + } } \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml index e758f58..8fbac8b 100755 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -103,6 +103,97 @@ definitions: success: type: boolean type: object + admin.activityPaymentDetails: + properties: + coupon_discount: + description: 优惠券抵扣金额(分) + type: integer + coupon_name: + description: 优惠券名称 + type: string + coupon_used: + description: 是否使用优惠券 + type: boolean + game_pass_info: + description: 次数卡使用信息 + type: string + game_pass_used: + description: 是否使用次数卡 + type: boolean + item_card_name: + description: 道具卡名称 + type: string + item_card_used: + description: 是否使用道具卡 + type: boolean + points_discount: + description: 积分抵扣金额(分) + type: integer + points_used: + description: 是否使用积分 + type: boolean + type: object + admin.activityLogItem: + properties: + avatar: + type: string + created_at: + type: string + discount_amount: + description: 分摊优惠金额(分) + type: integer + id: + type: integer + nickname: + type: string + order_amount: + description: 分摊订单金额(分) + type: integer + order_no: + description: 订单号 + type: string + order_status: + description: 订单状态 + type: integer + pay_type: + description: 支付方式 + type: string + payment_details: + $ref: '#/definitions/admin.activityPaymentDetails' + product_id: + type: integer + product_image: + type: string + product_name: + type: string + product_price: + description: 商品价格(分) + type: integer + product_quantity: + description: 中奖数量 + type: integer + profit: + description: 单次抽奖盈亏(分) + type: integer + used_card: + description: 使用的卡券信息 + type: string + user_id: + type: integer + type: object + admin.activityLogsResponse: + properties: + list: + items: + $ref: '#/definitions/admin.activityLogItem' + type: array + page: + type: integer + page_size: + type: integer + total: + type: integer + type: object admin.ShippingOrderGroup: properties: address_id: @@ -3782,6 +3873,69 @@ info: title: mini-chat 接口文档 version: v0.0.1 paths: + /admin/dashboard/activity-profit-loss/{activity_id}/logs: + get: + consumes: + - application/json + description: 查看活动的抽奖记录,支持按玩家/奖品关键词搜索 + parameters: + - description: 活动ID + in: path + name: activity_id + required: true + type: integer + - default: 1 + description: 页码 + in: query + name: page + required: true + type: integer + - default: 20 + description: 每页数量,最多100 + in: query + name: page_size + required: true + type: integer + - description: 用户ID过滤 + in: query + name: user_id + type: integer + - description: 玩家关键词:昵称/手机号/邀请码/ID + in: query + name: player_keyword + type: string + - description: 奖品关键词:名称或ID + in: query + name: prize_keyword + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/admin.activityLogsResponse' + "400": + description: 参数错误 + schema: + $ref: '#/definitions/code.Failure' + "401": + description: 未授权 + schema: + $ref: '#/definitions/code.Failure' + "403": + description: 无权限 + schema: + $ref: '#/definitions/code.Failure' + "500": + description: 服务器内部错误 + schema: + $ref: '#/definitions/code.Failure' + security: + - LoginVerifyToken: [] + summary: 活动抽奖记录 + tags: + - 管理端.运营分析 /admin/task_center/simulate/invite_success: post: consumes: diff --git a/docs/任务中心领取风险审查与测试计划.md b/docs/任务中心领取风险审查与测试计划.md new file mode 100644 index 0000000..d49a5dc --- /dev/null +++ b/docs/任务中心领取风险审查与测试计划.md @@ -0,0 +1,62 @@ +# 任务中心领取逻辑风险审查与测试计划 + +## 背景与目标 +- **风险点**:用户可直接领取、或依赖任务上线前的历史数据领取新的任务奖励,尤其是在 `window` 未配置或默认 `lifetime` 的档位上。 +- **目标**:明确代码审查要点、需要补强的校验以及自动化/手工测试,确保任务中心的进度统计与领取逻辑默认受限于任务 `StartTime ~ EndTime`。 + +## 现状速览 +- **窗口处理**:`normalizeWindow` + `computeTimeWindow` 对非法窗口统一回退 `lifetime`,`WindowActivityPeriod` 才会套用任务起止时间(`internal/service/task_center/service.go:200-525`)。未配置或设置 `lifetime` 的档位默认统计全部历史。 +- **进度统计**:`GetUserProgress` 按 `(window, activity_id)` 分组统计 `TierProgressMap`,并回退到全局订单/邀请(`service.go:528-668`)。 +- **领取校验**:`ClaimTier` 先读取 `TierProgressMap`,再按 metric/operator 判断;含活动的档位使用 Redis `tc:claim_lock:{user_id}:{activity_id}` 加锁,并做跨任务阈值校验(`service.go:670-939`)。全局档位没有锁,任务级限额只在总量层面控制。 + +## 审查与增强要点 +### 1. 窗口与时间范围 +1. 将“任务设置了 `StartTime`/`EndTime` 但 window=空或 `lifetime`”纳入巡检:建议在 `normalizeWindow` or `GetUserProgress` 中,当 `task.StartTime` 不为空时自动将窗口裁剪到 `[StartTime, EndTime]`,并在单测覆盖空/NULL 窗口场景。 +2. 明确 `since_registration` 行为:若不允许历史数据,应在 `computeTimeWindow` 中将起点设为 `max(user.RegistrationTime, task.StartTime)`。 +3. 验证 `TierProgressMap`、`SubProgress` 是否正确过滤 `start_time`/`end_time`:针对 `daily/weekly/activity_period/lifetime` 构造订单在边界日/周的案例,确保窗口重置与任务期重叠判断符合预期。 + +### 2. 领取校验扩展 +1. 在 `ClaimTier` 中新增“窗口开始 < task.StartTime”判断:若 `tierProgress` 返回数据完全来自任务上线前,需拒绝并提示“任务尚未开始”或“需重新累计”。 +2. 复核跨任务阈值 `calculateCrossTaskConsumedThreshold`:目前按任务创建时间 + 窗口重叠过滤,但若 `siblingRows` 包含旧任务的 `lifetime` 档位仍可能消耗全部历史,需要配合第 1 点的窗口裁剪。 +3. Redis 锁范围:对于 `activity_id=0` 的档位,可增加 `tc:claim_lock_task:{user_id}:{task_id}`,防止并发重复领取。 + +### 3. 配置与数据守护 +1. **巡检 SQL**(示例): + ```sql + SELECT tiers.id, tiers.task_id, tiers.window, tasks.start_time, tasks.end_time + FROM task_center_task_tiers tiers + JOIN task_center_tasks tasks ON tasks.id = tiers.task_id + WHERE (tiers.window IS NULL OR tiers.window = '' OR tiers.window = 'lifetime') + AND tasks.start_time IS NOT NULL; + ``` + 对结果逐条评估是否需改成 `activity_period` 或自定义窗口。 +2. 若需让运营显式配置“允许历史数据”,可在 `task_center_task_tiers` 增加 `allow_legacy_data TINYINT`,并在 `admin` Upsert 接口透出。当前阶段以代码默认裁剪为主。 + +## 自动化测试计划 +| 编号 | 场景 | 步骤 | 预期 | +| --- | --- | --- | --- | +| UT-1 | `lifetime` + StartTime 剪裁 | 任务 StartTime=T0,插入 T0-1/T0+1 订单,调用 `GetUserProgress` | 仅统计 T0+1 数据;`TierProgressMap` 中的数量=1 | +| UT-2 | 空 Window | 档位 `window=''`,任务 StartTime=T0,同上 | 行为等同 UT-1 | +| UT-3 | `since_registration` | 构造用户注册时间 Treg < T0,验证窗口起点为 `max(Treg, T0)` | 统计以 `T0` 为准 | +| IT-1 | 历史数据领取阻断 | 先插入历史订单,使 `TierProgressMap` 达标;上线任务后 `ClaimTier` | 返回“任务条件未达成” | +| IT-2 | 新订单后可领 | 在 IT-1 基础上插入新订单超过阈值再 `ClaimTier` | 领取成功 | +| IT-3 | 跨任务占用 | 旧任务(已领 50 单) + 新任务阈值 60 单,新订单 15 单 | `ClaimTier` 拒绝,日志输出 `cross-task threshold`;再补 10 单 → 成功 | +| IT-4 | Redis 锁 | 并发触发 `ClaimTier`;activityID>0 与 activityID=0 场景分别验证 | 仅一次成功,其余提示“操作频繁”或“已领取” | + +> 自动化测试可基于现有 SQLite Repo(`mysql.NewSQLiteRepoForTest`)快速构造数据,参考 `service_test.go`、`invite_logic_test.go` 的写法。 + +## 手工/灰度验证 +1. **SQL 巡检**:执行上文 SQL,导出需要修正的档位,配合运营确认并批量更新 `window`。 +2. **模拟接口回放**:通过 `/admin/task_center/simulate/order_paid`、`/simulate/invite_success` 重放旧流水,再调整任务时间并调用 `/tasks/{id}/claim/{user}`,观察日志(`ClaimTier: cross-task threshold...`、`任务尚未开始` 等)。 +3. **小程序体验**:发布新任务后,用老用户登录 `pages-user/tasks`,确认显示进度清零、领取按钮禁用;完成新订单后刷新 → 按预期解锁。 + +## 风险与假设 +- 默认业务需求为“任务上线前的历史数据不可复用”,如需白名单例外需另开配置。 +- Redis/数据库资源允许新增少量锁与巡检脚本,不影响现有性能。 +- 若需要对现网数据批量改 `window`,需评估是否会影响已经配置为 `lifetime` 的任务,并提前同步运营。 + +## 下一步 +1. 根据本计划完成代码 PoC(窗口剪裁、领取校验、锁扩展)。 +2. 提交自动化测试用例,覆盖表格中的 UT/IT 场景。 +3. 运行 SQL 巡检 + 手工验证,记录整改项。 +4. 如需引入“允许历史数据”配置,评估 schema 与前端/运营端改造影响,再单独立项。 diff --git a/docs/活动大厅任务中心规则梳理.md b/docs/活动大厅任务中心规则梳理.md new file mode 100644 index 0000000..b796464 --- /dev/null +++ b/docs/活动大厅任务中心规则梳理.md @@ -0,0 +1,64 @@ +# 活动大厅(任务中心)规则与计算逻辑梳理 + +## 1. 后端数据结构与配置来源 + +- **任务、档位、奖励主表**:`Task`、`TaskTier`、`TaskReward`、`UserTaskProgress` 与 `TaskEventLog` 分别落在 `task_center_tasks`、`task_center_task_tiers`、`task_center_task_rewards`、`task_center_user_progress`、`task_center_event_logs` 表中,字段包含任务级/档位级限额、活动绑定、扩展参数 JSON 以及幂等键等核心信息(`bindbox_game/internal/repository/mysql/task_center/models.go:10-95`)。 +- **限额与扩展字段迁移**: + - `migrations/task_level_quota.sql:1-12` 在 2026-02-16 引入任务级 `quota`/`claimed_count`,同时移除旧的档位限额。 + - `migrations/20260206_add_task_tier_quota.sql:1-6` 再次为档位恢复独立限额字段,用于任务总限量之外的档位限量。 + - `migrations/20251223_add_user_invites_effective_columns.sql:1-4` 添加 `extra_params`、`effective_invite_count` 以及邀请有效性相关列,为后续“新用户限制”等规则提供数据面支撑。 +- **管理端 CRUD & 配置 API**:`internal/api/task_center/admin.go` 提供任务创建、修改、删除、档位/奖励配置、模拟事件与奖励发放统计接口(`admin.go:14-486`)。所有接口最终落到 `task_center/service.go` 的 `CreateTask`、`UpsertTaskTiers`、`UpsertTaskRewards` 等方法(`service.go:953-1162`),确保配置变更会触发缓存失效。 + +## 2. 运行期进度计算流程 + +- **时间窗口规范化**:`normalizeWindow` / `normalizeWindowStrict` 将非法或空窗口统一视为 `lifetime`(`service.go:200-217`),`computeTimeWindow` 根据 `daily`/`weekly`/`monthly`/`activity_period` 返回具体起止时间,缺省为不限(`service.go:500-525`)。 +- **订单指标采集**:`fetchOrderMetricRows` 联结订单、期次、活动表,并按活动聚合抽赏次数/票价或订单金额(`service.go:223-247`);`calculateEffectiveAmount` / `aggregateOrderMetrics` 负责将抽赏次数 × 票价或订单实付换算成有效金额,支持去重订单总量与活动内统计(`service.go:249-281`)。 +- **邀请指标采集**:`countInvites`、`countInvitesForActivities` 分别处理单一活动窗口和多活动聚合,只有邀请人邀请的用户在目标活动内完成已支付订单后才计入特定活动任务(`service.go:283-346`)。 +- **任务列表出参**:`ListTasks` 默认过滤启用且可见的任务(App 端)并预加载档位/奖励,同时根据 `task_center_task_rewards` 关联优惠券、道具卡、称号名称(`service.go:348-498`)。 +- **按窗口分组统计进度**:`GetUserProgress` 会先查询任务与其所有档位,根据 `(window, activity_id)` 组合拉取订单/邀请数据,产出 `TierProgressMap`(每个档位独立窗口内订单/金额/邀请)与 `SubProgress`(按活动粒度的订单汇总),同时聚合全局订单/邀请指标以及已领取档位列表(`service.go:528-668`)。 + +## 3. 达成校验与领取路径 + +- **前置校验**:`ClaimTier` 首先调用 `GetUserProgress` 获取窗口化进度,并加载目标档位/任务最新配置(`service.go:670-686`)。 +- **Redis 限流**:对于绑定 `ActivityID` 的档位,会抢占 `tc:claim_lock:{user_id}:{activity_id}` 避免并发重复领(`service.go:688-700`)。 +- **指标达成判定**:优先读取 `TierProgressMap` 中窗口内数值,其次使用 `SubProgress` → 全局进度回退;支持 `>=`/`=` 操作符,对 `first_order` 直接使用布尔值(`service.go:702-752`)。 +- **跨任务资源占用校验**:`calculateCrossTaskConsumedThreshold` 会收集同活动+同指标的其他任务已领取档位,按任务窗口是否重叠、创建时间先后过滤后累积最大门槛值,若 `currentValue < consumed + 自身阈值` 则拒绝领取(`service.go:754-939`)。 +- **限额 & 状态更新**:领取前更新任务级别 `claimed_count`,若已达 `quota` 返回“奖励已领完”(`service.go:788-799`);奖励发放成功后,事务性地在 `task_center_user_progress` 中追加 `tier_id`,幂等写入 `claimed_tiers` JSON(`service.go:801-851`)。 + +## 4. 奖励发放与事件机制 + +- **奖励发放器**:`grantTierRewards` 会根据 `task_id + tier_id` 查询奖励列表、构造 `idempotency_key` 并写入 `task_center_event_logs`,支持积分、优惠券、道具卡、称号、游戏票、实物商品等类型,并对 `quantity` 与 payload 内数量做“优先取 r.Quantity”策略修复(`service.go:1400-1558`)。 +- **异步事件**: + - `OnOrderPaid` / `OnInviteSuccess` 先尝试投递到 Redis 队列,否则直接同步处理;`processOrderPaid` 只在订单状态为已支付时并发写入邀请人累计金额,同时加 Redis 幂等锁防止 24 小时内重复处理(`service.go:1165-1243`)。 + - `StartWorker` 在 Redis 队列可用时启动 5 个 goroutine 消费 `order_paid` 与 `invite_success` 事件,最终调用 `processOrderPaid` / `processInviteSuccess`(`worker.go:12-80`)。 +- **触发入口(上游链路)**: + - 微信支付回调完成后,后台会异步执行 `_ = h.task.OnOrderPaid(...)`,确保真实支付订单刷新任务进度(`internal/api/pay/wechat_notify.go:294-305`)。 + - 0 元抽奖订单、虚拟玩法等也会在服务器端模拟支付后触发 `OnOrderPaid`(`internal/api/activity/lottery_app.go:458-464`、`internal/api/activity/matching_game_app.go:203-206`)。 + - 新用户带邀请码登录成功后,若存在邀请人则调用 `OnInviteSuccess` 记入邀请进度(`internal/api/user/login_app.go:78-83`)。 + - 管理端提供 `/admin/task_center/simulate/order_paid` 与 `/simulate/invite_success` 便于调试触发(`internal/api/task_center/admin.go:315-369`)。 + +## 5. 小程序端消费链路 + +- **API 封装**:`getTasks` / `getTaskProgress` / `claimTaskReward` 直接映射到 App 端任务中心列表、进度、领取接口(`bindbox-mini/api/appUser.js:262-271`)。 +- **入口触达**:个人中心“常用功能”列表包含「任务中心」入口,点击跳转至 `pages-user/tasks/index.vue` 页面(`bindbox-mini/pages/mine/index.vue:140-184`)。 +- **UI 与状态处理**: + - 页面顶部展示订单数、邀请数、首单状态等汇总统计,同时支持空态、骨架加载(`pages-user/tasks/index.vue:1-56`)。 + - 任务卡片内根据 `task.quota`/`claimed_count`、`tier.remaining`、`userProgress.claimedTiers` 和 `tier_activity_id` 决定显示“已领完”“可领取”“进行中”等状态(`pages-user/tasks/index.vue:57-150`、`220-379`)。 + - `taskProgress` 为每个任务缓存独立进度,`normalizeSubProgress` + `getSubProgress*` 系列方法根据 `sub_progress`(活动维度进度)渲染子进度条,确保与后端 `TierProgressMap` 字段语义一致(`pages-user/tasks/index.vue:222-479`、`590-666`)。 + - `fetchData` 并行拉取任务与进度,首个任务默认展开,领取成功后本地更新 `claimedTiers` 并 toast 提示(`pages-user/tasks/index.vue:515-589`、`481-505`)。 +- **交互约束**:未登录/未缓存用户信息会弹出“请先登录”提示并跳转登录页,确保任务接口只在持有 token 的情况下访问(`pages-user/tasks/index.vue:187-209`)。 + +## 6. 测试覆盖与验证建议 + +- **单元/集成测试**: + - `TestListTasks_FilterByStatusAndVisibility` 验证 App 列表只返回启用且可见的任务(`internal/service/task_center/list_tasks_filter_test.go:11-95`)。 + - `service_test.go` 中的场景覆盖活动有效期窗口统计与跨任务占用判断,确保 `TierProgressMap` 与 `calculateCrossTaskConsumedThreshold` 行为正确(`internal/service/task_center/service_test.go:350-514`)。 + - `TestInviteLogicSymmetry` 通过 SQLite 集成测试验证全局/特定活动邀请数统计与订单联动逻辑(`internal/service/task_center/invite_logic_test.go:10-80`)。 +- **建议的手工校验**: + 1. 使用管理端创建带活动绑定与不同窗口的任务→调用 `/api/app/task-center/tasks` 与 `/progress/{user}` 核对 `sub_progress`、`tier_progress_map` 是否如预期。 + 2. 在沙箱环境支付一笔订单或通过模拟接口触发 `OnOrderPaid`,确认 Redis 幂等锁与任务限额的日志输出,并在 `task_center_event_logs` 中观察发放记录。 + 3. 在小程序端登陆真实账号,完成任务条件后点击“领取”,应同步看到 `task.quota` / `tier.remaining` 与“已领取”状态更新,且后台奖励统计接口 `/admin/task_center/tasks/{id}/reward-stats` 的计数随之增加。 + +--- +- **假设与范围**:本文将“活动大厅”视为任务中心在小程序端的 UI 展示,不涉及其他独立模块;仅梳理现有逻辑,不包含代码改动。 +- **交付复核**:若需要进一步变更规则,可从本文档列出的结构/流程入手定位受影响的函数与 API。 diff --git a/go.mod b/go.mod index d826e7f..b5bf38a 100755 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/go-playground/universal-translator v0.18.1 github.com/go-playground/validator/v10 v10.15.0 github.com/go-resty/resty/v2 v2.10.0 - github.com/go-sql-driver/mysql v1.7.0 + github.com/go-sql-driver/mysql v1.7.1 github.com/golang-jwt/jwt/v5 v5.2.0 github.com/issue9/identicon/v2 v2.1.2 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 01999e0..1a9e825 100755 --- a/go.sum +++ b/go.sum @@ -203,6 +203,8 @@ github.com/go-resty/resty/v2 v2.10.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5 github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= diff --git a/internal/api/admin/dashboard_activity.go b/internal/api/admin/dashboard_activity.go index 847f694..98723ec 100755 --- a/internal/api/admin/dashboard_activity.go +++ b/internal/api/admin/dashboard_activity.go @@ -13,6 +13,8 @@ import ( "strconv" "strings" "time" + + "gorm.io/gorm" ) type activityProfitLossRequest struct { @@ -344,9 +346,11 @@ func (h *handler) DashboardActivityProfitLoss() core.HandlerFunc { } type activityLogsRequest struct { - Page int `form:"page"` - PageSize int `form:"page_size"` - UserID int64 `form:"user_id"` + Page int `form:"page"` + PageSize int `form:"page_size"` + UserID int64 `form:"user_id"` + PlayerKeyword string `form:"player_keyword"` + PrizeKeyword string `form:"prize_keyword"` } type activityLogItem struct { @@ -411,15 +415,19 @@ func (h *handler) DashboardActivityLogs() core.HandlerFunc { req.PageSize = 20 } + req.PlayerKeyword = strings.TrimSpace(req.PlayerKeyword) + req.PrizeKeyword = strings.TrimSpace(req.PrizeKeyword) + db := h.repo.GetDbR().WithContext(ctx.RequestContext()) var total int64 countQuery := db.Table(model.TableNameActivityDrawLogs). Joins("JOIN activity_issues ON activity_issues.id = activity_draw_logs.issue_id"). + Joins("LEFT JOIN users ON users.id = activity_draw_logs.user_id"). + Joins("LEFT JOIN activity_reward_settings ON activity_reward_settings.id = activity_draw_logs.reward_id"). + Joins("LEFT JOIN products ON products.id = activity_reward_settings.product_id"). Where("activity_issues.activity_id = ?", activityID) - if req.UserID > 0 { - countQuery = countQuery.Where("activity_draw_logs.user_id = ?", req.UserID) - } + countQuery = applyActivityLogFilters(countQuery, req) countQuery.Count(&total) var logs []struct { @@ -490,9 +498,7 @@ func (h *handler) DashboardActivityLogs() core.HandlerFunc { Joins("LEFT JOIN system_item_cards ON system_item_cards.id = user_item_cards.card_id"). Joins("LEFT JOIN (SELECT order_id, COUNT(*) as draw_count FROM activity_draw_logs GROUP BY order_id) as order_draw_counts ON order_draw_counts.order_id = activity_draw_logs.order_id"). Where("activity_issues.activity_id = ?", activityID) - if req.UserID > 0 { - logsQuery = logsQuery.Where("activity_draw_logs.user_id = ?", req.UserID) - } + logsQuery = applyActivityLogFilters(logsQuery, req) err := logsQuery. Order("activity_draw_logs.id DESC"). Offset((req.Page - 1) * req.PageSize). @@ -665,6 +671,39 @@ func (h *handler) DashboardActivityLogs() core.HandlerFunc { } } +func applyActivityLogFilters(q *gorm.DB, req *activityLogsRequest) *gorm.DB { + if req == nil { + return q + } + if req.UserID > 0 { + q = q.Where("activity_draw_logs.user_id = ?", req.UserID) + } + if kw := req.PlayerKeyword; kw != "" { + like := "%" + kw + "%" + var args []interface{} + condition := "(users.nickname LIKE ? OR users.mobile LIKE ? OR users.invite_code LIKE ?" + args = append(args, like, like, like) + if playerID, err := strconv.ParseInt(kw, 10, 64); err == nil { + condition += " OR users.id = ?" + args = append(args, playerID) + } + condition += ")" + q = q.Where(condition, args...) + } + if kw := req.PrizeKeyword; kw != "" { + like := "%" + kw + "%" + args := []interface{}{like} + condition := "(products.name LIKE ?" + if prizeID, err := strconv.ParseInt(kw, 10, 64); err == nil { + condition += " OR products.id = ?" + args = append(args, prizeID) + } + condition += ")" + q = q.Where(condition, args...) + } + return q +} + type ensureActivityProfitLossMenuResponse struct { Ensured bool `json:"ensured"` Parent int64 `json:"parent_id"` diff --git a/internal/service/douyin/order_sync.go b/internal/service/douyin/order_sync.go index 910e8ec..444848a 100755 --- a/internal/service/douyin/order_sync.go +++ b/internal/service/douyin/order_sync.go @@ -89,7 +89,7 @@ const ( func normalizeFetchOptions(opts *FetchOptions) *FetchOptions { n := FetchOptions{ - OnlyUnmatched: true, + OnlyUnmatched: false, MaxUsers: defaultFetchMaxUsers, BatchSize: defaultFetchBatchSize, Concurrency: defaultFetchConcurrency, @@ -325,10 +325,11 @@ func (s *service) FetchAndSyncOrders(ctx context.Context, opts *FetchOptions) (* Where("douyin_user_id IS NOT NULL AND douyin_user_id != ''") if options.OnlyUnmatched { + const collateExpr = "utf8mb4_unicode_ci" subQuery := s.repo.GetDbR().WithContext(ctx). Model(&model.DouyinOrders{}). Select("1"). - Where("douyin_orders.douyin_user_id = users.douyin_user_id"). + Where(fmt.Sprintf("douyin_orders.douyin_user_id COLLATE %s = users.douyin_user_id COLLATE %s", collateExpr, collateExpr)). Where("(douyin_orders.local_user_id IS NULL OR douyin_orders.local_user_id = '' OR douyin_orders.local_user_id = '0')") userQuery = userQuery.Where("EXISTS (?)", subQuery) } diff --git a/internal/service/task_center/service.go b/internal/service/task_center/service.go index bc1d0a9..44e648e 100755 --- a/internal/service/task_center/service.go +++ b/internal/service/task_center/service.go @@ -499,12 +499,13 @@ func (s *service) ListTasks(ctx context.Context, in ListTasksInput) (items []Tas // computeTimeWindow 根据 window 配置计算时间范围 // 返回 (windowStart, windowEnd),nil 表示该端不限制 +// 重要:所有窗口类型都受任务时间约束,防止历史数据被用于领取新任务 func computeTimeWindow(window string, taskStart, taskEnd *time.Time) (start *time.Time, end *time.Time) { now := time.Now() switch window { case WindowDaily: s := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()) - return &s, &now + return applyTaskBounds(&s, &now, taskStart, taskEnd) case WindowWeekly: weekday := int(now.Weekday()) if weekday == 0 { @@ -512,19 +513,38 @@ func computeTimeWindow(window string, taskStart, taskEnd *time.Time) (start *tim } s := now.AddDate(0, 0, -(weekday - 1)) s = time.Date(s.Year(), s.Month(), s.Day(), 0, 0, 0, 0, s.Location()) - return &s, &now + return applyTaskBounds(&s, &now, taskStart, taskEnd) case WindowMonthly: s := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, now.Location()) - return &s, &now + return applyTaskBounds(&s, &now, taskStart, taskEnd) case WindowActivityPeriod: // 使用任务级别的 StartTime / EndTime,nil 端不加限制 return taskStart, taskEnd default: - // lifetime / since_registration / 未知值 → 不限制 - return nil, nil + // lifetime / since_registration / 空值 / 未知值 + // CRITICAL FIX: 受任务时间约束,防止历史数据领取新任务 + return taskStart, taskEnd } } +// applyTaskBounds 将窗口时间与任务时间取交集,确保不超过任务有效期 +func applyTaskBounds(windowStart, windowEnd, taskStart, taskEnd *time.Time) (*time.Time, *time.Time) { + start := windowStart + end := windowEnd + + // 如果任务开始时间晚于窗口开始时间,使用任务开始时间 + if taskStart != nil && (start == nil || taskStart.After(*start)) { + start = taskStart + } + + // 如果任务结束时间早于窗口结束时间,使用任务结束时间 + if taskEnd != nil && (end == nil || taskEnd.Before(*end)) { + end = taskEnd + } + + return start, end +} + func (s *service) GetUserProgress(ctx context.Context, userID int64, taskID int64) (*UserProgress, error) { db := s.repo.GetDbR() @@ -680,12 +700,28 @@ func (s *service) ClaimTier(ctx context.Context, userID int64, taskID int64, tie return err } - // BUG2 FIX: 多任务共享订单池问题 —— 获取 Redis 分布式锁,防止并发重复领取 - if tier.ActivityID > 0 && s.redis != nil { - claimLockKey := fmt.Sprintf("tc:claim_lock:%d:%d", userID, tier.ActivityID) + var task tcmodel.Task + if err := s.repo.GetDbR().First(&task, taskID).Error; err != nil { + return err + } + + // CRITICAL FIX: 为所有档位添加 Redis 分布式锁,防止并发重复领取 + // - activityID > 0: 使用 activity_id 作为锁键(同活动跨任务场景) + // - activityID = 0: 使用 task_id 作为锁键(全局档位场景) + if s.redis != nil { + var claimLockKey string + if tier.ActivityID > 0 { + claimLockKey = fmt.Sprintf("tc:claim_lock:%d:%d", userID, tier.ActivityID) + } else { + claimLockKey = fmt.Sprintf("tc:claim_lock_task:%d:%d", userID, taskID) + } locked, lockErr := s.redis.SetNX(ctx, claimLockKey, "1", 10*time.Second).Result() if lockErr != nil { - s.logger.Error("ClaimTier: Redis lock error", zap.Error(lockErr), zap.Int64("user_id", userID), zap.Int64("activity_id", tier.ActivityID)) + s.logger.Error("ClaimTier: Redis lock error", + zap.Error(lockErr), + zap.Int64("user_id", userID), + zap.Int64("activity_id", tier.ActivityID), + zap.Int64("task_id", taskID)) return lockErr } if !locked { @@ -719,6 +755,7 @@ func (s *service) ClaimTier(ctx context.Context, userID int64, taskID int64, tie currentInviteCount = progress.InviteCount } + var currentValue int64 switch tier.Metric { case MetricFirstOrder: hit = progress.FirstOrder @@ -728,99 +765,30 @@ func (s *service) ClaimTier(ctx context.Context, userID int64, taskID int64, tie } else { hit = currentOrderCount == tier.Threshold } + currentValue = currentOrderCount case MetricOrderAmount: if tier.Operator == OperatorGTE { hit = currentOrderAmount >= tier.Threshold } else { hit = currentOrderAmount == tier.Threshold } + currentValue = currentOrderAmount case MetricInviteCount: if tier.Operator == OperatorGTE { hit = currentInviteCount >= tier.Threshold } else { hit = currentInviteCount == tier.Threshold } + currentValue = currentInviteCount } // BUG2 FIX: 跨任务累加校验 —— 防止多任务共享同一 activityID 订单池,用户用同一批订单重复领多个任务奖励 // 规则:同一 activityID + 同一 metric 下,不同 taskID 间各取已领最大 threshold 后求和, // 要求 currentValue >= consumedThreshold(已消耗)+ tier.Threshold(本次需消耗) if tier.ActivityID > 0 && (tier.Metric == MetricOrderCount || tier.Metric == MetricOrderAmount || tier.Metric == MetricInviteCount) { - // 1. 查出同 activityID + 同 metric 下,属于其他 taskID 的所有 tier - var siblingTiers []tcmodel.TaskTier - if dbErr := s.repo.GetDbR(). - Where("activity_id = ? AND metric = ? AND task_id != ?", tier.ActivityID, tier.Metric, taskID). - Find(&siblingTiers).Error; dbErr != nil { - return dbErr - } - - // 2. 收集所有不同的 sibling taskID - siblingTaskIDs := make([]int64, 0, len(siblingTiers)) - siblingTaskSet := make(map[int64]struct{}) - for _, st := range siblingTiers { - if _, exists := siblingTaskSet[st.TaskID]; !exists { - siblingTaskSet[st.TaskID] = struct{}{} - siblingTaskIDs = append(siblingTaskIDs, st.TaskID) - } - } - - // 3. 计算已被其他 taskID 消耗的 threshold 总和 - // 同一 taskID 内按阶梯处理(取最大已领 threshold),不同 taskID 间求和 - var consumedThreshold int64 - if len(siblingTaskIDs) > 0 { - // 查用户在这些 sibling task 下的进度记录(含 claimed_tiers JSON) - var siblingProgresses []tcmodel.UserTaskProgress - if dbErr := s.repo.GetDbR(). - Where("user_id = ? AND task_id IN ? AND activity_id = 0", userID, siblingTaskIDs). - Find(&siblingProgresses).Error; dbErr != nil { - return dbErr - } - - // 按 taskID 整理已领取的 tierID 列表 - taskClaimedTierIDs := make(map[int64][]int64) // taskID -> []claimedTierID - for _, sp := range siblingProgresses { - var claimedIDs []int64 - if len(sp.ClaimedTiers) > 0 { - _ = json.Unmarshal([]byte(sp.ClaimedTiers), &claimedIDs) - } - if len(claimedIDs) > 0 { - taskClaimedTierIDs[sp.TaskID] = claimedIDs - } - } - - // 对每个 sibling taskID,查已领取 tier 中属于同 activityID+metric 的最大 threshold - for _, sibTaskID := range siblingTaskIDs { - claimedIDs, ok := taskClaimedTierIDs[sibTaskID] - if !ok || len(claimedIDs) == 0 { - continue - } - var claimedThresholds []int64 - if dbErr := s.repo.GetDbR().Model(&tcmodel.TaskTier{}). - Where("id IN ? AND task_id = ? AND activity_id = ? AND metric = ?", - claimedIDs, sibTaskID, tier.ActivityID, tier.Metric). - Pluck("threshold", &claimedThresholds).Error; dbErr != nil { - return dbErr - } - // 同一 taskID 下阶梯式:只计最大已领 threshold - var maxThreshold int64 - for _, th := range claimedThresholds { - if th > maxThreshold { - maxThreshold = th - } - } - consumedThreshold += maxThreshold - } - } - - // 4. 校验当前进度是否足以同时覆盖已消耗量和本次所需量 - var currentValue int64 - switch tier.Metric { - case MetricOrderCount: - currentValue = currentOrderCount - case MetricOrderAmount: - currentValue = currentOrderAmount - case MetricInviteCount: - currentValue = currentInviteCount + consumedThreshold, err := s.calculateCrossTaskConsumedThreshold(userID, &task, &tier) + if err != nil { + return err } if currentValue < consumedThreshold+tier.Threshold { s.logger.Warn("ClaimTier: cross-task threshold validation failed", @@ -839,12 +807,6 @@ func (s *service) ClaimTier(ctx context.Context, userID int64, taskID int64, tie return errors.New("任务条件未达成,无法领取") } - // 获取任务信息 - var task tcmodel.Task - if err := s.repo.GetDbR().First(&task, taskID).Error; err != nil { - return err - } - // 1.5 校验任务有效期 now := time.Now() if task.StartTime != nil && now.Before(*task.StartTime) { @@ -920,6 +882,105 @@ func (s *service) ClaimTier(ctx context.Context, userID int64, taskID int64, tie return nil } +type siblingTierRow struct { + TierID int64 `gorm:"column:tier_id"` + TaskID int64 `gorm:"column:task_id"` + Threshold int64 `gorm:"column:threshold"` + TaskStart *time.Time `gorm:"column:task_start"` + TaskEnd *time.Time `gorm:"column:task_end"` + TaskCreated time.Time `gorm:"column:task_created"` +} + +func tasksOverlapWindow(aStart, aEnd, bStart, bEnd *time.Time) bool { + if aStart != nil && bEnd != nil && (aStart.Equal(*bEnd) || aStart.After(*bEnd)) { + return false + } + if bStart != nil && aEnd != nil && (bStart.Equal(*aEnd) || bStart.After(*aEnd)) { + return false + } + return true +} + +func (s *service) calculateCrossTaskConsumedThreshold(userID int64, task *tcmodel.Task, tier *tcmodel.TaskTier) (int64, error) { + tierTable := tcmodel.TaskTier{}.TableName() + taskTable := tcmodel.Task{}.TableName() + + var siblingRows []siblingTierRow + if err := s.repo.GetDbR(). + Table(tierTable+" AS tiers"). + Select("tiers.id AS tier_id, tiers.task_id AS task_id, tiers.threshold, tasks.start_time AS task_start, tasks.end_time AS task_end, tasks.created_at AS task_created"). + Joins(fmt.Sprintf("JOIN %s AS tasks ON tasks.id = tiers.task_id", taskTable)). + Where("tiers.activity_id = ? AND tiers.metric = ? AND tiers.task_id <> ?", tier.ActivityID, tier.Metric, task.ID). + Find(&siblingRows).Error; err != nil { + return 0, err + } + + tierThreshold := make(map[int64]int64) + siblingTaskSet := make(map[int64]struct{}) + taskStart := chooseTaskStart(task.StartTime, task.CreatedAt) + for _, row := range siblingRows { + if row.TaskCreated.Before(task.CreatedAt) { + continue + } + if !tasksOverlapWindow(taskStart, task.EndTime, chooseTaskStart(row.TaskStart, row.TaskCreated), row.TaskEnd) { + continue + } + tierThreshold[row.TierID] = row.Threshold + siblingTaskSet[row.TaskID] = struct{}{} + } + if len(siblingTaskSet) == 0 { + return 0, nil + } + + taskIDs := make([]int64, 0, len(siblingTaskSet)) + for id := range siblingTaskSet { + taskIDs = append(taskIDs, id) + } + + var siblingProgresses []tcmodel.UserTaskProgress + if err := s.repo.GetDbR(). + Where("user_id = ? AND task_id IN ? AND activity_id = 0", userID, taskIDs). + Find(&siblingProgresses).Error; err != nil { + return 0, err + } + + perTaskMax := make(map[int64]int64) + for _, sp := range siblingProgresses { + var claimedIDs []int64 + if len(sp.ClaimedTiers) > 0 { + _ = json.Unmarshal([]byte(sp.ClaimedTiers), &claimedIDs) + } + var maxThreshold int64 + for _, id := range claimedIDs { + if th, ok := tierThreshold[id]; ok && th > maxThreshold { + maxThreshold = th + } + } + if maxThreshold > 0 { + if prev, ok := perTaskMax[sp.TaskID]; !ok || maxThreshold > prev { + perTaskMax[sp.TaskID] = maxThreshold + } + } + } + + var consumed int64 + for _, val := range perTaskMax { + consumed += val + } + return consumed, nil +} + +func chooseTaskStart(start *time.Time, created time.Time) *time.Time { + if start != nil { + return start + } + if created.IsZero() { + return nil + } + c := created + return &c +} + func (s *service) CreateTask(ctx context.Context, in CreateTaskInput) (int64, error) { db := s.repo.GetDbW() row := &tcmodel.Task{Name: in.Name, Description: in.Description, Status: in.Status, StartTime: in.StartTime, EndTime: in.EndTime, Visibility: in.Visibility, Quota: in.Quota, ClaimedCount: 0} diff --git a/internal/service/task_center/service_test.go b/internal/service/task_center/service_test.go index b868582..20b5578 100644 --- a/internal/service/task_center/service_test.go +++ b/internal/service/task_center/service_test.go @@ -3,6 +3,7 @@ package taskcenter import ( "context" "encoding/json" + "fmt" "testing" "time" @@ -156,10 +157,10 @@ func TestGetUserProgress_TimeWindow_Integration(t *testing.T) { switch w { case WindowDaily, WindowWeekly, WindowMonthly: expectedCount = 1 - case WindowActivityPeriod: + case WindowActivityPeriod, WindowLifetime: + // CRITICAL FIX: lifetime 现在受任务时间约束 + // taskStart = now - 200天,o2Time = now - 60天 (在范围内),o3Time = now - 365天 (超出范围) expectedCount = 2 // O1, O2 - case WindowLifetime: - expectedCount = 3 // O1, O2, O3 } if tp.OrderCount != expectedCount { @@ -400,3 +401,268 @@ func TestTimeWindow_ActivityPeriod(t *testing.T) { t.Fatalf("总体订单统计错误,期望 2 实际 %d", progress.OrderCount) } } + +func TestCalculateCrossTaskConsumedThreshold_RespectsTaskWindow(t *testing.T) { + repo, err := mysql.NewSQLiteRepoForTest() + if err != nil { + t.Fatalf("创建 repo 失败: %v", err) + } + db := repo.GetDbW() + initTestTables(t, db) + + svc := New(nil, repo, nil, nil, nil).(*service) + + now := time.Now() + startA := now.AddDate(0, -2, 0) + endA := now.AddDate(0, -1, 0) + startB := now.AddDate(0, -1, 0) + endB := now.AddDate(0, 0, 15) + startC := now.AddDate(0, -1, 15) + endC := now.AddDate(0, 1, 0) + + taskA := &tcmodel.Task{Name: "历史任务", Status: 1, Visibility: 1, StartTime: &startA, EndTime: &endA} + taskB := &tcmodel.Task{Name: "当前任务", Status: 1, Visibility: 1, StartTime: &startB, EndTime: &endB} + taskC := &tcmodel.Task{Name: "重叠任务", Status: 1, Visibility: 1, StartTime: &startC, EndTime: &endC} + + if err := db.Create(taskA).Error; err != nil { + t.Fatalf("创建任务 A 失败: %v", err) + } + if err := db.Create(taskB).Error; err != nil { + t.Fatalf("创建任务 B 失败: %v", err) + } + if err := db.Create(taskC).Error; err != nil { + t.Fatalf("创建任务 C 失败: %v", err) + } + + activityID := int64(9001) + tierA := &tcmodel.TaskTier{ + TaskID: taskA.ID, + Metric: MetricOrderAmount, + Operator: OperatorGTE, + Threshold: 20000, + Window: WindowLifetime, + ActivityID: activityID, + } + tierB := &tcmodel.TaskTier{ + TaskID: taskB.ID, + Metric: MetricOrderAmount, + Operator: OperatorGTE, + Threshold: 30000, + Window: WindowLifetime, + ActivityID: activityID, + } + tierC := &tcmodel.TaskTier{ + TaskID: taskC.ID, + Metric: MetricOrderAmount, + Operator: OperatorGTE, + Threshold: 40000, + Window: WindowLifetime, + ActivityID: activityID, + } + for _, tier := range []*tcmodel.TaskTier{tierA, tierB, tierC} { + if err := db.Create(tier).Error; err != nil { + t.Fatalf("创建档位失败: %v", err) + } + } + + userID := int64(9527) + payloadA := datatypes.JSON([]byte(fmt.Sprintf("[%d]", tierA.ID))) + payloadC := datatypes.JSON([]byte(fmt.Sprintf("[%d]", tierC.ID))) + if err := db.Create(&tcmodel.UserTaskProgress{UserID: userID, TaskID: taskA.ID, ActivityID: 0, ClaimedTiers: payloadA}).Error; err != nil { + t.Fatalf("写入任务 A 进度失败: %v", err) + } + if err := db.Create(&tcmodel.UserTaskProgress{UserID: userID, TaskID: taskC.ID, ActivityID: 0, ClaimedTiers: payloadC}).Error; err != nil { + t.Fatalf("写入任务 C 进度失败: %v", err) + } + + consumed, err := svc.calculateCrossTaskConsumedThreshold(userID, taskB, tierB) + if err != nil { + t.Fatalf("计算交叉占用失败: %v", err) + } + if consumed != tierC.Threshold { + t.Fatalf("交叉占用计算错误,期望 %d 实际 %d", tierC.Threshold, consumed) + } + + // 新增一个创建时间晚于 B 的任务 D,并标记为已领取 + taskD := &tcmodel.Task{Name: "后续任务", Status: 1, Visibility: 1} + if err := db.Create(taskD).Error; err != nil { + t.Fatalf("创建任务 D 失败: %v", err) + } + tierD := &tcmodel.TaskTier{ + TaskID: taskD.ID, + Metric: MetricOrderAmount, + Operator: OperatorGTE, + Threshold: 20000, + Window: WindowLifetime, + ActivityID: activityID, + } + if err := db.Create(tierD).Error; err != nil { + t.Fatalf("创建任务 D 档位失败: %v", err) + } + payloadD := datatypes.JSON([]byte(fmt.Sprintf("[%d]", tierD.ID))) + if err := db.Create(&tcmodel.UserTaskProgress{UserID: userID, TaskID: taskD.ID, ActivityID: 0, ClaimedTiers: payloadD}).Error; err != nil { + t.Fatalf("写入任务 D 进度失败: %v", err) + } + + consumed, err = svc.calculateCrossTaskConsumedThreshold(userID, taskB, tierB) + if err != nil { + t.Fatalf("再次计算交叉占用失败: %v", err) + } + expected := tierC.Threshold + tierD.Threshold + if consumed != expected { + t.Fatalf("交叉占用应包含任务 C+D,期望 %d 实际 %d", expected, consumed) + } +} + +// TestLifetimeWindow_RespectsTaskStartTime 验证 CRITICAL-1 修复: +// lifetime 窗口现在受任务 StartTime 约束,防止历史数据被用于领取新任务 +func TestLifetimeWindow_RespectsTaskStartTime(t *testing.T) { + repo, err := mysql.NewSQLiteRepoForTest() + if err != nil { + t.Fatalf("创建 repo 失败: %v", err) + } + db := repo.GetDbW() + initTestTables(t, db) + ensureExtraTablesForServiceTest(t, db) + + svc := New(nil, repo, nil, nil, nil) + + now := time.Now() + taskStart := now.Add(-30 * 24 * time.Hour) // 任务30天前开始 + + task := &tcmodel.Task{ + Name: "历史数据阻断测试", + Status: 1, + Visibility: 1, + StartTime: &taskStart, + } + if err := db.Create(task).Error; err != nil { + t.Fatalf("创建任务失败: %v", err) + } + + // 创建 lifetime 窗口档位 + tier := &tcmodel.TaskTier{ + TaskID: task.ID, + Metric: MetricOrderCount, + Operator: OperatorGTE, + Threshold: 3, // 需要3单才能领取 + Window: WindowLifetime, + } + if err := db.Create(tier).Error; err != nil { + t.Fatalf("创建档位失败: %v", err) + } + + db.Exec("INSERT INTO activities (id, price_draw) VALUES (1, 100)") + db.Exec("INSERT INTO activity_issues (id, activity_id) VALUES (1, 1)") + + userID := int64(10001) + + // 插入历史订单(任务开始之前) + historicalOrder := taskStart.Add(-10 * 24 * time.Hour).Format(time.DateTime) + for i := int64(101); i <= 105; i++ { + db.Exec("INSERT INTO orders (id, user_id, status, source_type, total_amount, created_at) VALUES (?, ?, 2, 0, 100, ?)", i, userID, historicalOrder) + db.Exec("INSERT INTO activity_draw_logs (order_id, issue_id) VALUES (?, 1)", i) + } + + // 插入新订单(任务开始之后) + recentOrder := now.Add(-1 * 24 * time.Hour).Format(time.DateTime) + for i := int64(201); i <= 202; i++ { + db.Exec("INSERT INTO orders (id, user_id, status, source_type, total_amount, created_at) VALUES (?, ?, 2, 0, 100, ?)", i, userID, recentOrder) + db.Exec("INSERT INTO activity_draw_logs (order_id, issue_id) VALUES (?, 1)", i) + } + + // 获取进度 + progress, err := svc.GetUserProgress(context.Background(), userID, task.ID) + if err != nil { + t.Fatalf("获取进度失败: %v", err) + } + + tierProgress, ok := progress.TierProgressMap[tier.ID] + if !ok { + t.Fatalf("未找到档位进度") + } + + // 验证:只统计任务开始后的订单(2单),不包含历史订单(5单) + if tierProgress.OrderCount != 2 { + t.Errorf("lifetime 窗口应受任务时间约束: 期望 2 单, 实际 %d 单", tierProgress.OrderCount) + } + + // 验证:阈值未达到(需要3单,实际只有2单) + if tierProgress.OrderCount >= tier.Threshold { + t.Errorf("历史数据不应计入进度,用户不应能够领取奖励") + } + + t.Logf("✓ CRITICAL-1 修复验证通过: lifetime 窗口正确受任务 StartTime 约束") + t.Logf(" - 历史订单: 5 单 (任务开始前)") + t.Logf(" - 有效订单: %d 单 (任务开始后)", tierProgress.OrderCount) +} + +// TestEmptyWindow_RespectsTaskStartTime 验证空窗口也受任务时间约束 +func TestEmptyWindow_RespectsTaskStartTime(t *testing.T) { + repo, err := mysql.NewSQLiteRepoForTest() + if err != nil { + t.Fatalf("创建 repo 失败: %v", err) + } + db := repo.GetDbW() + initTestTables(t, db) + ensureExtraTablesForServiceTest(t, db) + + svc := New(nil, repo, nil, nil, nil) + + now := time.Now() + taskStart := now.Add(-7 * 24 * time.Hour) + + task := &tcmodel.Task{ + Name: "空窗口测试", + Status: 1, + Visibility: 1, + StartTime: &taskStart, + } + if err := db.Create(task).Error; err != nil { + t.Fatalf("创建任务失败: %v", err) + } + + // 创建空窗口档位 + tier := &tcmodel.TaskTier{ + TaskID: task.ID, + Metric: MetricOrderCount, + Operator: OperatorGTE, + Threshold: 1, + Window: "", // 空窗口 + } + if err := db.Create(tier).Error; err != nil { + t.Fatalf("创建档位失败: %v", err) + } + + db.Exec("INSERT INTO activities (id, price_draw) VALUES (1, 100)") + db.Exec("INSERT INTO activity_issues (id, activity_id) VALUES (1, 1)") + + userID := int64(10002) + + // 历史订单(任务开始前) + oldTime := taskStart.Add(-24 * time.Hour).Format(time.DateTime) + db.Exec("INSERT INTO orders (id, user_id, status, source_type, total_amount, created_at) VALUES (301, ?, 2, 0, 100, ?)", userID, oldTime) + db.Exec("INSERT INTO activity_draw_logs (order_id, issue_id) VALUES (301, 1)") + + // 新订单(任务开始后) + newTime := now.Add(-1 * time.Hour).Format(time.DateTime) + db.Exec("INSERT INTO orders (id, user_id, status, source_type, total_amount, created_at) VALUES (302, ?, 2, 0, 100, ?)", userID, newTime) + db.Exec("INSERT INTO activity_draw_logs (order_id, issue_id) VALUES (302, 1)") + + progress, err := svc.GetUserProgress(context.Background(), userID, task.ID) + if err != nil { + t.Fatalf("获取进度失败: %v", err) + } + + tierProgress, ok := progress.TierProgressMap[tier.ID] + if !ok { + t.Fatalf("未找到档位进度") + } + + // 空窗口也应受任务时间约束,只统计1单 + if tierProgress.OrderCount != 1 { + t.Errorf("空窗口应受任务时间约束: 期望 1 单, 实际 %d 单", tierProgress.OrderCount) + } + + t.Logf("✓ 空窗口测试通过: OrderCount=%d", tierProgress.OrderCount) +}