diff --git a/backend/docs/docs.go b/backend/docs/docs.go index 70ce036..f4c9c70 100644 --- a/backend/docs/docs.go +++ b/backend/docs/docs.go @@ -26,6 +26,7 @@ const docTemplate = `{ "paths": { "/super/v1/auth/login": { "post": { + "description": "Login", "consumes": [ "application/json" ], @@ -33,24 +34,25 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Auth" ], + "summary": "Login", "parameters": [ { - "description": "form", + "description": "Login form", "name": "form", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginForm" + "$ref": "#/definitions/quyun_v2_app_http_super_v1_dto.LoginForm" } } ], "responses": { "200": { - "description": "成功", + "description": "OK", "schema": { - "$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginResponse" + "$ref": "#/definitions/quyun_v2_app_http_super_v1_dto.LoginResponse" } } } @@ -58,6 +60,7 @@ const docTemplate = `{ }, "/super/v1/auth/token": { "get": { + "description": "Check token", "consumes": [ "application/json" ], @@ -65,13 +68,14 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Auth" ], + "summary": "Check token", "responses": { "200": { - "description": "成功", + "description": "OK", "schema": { - "$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginResponse" + "$ref": "#/definitions/quyun_v2_app_http_super_v1_dto.LoginResponse" } } } @@ -79,6 +83,7 @@ const docTemplate = `{ }, "/super/v1/contents": { "get": { + "description": "List contents", "consumes": [ "application/json" ], @@ -86,131 +91,20 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Content" ], - "summary": "内容列表(平台侧汇总)", + "summary": "List contents", "parameters": [ - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, { "type": "integer", - "name": "id", - "in": "query" - }, - { - "type": "string", - "name": "keyword", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", - "name": "price_amount_max", - "in": "query" - }, - { - "type": "integer", - "name": "price_amount_min", - "in": "query" - }, - { - "type": "string", - "name": "published_at_from", - "in": "query" - }, - { - "type": "string", - "name": "published_at_to", - "in": "query" - }, - { - "enum": [ - "draft", - "reviewing", - "published", - "unpublished", - "blocked" - ], - "type": "string", - "x-enum-varnames": [ - "ContentStatusDraft", - "ContentStatusReviewing", - "ContentStatusPublished", - "ContentStatusUnpublished", - "ContentStatusBlocked" - ], - "name": "status", - "in": "query" - }, - { - "type": "string", - "name": "tenant_code", - "in": "query" - }, - { - "type": "integer", - "name": "tenant_id", - "in": "query" - }, - { - "type": "string", - "name": "tenant_name", - "in": "query" - }, - { - "type": "integer", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "name": "username", - "in": "query" - }, - { - "enum": [ - "public", - "tenant_only", - "private" - ], - "type": "string", - "x-enum-varnames": [ - "ContentVisibilityPublic", - "ContentVisibilityTenantOnly", - "ContentVisibilityPrivate" - ], - "name": "visibility", + "description": "Page size", + "name": "limit", "in": "query" } ], @@ -226,7 +120,10 @@ const docTemplate = `{ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.SuperContentItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.AdminContentItem" + } } } } @@ -238,6 +135,7 @@ const docTemplate = `{ }, "/super/v1/orders": { "get": { + "description": "List orders", "consumes": [ "application/json" ], @@ -245,134 +143,20 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Order" ], - "summary": "订单列表", + "summary": "List orders", "parameters": [ { "type": "integer", - "name": "amount_paid_max", - "in": "query" - }, - { - "type": "integer", - "name": "amount_paid_min", - "in": "query" - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "integer", - "name": "content_id", - "in": "query" - }, - { - "type": "string", - "name": "content_title", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "name": "id", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, - { - "type": "string", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "name": "status", - "in": "query" - }, - { - "type": "string", - "name": "tenant_code", - "in": "query" - }, { "type": "integer", - "name": "tenant_id", - "in": "query" - }, - { - "type": "string", - "name": "tenant_name", - "in": "query" - }, - { - "enum": [ - "content_purchase" - ], - "type": "string", - "x-enum-varnames": [ - "OrderTypeContentPurchase" - ], - "name": "type", - "in": "query" - }, - { - "type": "integer", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "name": "username", + "description": "Page size", + "name": "limit", "in": "query" } ], @@ -388,7 +172,10 @@ const docTemplate = `{ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.SuperOrderItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.SuperOrderItem" + } } } } @@ -400,6 +187,7 @@ const docTemplate = `{ }, "/super/v1/orders/statistics": { "get": { + "description": "Order statistics", "consumes": [ "application/json" ], @@ -407,9 +195,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Order" ], - "summary": "订单统计信息", + "summary": "Order statistics", "responses": { "200": { "description": "OK", @@ -420,8 +208,9 @@ const docTemplate = `{ } } }, - "/super/v1/orders/{orderID}": { + "/super/v1/orders/{id}": { "get": { + "description": "Get order", "consumes": [ "application/json" ], @@ -429,15 +218,15 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Order" ], - "summary": "订单详情", + "summary": "Get order", "parameters": [ { "type": "integer", "format": "int64", - "description": "OrderID", - "name": "orderID", + "description": "Order ID", + "name": "id", "in": "path", "required": true } @@ -452,9 +241,9 @@ const docTemplate = `{ } } }, - "/super/v1/orders/{orderID}/refund": { + "/super/v1/orders/{id}/refund": { "post": { - "description": "该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。", + "description": "Refund order", "consumes": [ "application/json" ], @@ -462,20 +251,20 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Order" ], - "summary": "订单退款(平台)", + "summary": "Refund order", "parameters": [ { "type": "integer", "format": "int64", - "description": "OrderID", - "name": "orderID", + "description": "Order ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Refund form", "name": "form", "in": "body", "required": true, @@ -486,9 +275,9 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK", + "description": "Refunded", "schema": { - "$ref": "#/definitions/models.Order" + "type": "string" } } } @@ -496,6 +285,7 @@ const docTemplate = `{ }, "/super/v1/tenants": { "get": { + "description": "List tenants", "consumes": [ "application/json" ], @@ -503,88 +293,27 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "租户列表", + "summary": "List tenants", "parameters": [ { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "code", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "string", - "name": "expired_at_from", - "in": "query" - }, - { - "type": "string", - "name": "expired_at_to", + "type": "integer", + "description": "Page number", + "name": "page", "in": "query" }, { "type": "integer", - "name": "id", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "description": "Page size", "name": "limit", "in": "query" }, { "type": "string", + "description": "Name", "name": "name", "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "TenantStatusPendingVerify", - "TenantStatusVerified", - "TenantStatusBanned" - ], - "name": "status", - "in": "query" - }, - { - "type": "integer", - "name": "user_id", - "in": "query" } ], "responses": { @@ -599,7 +328,10 @@ const docTemplate = `{ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.TenantItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.TenantItem" + } } } } @@ -609,6 +341,7 @@ const docTemplate = `{ } }, "post": { + "description": "Create tenant", "consumes": [ "application/json" ], @@ -616,12 +349,12 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "创建租户并设置租户管理员", + "summary": "Create tenant", "parameters": [ { - "description": "Form", + "description": "Create form", "name": "form", "in": "body", "required": true, @@ -632,9 +365,9 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK", + "description": "Created", "schema": { - "$ref": "#/definitions/models.Tenant" + "type": "string" } } } @@ -642,6 +375,7 @@ const docTemplate = `{ }, "/super/v1/tenants/statuses": { "get": { + "description": "Tenant statuses", "consumes": [ "application/json" ], @@ -649,9 +383,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "租户状态列表", + "summary": "Tenant statuses", "responses": { "200": { "description": "OK", @@ -665,8 +399,9 @@ const docTemplate = `{ } } }, - "/super/v1/tenants/{tenantID}": { + "/super/v1/tenants/{id}": { "get": { + "description": "Get tenant", "consumes": [ "application/json" ], @@ -674,15 +409,15 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "租户详情", + "summary": "Get tenant", "parameters": [ { "type": "integer", "format": "int64", - "description": "TenantID", - "name": "tenantID", + "description": "Tenant ID", + "name": "id", "in": "path", "required": true } @@ -697,6 +432,7 @@ const docTemplate = `{ } }, "patch": { + "description": "Update tenant expire", "consumes": [ "application/json" ], @@ -704,20 +440,20 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "更新过期时间", + "summary": "Update tenant expire", "parameters": [ { "type": "integer", "format": "int64", - "description": "TenantID", - "name": "tenantID", + "description": "Tenant ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, @@ -726,11 +462,19 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "200": { + "description": "Updated", + "schema": { + "type": "string" + } + } + } } }, - "/super/v1/tenants/{tenantID}/contents": { - "get": { + "/super/v1/tenants/{id}/status": { + "patch": { + "description": "Update tenant status", "consumes": [ "application/json" ], @@ -738,104 +482,70 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "租户内容列表(平台侧)", + "summary": "Update tenant status", "parameters": [ { "type": "integer", "format": "int64", - "description": "TenantID", + "description": "Tenant ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Update form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.TenantStatusUpdateForm" + } + } + ], + "responses": { + "200": { + "description": "Updated", + "schema": { + "type": "string" + } + } + } + } + }, + "/super/v1/tenants/{tenantID}/contents": { + "get": { + "description": "List contents by tenant", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Content" + ], + "summary": "List tenant contents", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Tenant ID", "name": "tenantID", "in": "path", "required": true }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "string", - "name": "keyword", - "in": "query" - }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, - { - "type": "string", - "name": "published_at_from", - "in": "query" - }, - { - "type": "string", - "name": "published_at_to", - "in": "query" - }, - { - "enum": [ - "draft", - "reviewing", - "published", - "unpublished", - "blocked" - ], - "type": "string", - "x-enum-varnames": [ - "ContentStatusDraft", - "ContentStatusReviewing", - "ContentStatusPublished", - "ContentStatusUnpublished", - "ContentStatusBlocked" - ], - "name": "status", - "in": "query" - }, { "type": "integer", - "name": "user_id", - "in": "query" - }, - { - "enum": [ - "public", - "tenant_only", - "private" - ], - "type": "string", - "x-enum-varnames": [ - "ContentVisibilityPublic", - "ContentVisibilityTenantOnly", - "ContentVisibilityPrivate" - ], - "name": "visibility", + "description": "Page size", + "name": "limit", "in": "query" } ], @@ -851,7 +561,10 @@ const docTemplate = `{ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.SuperTenantContentItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.AdminContentItem" + } } } } @@ -863,6 +576,7 @@ const docTemplate = `{ }, "/super/v1/tenants/{tenantID}/contents/{contentID}/status": { "patch": { + "description": "Update content status", "consumes": [ "application/json" ], @@ -870,14 +584,14 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Content" ], - "summary": "更新租户内容状态(平台侧:下架/封禁)", + "summary": "Update content status", "parameters": [ { "type": "integer", "format": "int64", - "description": "TenantID", + "description": "Tenant ID", "name": "tenantID", "in": "path", "required": true @@ -885,13 +599,13 @@ const docTemplate = `{ { "type": "integer", "format": "int64", - "description": "ContentID", + "description": "Content ID", "name": "contentID", "in": "path", "required": true }, { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, @@ -902,50 +616,17 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK", + "description": "Updated", "schema": { - "$ref": "#/definitions/models.Content" + "type": "string" } } } } }, - "/super/v1/tenants/{tenantID}/status": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Super" - ], - "summary": "更新租户状态", - "parameters": [ - { - "type": "integer", - "format": "int64", - "description": "TenantID", - "name": "tenantID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.TenantStatusUpdateForm" - } - } - ], - "responses": {} - } - }, "/super/v1/tenants/{tenantID}/users": { "get": { + "description": "List tenant users", "consumes": [ "application/json" ], @@ -953,70 +634,28 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "租户成员列表(平台侧)", + "summary": "List tenant users", "parameters": [ { "type": "integer", "format": "int64", - "description": "TenantID", + "description": "Tenant ID", "name": "tenantID", "in": "path", "required": true }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, - { - "enum": [ - "member", - "tenant_admin" - ], - "type": "string", - "x-enum-varnames": [ - "TenantUserRoleMember", - "TenantUserRoleTenantAdmin" - ], - "description": "Role 按角色过滤(可选):member/tenant_admin。", - "name": "role", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "UserStatusPendingVerify", - "UserStatusVerified", - "UserStatusBanned" - ], - "description": "Status 按成员状态过滤(可选):pending_verify/verified/banned。", - "name": "status", - "in": "query" - }, { "type": "integer", - "description": "UserID 按用户ID过滤(可选)。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 按用户名模糊查询(可选,支持包含匹配)。", - "name": "username", + "description": "Page size", + "name": "limit", "in": "query" } ], @@ -1032,7 +671,10 @@ const docTemplate = `{ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.SuperTenantUserItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.SuperTenantUserItem" + } } } } @@ -1044,6 +686,7 @@ const docTemplate = `{ }, "/super/v1/users": { "get": { + "description": "List users", "consumes": [ "application/json" ], @@ -1051,98 +694,27 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "用户列表", + "summary": "List users", "parameters": [ - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, { "type": "integer", - "name": "id", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, - { - "enum": [ - "user", - "super_admin" - ], - "type": "string", - "x-enum-varnames": [ - "RoleUser", - "RoleSuperAdmin" - ], - "description": "Role filters users containing a role (user/super_admin).", - "name": "role", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "UserStatusPendingVerify", - "UserStatusVerified", - "UserStatusBanned" - ], - "name": "status", - "in": "query" - }, { "type": "integer", - "description": "TenantID filters users by membership in the given tenant.", - "name": "tenant_id", + "description": "Page size", + "name": "limit", "in": "query" }, { "type": "string", + "description": "Username", "name": "username", "in": "query" - }, - { - "type": "string", - "name": "verified_at_from", - "in": "query" - }, - { - "type": "string", - "name": "verified_at_to", - "in": "query" } ], "responses": { @@ -1157,7 +729,10 @@ const docTemplate = `{ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.UserItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.UserItem" + } } } } @@ -1169,6 +744,7 @@ const docTemplate = `{ }, "/super/v1/users/statistics": { "get": { + "description": "User statistics", "consumes": [ "application/json" ], @@ -1176,9 +752,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "用户统计信息", + "summary": "User statistics", "responses": { "200": { "description": "OK", @@ -1194,6 +770,7 @@ const docTemplate = `{ }, "/super/v1/users/statuses": { "get": { + "description": "User statuses", "consumes": [ "application/json" ], @@ -1201,9 +778,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "用户状态列表", + "summary": "User statuses", "responses": { "200": { "description": "OK", @@ -1217,8 +794,9 @@ const docTemplate = `{ } } }, - "/super/v1/users/{userID}": { + "/super/v1/users/{id}": { "get": { + "description": "Get user", "consumes": [ "application/json" ], @@ -1226,15 +804,15 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "用户详情", + "summary": "Get user", "parameters": [ { "type": "integer", "format": "int64", - "description": "UserID", - "name": "userID", + "description": "User ID", + "name": "id", "in": "path", "required": true } @@ -1249,8 +827,9 @@ const docTemplate = `{ } } }, - "/super/v1/users/{userID}/roles": { + "/super/v1/users/{id}/roles": { "patch": { + "description": "Update user roles", "consumes": [ "application/json" ], @@ -1258,20 +837,20 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "更新用户角色", + "summary": "Update user roles", "parameters": [ { "type": "integer", "format": "int64", - "description": "UserID", - "name": "userID", + "description": "User ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, @@ -1280,11 +859,19 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "200": { + "description": "Updated", + "schema": { + "type": "string" + } + } + } } }, - "/super/v1/users/{userID}/status": { + "/super/v1/users/{id}/status": { "patch": { + "description": "Update user status", "consumes": [ "application/json" ], @@ -1292,20 +879,20 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "更新用户状态", + "summary": "Update user status", "parameters": [ { "type": "integer", "format": "int64", - "description": "UserID", - "name": "userID", + "description": "User ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, @@ -1314,11 +901,19 @@ const docTemplate = `{ } } ], - "responses": {} + "responses": { + "200": { + "description": "Updated", + "schema": { + "type": "string" + } + } + } } }, - "/super/v1/users/{userID}/tenants": { + "/super/v1/users/{id}/tenants": { "get": { + "description": "List tenants joined by user", "consumes": [ "application/json" ], @@ -1326,83 +921,28 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "用户加入的租户列表", + "summary": "List user tenants", "parameters": [ { "type": "integer", "format": "int64", - "description": "UserID", - "name": "userID", + "description": "User ID", + "name": "id", "in": "path", "required": true }, - { - "type": "string", - "name": "code", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "string", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, - { - "enum": [ - "member", - "tenant_admin" - ], - "type": "string", - "x-enum-varnames": [ - "TenantUserRoleMember", - "TenantUserRoleTenantAdmin" - ], - "description": "Role filters tenant_users.role containing a role (tenant_admin/member).", - "name": "role", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "UserStatusPendingVerify", - "UserStatusVerified", - "UserStatusBanned" - ], - "description": "Status filters tenant_users.status.", - "name": "status", - "in": "query" - }, { "type": "integer", - "name": "tenant_id", + "description": "Page size", + "name": "limit", "in": "query" } ], @@ -1418,7 +958,10 @@ const docTemplate = `{ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.UserTenantItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.UserTenantItem" + } } } } @@ -1428,8 +971,133 @@ const docTemplate = `{ } } }, + "/t/{tenantCode}/v1/auth/login": { + "post": { + "description": "Login or register user using phone number and OTP", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Auth" + ], + "summary": "Login or Register with OTP", + "parameters": [ + { + "description": "Login form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.LoginForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.LoginResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/auth/otp": { + "post": { + "description": "Send OTP to phone number", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Auth" + ], + "summary": "Send OTP", + "parameters": [ + { + "description": "Phone number", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.SendOTPForm" + } + } + ], + "responses": { + "200": { + "description": "OTP sent", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/comments/{id}/like": { + "post": { + "description": "Like a comment", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Content" + ], + "summary": "Like comment", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Comment ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Liked", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/common/options": { + "get": { + "description": "Get global options (enums)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Get options", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.OptionsResponse" + } + } + } + } + }, "/t/{tenantCode}/v1/contents": { "get": { + "description": "List contents with filtering and pagination", "consumes": [ "application/json" ], @@ -1437,32 +1105,43 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "Content" ], - "summary": "内容列表(已发布)", + "summary": "List contents", "parameters": [ { "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Keyword filters by title keyword (LIKE).", + "description": "Search keyword", "name": "keyword", "in": "query" }, { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", + "type": "string", + "description": "Genre", + "name": "genre", "in": "query" }, { "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "format": "int64", + "description": "Filter by creator", + "name": "tenant_id", + "in": "query" + }, + { + "enum": [ + "latest", + "hot", + "price_asc" + ], + "type": "string", + "description": "Sort order", + "name": "sort", + "in": "query" + }, + { + "type": "integer", + "description": "Page number", "name": "page", "in": "query" } @@ -1479,7 +1158,10 @@ const docTemplate = `{ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.ContentItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } } } } @@ -1489,8 +1171,9 @@ const docTemplate = `{ } } }, - "/t/{tenantCode}/v1/contents/{contentID}": { + "/t/{tenantCode}/v1/contents/{id}": { "get": { + "description": "Get content detail by ID", "consumes": [ "application/json" ], @@ -1498,22 +1181,15 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "Content" ], - "summary": "内容详情(可见性+权益校验)", + "summary": "Get content detail", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "ContentID", - "name": "contentID", + "description": "Content ID", + "name": "id", "in": "path", "required": true } @@ -1528,8 +1204,9 @@ const docTemplate = `{ } } }, - "/t/{tenantCode}/v1/contents/{contentID}/assets": { + "/t/{tenantCode}/v1/contents/{id}/comments": { "get": { + "description": "Get comments for a content", "consumes": [ "application/json" ], @@ -1537,315 +1214,23 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "Content" ], - "summary": "获取正片资源(main role,需要已购或免费)", + "summary": "Get comments", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.ContentAssetsResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/contents/{contentID}/preview": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "获取试看资源(preview role)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.ContentAssetsResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/contents/{contentID}/purchase": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "购买内容(余额支付)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PurchaseContentForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.PurchaseContentResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/join/invite": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TenantJoin" - ], - "summary": "通过邀请码加入租户", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.JoinByInviteForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantUser" - } - } - } - } - }, - "/t/{tenantCode}/v1/join/request": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TenantJoin" - ], - "summary": "提交加入租户申请", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.JoinRequestCreateForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/contents": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "内容列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", + "description": "Content ID", "name": "id", - "in": "query" - }, - { - "type": "string", - "name": "keyword", - "in": "query" + "in": "path", + "required": true }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" - }, - { - "type": "string", - "name": "published_at_from", - "in": "query" - }, - { - "type": "string", - "name": "published_at_to", - "in": "query" - }, - { - "enum": [ - "draft", - "reviewing", - "published", - "unpublished", - "blocked" - ], - "type": "string", - "x-enum-varnames": [ - "ContentStatusDraft", - "ContentStatusReviewing", - "ContentStatusPublished", - "ContentStatusUnpublished", - "ContentStatusBlocked" - ], - "name": "status", - "in": "query" - }, - { - "type": "integer", - "name": "user_id", - "in": "query" - }, - { - "enum": [ - "public", - "tenant_only", - "private" - ], - "type": "string", - "x-enum-varnames": [ - "ContentVisibilityPublic", - "ContentVisibilityTenantOnly", - "ContentVisibilityPrivate" - ], - "name": "visibility", - "in": "query" } ], "responses": { @@ -1860,7 +1245,10 @@ const docTemplate = `{ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.AdminContentItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.Comment" + } } } } @@ -1870,6 +1258,7 @@ const docTemplate = `{ } }, "post": { + "description": "Post a comment to a content", "consumes": [ "application/json" ], @@ -1877,19 +1266,232 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "Content" ], - "summary": "创建内容(草稿)", + "summary": "Post comment", "parameters": [ { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Comment form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CommentCreateForm" + } + } + ], + "responses": { + "200": { + "description": "Comment created", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/contents/{id}/favorite": { + "post": { + "tags": [ + "Content" + ], + "summary": "Add favorite", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Favorited", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "tags": [ + "Content" + ], + "summary": "Remove favorite", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Unfavorited", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/contents/{id}/like": { + "post": { + "tags": [ + "Content" + ], + "summary": "Add like", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Liked", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "tags": [ + "Content" + ], + "summary": "Remove like", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Unliked", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/apply": { + "post": { + "description": "Apply to become a creator", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Apply creator", + "parameters": [ + { + "description": "Apply form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ApplyForm" + } + } + ], + "responses": { + "200": { + "description": "Application submitted", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/contents": { + "get": { + "description": "List creator contents", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "List contents", + "parameters": [ + { + "type": "string", + "description": "Status", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "Genre", + "name": "genre", + "in": "query" + }, + { + "type": "string", + "description": "Keyword", + "name": "keyword", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } + } + } + } + }, + "post": { + "description": "Create/Publish content", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Create content", + "parameters": [ + { + "description": "Content form", "name": "form", "in": "body", "required": true, @@ -1900,16 +1502,17 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK", + "description": "Created", "schema": { - "$ref": "#/definitions/models.Content" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/management/contents/publish": { - "post": { + "/t/{tenantCode}/v1/creator/contents/{id}": { + "get": { + "description": "Get content details for edit", "consumes": [ "application/json" ], @@ -1917,39 +1520,30 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "CreatorCenter" ], - "summary": "内容发布(创建+绑定资源+定价)", + "summary": "Get content", "parameters": [ { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", "in": "path", "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentPublishForm" - } } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dto.ContentPublishResponse" + "$ref": "#/definitions/dto.ContentEditDTO" } } } - } - }, - "/t/{tenantCode}/v1/management/contents/{contentID}": { - "patch": { + }, + "put": { + "description": "Update content", "consumes": [ "application/json" ], @@ -1957,27 +1551,20 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "CreatorCenter" ], - "summary": "更新内容(标题/描述/状态等)", + "summary": "Update content", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "ContentID", - "name": "contentID", + "description": "Content ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, @@ -1988,16 +1575,15 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK", + "description": "Updated", "schema": { - "$ref": "#/definitions/models.Content" + "type": "string" } } } - } - }, - "/t/{tenantCode}/v1/management/contents/{contentID}/assets": { - "post": { + }, + "delete": { + "description": "Delete content", "consumes": [ "application/json" ], @@ -2005,47 +1591,247 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "CreatorCenter" ], - "summary": "绑定媒体资源到内容(main/cover/preview)", + "summary": "Delete content", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "ContentID", - "name": "contentID", + "description": "Content ID", + "name": "id", "in": "path", "required": true + } + ], + "responses": { + "200": { + "description": "Deleted", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/dashboard": { + "get": { + "description": "Get creator dashboard stats", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Dashboard stats", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.DashboardStats" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/orders": { + "get": { + "description": "List sales orders", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "List sales orders", + "parameters": [ + { + "type": "string", + "description": "Status", + "name": "status", + "in": "query" }, { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentAssetAttachForm" - } + "type": "string", + "description": "Keyword", + "name": "keyword", + "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/models.ContentAsset" + "type": "array", + "items": { + "$ref": "#/definitions/dto.Order" + } } } } } }, - "/t/{tenantCode}/v1/management/contents/{contentID}/price": { + "/t/{tenantCode}/v1/creator/orders/{id}/refund": { + "post": { + "description": "Process refund", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Process refund", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Order ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Refund form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RefundForm" + } + } + ], + "responses": { + "200": { + "description": "Processed", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/payout-accounts": { + "get": { + "description": "List payout accounts", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "List payout accounts", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.PayoutAccount" + } + } + } + } + }, + "post": { + "description": "Add payout account", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Add payout account", + "parameters": [ + { + "description": "Account form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PayoutAccount" + } + } + ], + "responses": { + "200": { + "description": "Added", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "description": "Remove payout account", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Remove payout account", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Account ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Removed", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/settings": { + "get": { + "description": "Get channel settings", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Get settings", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.Settings" + } + } + } + }, "put": { + "description": "Update channel settings", "consumes": [ "application/json" ], @@ -2053,122 +1839,33 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "CreatorCenter" ], - "summary": "设置内容价格与折扣", + "summary": "Update settings", "parameters": [ { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - }, - { - "description": "Form", + "description": "Settings form", "name": "form", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.ContentPriceUpsertForm" + "$ref": "#/definitions/dto.Settings" } } ], "responses": { "200": { - "description": "OK", + "description": "Updated", "schema": { - "$ref": "#/definitions/models.ContentPrice" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/management/invites": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "邀请码列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Code 按邀请码模糊过滤(可选):支持部分匹配(like)。", - "name": "code", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "active", - "disabled", - "expired" - ], - "type": "string", - "x-enum-varnames": [ - "TenantInviteStatusActive", - "TenantInviteStatusDisabled", - "TenantInviteStatusExpired" - ], - "description": "Status 按状态过滤(可选):active/disabled/expired。", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.TenantInvite" - } - } - } - ] - } - } - } - }, + "/t/{tenantCode}/v1/creator/withdraw": { "post": { + "description": "Request withdrawal", "consumes": [ "application/json" ], @@ -2176,39 +1873,33 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "CreatorCenter" ], - "summary": "创建邀请码(租户管理)", + "summary": "Request withdrawal", "parameters": [ { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", + "description": "Withdraw form", "name": "form", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.AdminTenantInviteCreateForm" + "$ref": "#/definitions/dto.WithdrawForm" } } ], "responses": { "200": { - "description": "OK", + "description": "Withdrawal requested", "schema": { - "$ref": "#/definitions/models.TenantInvite" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/management/invites/{inviteID}/disable": { - "patch": { + "/t/{tenantCode}/v1/creators/{id}/contents": { + "get": { + "description": "List contents of a specific creator", "consumes": [ "application/json" ], @@ -2216,1135 +1907,29 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "TenantPublic" ], - "summary": "禁用邀请码(租户管理)", + "summary": "List creator contents", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "InviteID", - "name": "inviteID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantInviteDisableForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantInvite" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/join-requests": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "加入申请列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", + "description": "Tenant ID", + "name": "id", "in": "path", "required": true }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page", "name": "page", "in": "query" }, - { - "enum": [ - "pending", - "approved", - "rejected" - ], - "type": "string", - "x-enum-varnames": [ - "TenantJoinRequestStatusPending", - "TenantJoinRequestStatusApproved", - "TenantJoinRequestStatusRejected" - ], - "description": "Status 按申请状态过滤(可选):pending/approved/rejected。", - "name": "status", - "in": "query" - }, { "type": "integer", - "description": "UserID 按申请人用户ID过滤(可选)。", - "name": "user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/management/join-requests/{requestID}/approve": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "通过加入申请(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "RequestID", - "name": "requestID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/join-requests/{requestID}/reject": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "拒绝加入申请(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "RequestID", - "name": "requestID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/ledgers": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "余额流水列表(租户管理/审计)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "BizRefID 按业务引用ID过滤(可选)。", - "name": "biz_ref_id", - "in": "query" - }, - { - "type": "string", - "description": "BizRefType 按业务引用类型过滤(可选)。\n约定:当前业务写入为 \"order\";未来可扩展为 refund 等。", - "name": "biz_ref_type", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "description": "Limit", "name": "limit", "in": "query" - }, - { - "type": "integer", - "description": "OperatorUserID 按操作者用户ID过滤(可选)。\n典型场景:后台检索“某个管理员发起的退款/调账”等敏感操作流水。", - "name": "operator_user_id", - "in": "query" - }, - { - "type": "integer", - "description": "OrderID 按关联订单过滤(可选)。", - "name": "order_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "debit_purchase", - "credit_refund", - "freeze", - "unfreeze", - "adjustment" - ], - "type": "string", - "x-enum-varnames": [ - "TenantLedgerTypeDebitPurchase", - "TenantLedgerTypeCreditRefund", - "TenantLedgerTypeFreeze", - "TenantLedgerTypeUnfreeze", - "TenantLedgerTypeAdjustment" - ], - "description": "Type 按流水类型过滤(可选)。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 按余额账户归属用户ID过滤(可选)。\n典型场景:查看某个租户成员的资金变化全链路。", - "name": "user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.AdminLedgerItem" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/management/media_assets": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "媒体资源列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom filters assets by created_at \u003e= this time; optional.", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo filters assets by created_at \u003c= this time; optional.", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "uploaded", - "processing", - "ready", - "failed", - "deleted" - ], - "type": "string", - "x-enum-varnames": [ - "MediaAssetStatusUploaded", - "MediaAssetStatusProcessing", - "MediaAssetStatusReady", - "MediaAssetStatusFailed", - "MediaAssetStatusDeleted" - ], - "description": "Status filters by processing status (uploaded/processing/ready/failed/deleted); optional.", - "name": "status", - "in": "query" - }, - { - "enum": [ - "video", - "audio", - "image" - ], - "type": "string", - "x-enum-varnames": [ - "MediaAssetTypeVideo", - "MediaAssetTypeAudio", - "MediaAssetTypeImage" - ], - "description": "Type filters by media type (video/audio/image); optional.", - "name": "type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/management/media_assets/upload_init": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "初始化媒体资源上传(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadInitForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadInitResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/media_assets/{assetID}": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "媒体资源详情(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - }, - "delete": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "删除媒体资源(租户管理,软删)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/media_assets/{assetID}/upload_complete": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "确认上传完成并进入处理(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadCompleteForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/orders": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", - "name": "amount_paid_max", - "in": "query" - }, - { - "type": "integer", - "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", - "name": "amount_paid_min", - "in": "query" - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "integer", - "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", - "name": "content_id", - "in": "query" - }, - { - "type": "string", - "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", - "name": "content_title", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", - "name": "status", - "in": "query" - }, - { - "enum": [ - "content_purchase" - ], - "type": "string", - "x-enum-varnames": [ - "OrderTypeContentPurchase" - ], - "description": "Type 订单类型(可选):content_purchase 等。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.Order" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/management/orders/export": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单导出(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", - "name": "amount_paid_max", - "in": "query" - }, - { - "type": "integer", - "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", - "name": "amount_paid_min", - "in": "query" - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "integer", - "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", - "name": "content_id", - "in": "query" - }, - { - "type": "string", - "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", - "name": "content_title", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", - "name": "status", - "in": "query" - }, - { - "enum": [ - "content_purchase" - ], - "type": "string", - "x-enum-varnames": [ - "OrderTypeContentPurchase" - ], - "description": "Type 订单类型(可选):content_purchase 等。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminOrderExportResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/orders/{orderID}": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单详情(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "OrderID", - "name": "orderID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminOrderDetail" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/orders/{orderID}/refund": { - "post": { - "description": "该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。\n重复请求幂等:订单处于 refunding/refunded 时会返回当前订单状态,不会重复入账/重复回收权益。", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单退款(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "OrderID", - "name": "orderID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminOrderRefundForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.Order" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/users": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "成员列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "member", - "tenant_admin" - ], - "type": "string", - "x-enum-varnames": [ - "TenantUserRoleMember", - "TenantUserRoleTenantAdmin" - ], - "description": "Role 按角色过滤(可选):member/tenant_admin。", - "name": "role", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "UserStatusPendingVerify", - "UserStatusVerified", - "UserStatusBanned" - ], - "description": "Status 按成员状态过滤(可选):pending_verify/verified/banned。", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 按用户ID过滤(可选)。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 按用户名模糊查询(可选,支持包含匹配)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.AdminTenantUserItem" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/management/users/{userID}": { - "delete": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "移除租户成员(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true } ], "responses": { @@ -3357,8 +1942,9 @@ const docTemplate = `{ } } }, - "/t/{tenantCode}/v1/management/users/{userID}/join": { - "post": { + "/t/{tenantCode}/v1/me": { + "get": { + "description": "Get current user profile", "consumes": [ "application/json" ], @@ -3366,38 +1952,20 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" - ], - "summary": "添加租户成员(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true - } + "UserCenter" ], + "summary": "Get user profile", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.User" } } } - } - }, - "/t/{tenantCode}/v1/management/users/{userID}/role": { - "patch": { + }, + "put": { + "description": "Update user profile", "consumes": [ "application/json" ], @@ -3405,47 +1973,33 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "UserCenter" ], - "summary": "设置成员角色(租户管理)", + "summary": "Update user profile", "parameters": [ { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true - }, - { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.AdminTenantUserRoleUpdateForm" + "$ref": "#/definitions/dto.UserUpdate" } } ], "responses": { "200": { - "description": "OK", + "description": "Updated", "schema": { - "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/me": { + "/t/{tenantCode}/v1/me/coupons": { "get": { + "description": "List my coupons", "consumes": [ "application/json" ], @@ -3453,202 +2007,13 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "UserCenter" ], - "summary": "当前租户上下文信息", + "summary": "List coupons", "parameters": [ { "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_tenant_dto.MeResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/me/balance": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "当前租户余额信息", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.MeBalanceResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/me/ledgers": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "当前租户余额流水(分页)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.MyLedgerItem" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/media/play": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TenantMedia" - ], - "summary": "媒体播放入口(短时效 token)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Play token", - "name": "token", - "in": "query", - "required": true - } - ], - "responses": {} - } - }, - "/t/{tenantCode}/v1/orders": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "我的订单列表(当前租户)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "ContentID filters orders by purchased content id (via order_items join).", - "name": "content_id", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtFrom filters orders by paid_at \u003e= this time.", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtTo filters orders by paid_at \u003c= this time.", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "description": "Status filters orders by order status.", + "description": "Status (unused, used, expired)", "name": "status", "in": "query" } @@ -3657,26 +2022,18 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.Order" - } - } - } - ] + "type": "array", + "items": { + "$ref": "#/definitions/dto.UserCouponItem" + } } } } } }, - "/t/{tenantCode}/v1/orders/{orderID}": { + "/t/{tenantCode}/v1/me/favorites": { "get": { + "description": "Get favorites", "consumes": [ "application/json" ], @@ -3684,38 +2041,89 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Tenant" + "UserCenter" ], - "summary": "我的订单详情(当前租户)", + "summary": "Get favorites", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } + } + } + } + }, + "post": { + "description": "Add to favorites", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Add favorite", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "OrderID", - "name": "orderID", + "description": "Content ID", + "name": "contentId", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Added", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/favorites/{contentId}": { + "delete": { + "description": "Remove from favorites", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Remove favorite", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "contentId", "in": "path", "required": true } ], "responses": { "200": { - "description": "OK", + "description": "Removed", "schema": { - "$ref": "#/definitions/models.Order" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/public/contents": { + "/t/{tenantCode}/v1/me/following": { "get": { + "description": "Get following tenants", "consumes": [ "application/json" ], @@ -3723,32 +2131,161 @@ const docTemplate = `{ "application/json" ], "tags": [ - "TenantPublic" + "UserCenter" ], - "summary": "公开内容列表(已发布 + public)", + "summary": "Get following", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.TenantProfile" + } + } + } + } + } + }, + "/t/{tenantCode}/v1/me/library": { + "get": { + "description": "Get purchased content", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Get library", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } + } + } + } + } + }, + "/t/{tenantCode}/v1/me/likes": { + "get": { + "description": "Get liked contents", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Get likes", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } + } + } + } + }, + "post": { + "description": "Like content", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Like content", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "contentId", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Liked", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/likes/{contentId}": { + "delete": { + "description": "Unlike content", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Unlike content", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "contentId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Unliked", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/notifications": { + "get": { + "description": "Get notifications", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Get notifications", "parameters": [ { "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Keyword filters by title keyword (LIKE).", - "name": "keyword", + "description": "Type enum(all, system, order, audit, interaction)", + "name": "type", "in": "query" }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" } @@ -3765,7 +2302,10 @@ const docTemplate = `{ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.ContentItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.Notification" + } } } } @@ -3775,8 +2315,8 @@ const docTemplate = `{ } } }, - "/t/{tenantCode}/v1/public/contents/{contentID}": { - "get": { + "/t/{tenantCode}/v1/me/notifications/read-all": { + "post": { "consumes": [ "application/json" ], @@ -3784,22 +2324,37 @@ const docTemplate = `{ "application/json" ], "tags": [ - "TenantPublic" + "UserCenter" ], - "summary": "公开内容详情(已发布 + public)", + "summary": "Mark all as read", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/notifications/{id}/read": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Mark as read", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "ContentID", - "name": "contentID", + "description": "Notification ID", + "name": "id", "in": "path", "required": true } @@ -3808,14 +2363,15 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dto.ContentDetail" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/public/contents/{contentID}/assets": { + "/t/{tenantCode}/v1/me/orders": { "get": { + "description": "List user orders", "consumes": [ "application/json" ], @@ -3823,311 +2379,33 @@ const docTemplate = `{ "application/json" ], "tags": [ - "TenantPublic" + "UserCenter" ], - "summary": "获取公开正片资源(main role;免费/作者/已购)", + "summary": "List orders", "parameters": [ { "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true + "description": "Status enum(all, unpaid, completed, refund)", + "name": "status", + "in": "query" } ], "responses": { "200": { "description": "OK", - "schema": { - "$ref": "#/definitions/dto.ContentAssetsResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/public/contents/{contentID}/preview": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TenantPublic" - ], - "summary": "获取公开试看资源(preview role)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.ContentAssetsResponse" - } - } - } - } - }, - "/v1/auth/login": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "用户登录", - "parameters": [ - { - "description": "form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_web_dto.LoginForm" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_web_dto.LoginResponse" - } - } - } - } - }, - "/v1/auth/password/reset": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "找回密码-重置密码", - "parameters": [ - { - "description": "form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasswordResetForm" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/dto.PasswordResetResponse" - } - } - } - } - }, - "/v1/auth/password/reset/sms": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "找回密码-发送短信验证码", - "parameters": [ - { - "description": "form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasswordResetSendSMSForm" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/dto.PasswordResetSendSMSResponse" - } - } - } - } - }, - "/v1/auth/password/reset/verify": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "找回密码-校验验证码", - "parameters": [ - { - "description": "form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasswordResetVerifyForm" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/dto.PasswordResetVerifyResponse" - } - } - } - } - }, - "/v1/auth/register": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "用户注册", - "parameters": [ - { - "description": "form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.RegisterForm" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_web_dto.LoginResponse" - } - } - } - } - }, - "/v1/auth/token": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "刷新 Token", - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_web_dto.LoginResponse" - } - } - } - } - }, - "/v1/me": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "当前用户信息", - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_web_dto.MeResponse" - } - } - } - } - }, - "/v1/me/tenants": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "我的租户列表", - "responses": { - "200": { - "description": "成功", "schema": { "type": "array", "items": { - "$ref": "#/definitions/dto.MyTenantItem" + "$ref": "#/definitions/dto.Order" } } } } } }, - "/v1/tenant/application": { + "/t/{tenantCode}/v1/me/orders/{id}": { "get": { + "description": "Get user order detail", "consumes": [ "application/json" ], @@ -4135,21 +2413,32 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Web" + "UserCenter" + ], + "summary": "Get order detail", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Order ID", + "name": "id", + "in": "path", + "required": true + } ], - "summary": "获取租户申请信息(申请创作者)", "responses": { "200": { - "description": "成功", + "description": "OK", "schema": { - "$ref": "#/definitions/dto.TenantApplicationResponse" + "$ref": "#/definitions/dto.Order" } } } } }, - "/v1/tenant/apply": { + "/t/{tenantCode}/v1/me/realname": { "post": { + "description": "Submit real-name authentication", "consumes": [ "application/json" ], @@ -4157,25 +2446,724 @@ const docTemplate = `{ "application/json" ], "tags": [ - "Web" + "UserCenter" ], - "summary": "提交租户申请(申请创作者)", + "summary": "Realname auth", "parameters": [ { - "description": "form", + "description": "Realname form", "name": "form", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.TenantApplyForm" + "$ref": "#/definitions/dto.RealNameForm" } } ], "responses": { "200": { - "description": "成功", + "description": "Submitted", "schema": { - "$ref": "#/definitions/dto.TenantApplicationResponse" + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/wallet": { + "get": { + "description": "Get wallet balance and transactions", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Get wallet", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.WalletResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/wallet/recharge": { + "post": { + "description": "Recharge wallet", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Recharge wallet", + "parameters": [ + { + "description": "Recharge form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RechargeForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.RechargeResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/media-assets/{id}": { + "delete": { + "description": "Delete media asset", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Delete media asset", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Asset ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/orders": { + "post": { + "description": "Create Order", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Transaction" + ], + "summary": "Create Order", + "parameters": [ + { + "description": "Create form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.OrderCreateForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.OrderCreateResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/orders/{id}/pay": { + "post": { + "description": "Pay for order", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Transaction" + ], + "summary": "Pay for order", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Order ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Pay form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.OrderPayForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.OrderPayResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/orders/{id}/status": { + "get": { + "description": "Check order payment status", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Transaction" + ], + "summary": "Check order status", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Order ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.OrderStatusResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/storage/{any}": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/octet-stream" + ], + "tags": [ + "Storage" + ], + "summary": "Download file", + "parameters": [ + { + "type": "string", + "description": "any path", + "name": "any", + "in": "path" + }, + { + "type": "string", + "description": "Expiry", + "name": "expires", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "Signature", + "name": "sign", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "file" + } + } + } + }, + "put": { + "consumes": [ + "application/octet-stream" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Storage" + ], + "summary": "Upload file", + "parameters": [ + { + "type": "string", + "description": "any path", + "name": "any", + "in": "path" + }, + { + "type": "string", + "description": "Expiry", + "name": "expires", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "Signature", + "name": "sign", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/tenants": { + "get": { + "description": "Search tenants", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TenantPublic" + ], + "summary": "List tenants", + "parameters": [ + { + "type": "string", + "description": "Keyword", + "name": "keyword", + "in": "query" + }, + { + "type": "integer", + "description": "Page", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "Limit", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/requests.Pager" + } + } + } + } + }, + "/t/{tenantCode}/v1/tenants/{id}": { + "get": { + "description": "Get tenant public profile", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TenantPublic" + ], + "summary": "Get tenant profile", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Tenant ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.TenantProfile" + } + } + } + } + }, + "/t/{tenantCode}/v1/tenants/{id}/follow": { + "post": { + "description": "Follow a tenant", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TenantPublic" + ], + "summary": "Follow tenant", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Tenant ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Followed", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "description": "Unfollow a tenant", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TenantPublic" + ], + "summary": "Unfollow tenant", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Tenant ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Unfollowed", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/topics": { + "get": { + "description": "List curated topics", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Content" + ], + "summary": "List topics", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.Topic" + } + } + } + } + } + }, + "/t/{tenantCode}/v1/upload": { + "post": { + "description": "Upload file", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Upload file", + "parameters": [ + { + "type": "file", + "description": "File", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "Type 上传资源类型(如 cover/media/avatar)。", + "name": "type", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.UploadResult" + } + } + } + } + }, + "/t/{tenantCode}/v1/upload/check": { + "get": { + "description": "Check if file hash exists", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Check hash", + "parameters": [ + { + "type": "string", + "description": "File MD5 Hash", + "name": "hash", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.UploadResult" + } + } + } + } + }, + "/t/{tenantCode}/v1/upload/complete": { + "post": { + "description": "Complete multipart upload", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Complete upload", + "parameters": [ + { + "description": "Complete form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.UploadCompleteForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.UploadResult" + } + } + } + } + }, + "/t/{tenantCode}/v1/upload/init": { + "post": { + "description": "Initialize multipart upload", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Init multipart upload", + "parameters": [ + { + "description": "Init form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.UploadInitForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.UploadInitResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/upload/part": { + "post": { + "description": "Upload a part", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Upload part", + "parameters": [ + { + "type": "file", + "description": "Part File", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "integer", + "description": "PartNumber 分片序号(从 1 开始)。", + "name": "part_number", + "in": "formData" + }, + { + "type": "string", + "description": "UploadID 分片上传ID。", + "name": "upload_id", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/upload/{uploadId}": { + "delete": { + "description": "Abort multipart upload", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Abort upload", + "parameters": [ + { + "type": "string", + "description": "Upload ID", + "name": "uploadId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/webhook/payment/notify": { + "post": { + "description": "Payment Webhook", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Transaction" + ], + "summary": "Payment Webhook", + "parameters": [ + { + "description": "Webhook Data", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.WebhookForm" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" } } } @@ -4183,32 +3171,6 @@ const docTemplate = `{ } }, "definitions": { - "consts.ContentAccessStatus": { - "type": "string", - "enum": [ - "active", - "revoked", - "expired" - ], - "x-enum-varnames": [ - "ContentAccessStatusActive", - "ContentAccessStatusRevoked", - "ContentAccessStatusExpired" - ] - }, - "consts.ContentAssetRole": { - "type": "string", - "enum": [ - "main", - "cover", - "preview" - ], - "x-enum-varnames": [ - "ContentAssetRoleMain", - "ContentAssetRoleCover", - "ContentAssetRolePreview" - ] - }, "consts.ContentStatus": { "type": "string", "enum": [ @@ -4226,19 +3188,6 @@ const docTemplate = `{ "ContentStatusBlocked" ] }, - "consts.ContentVisibility": { - "type": "string", - "enum": [ - "public", - "tenant_only", - "private" - ], - "x-enum-varnames": [ - "ContentVisibilityPublic", - "ContentVisibilityTenantOnly", - "ContentVisibilityPrivate" - ] - }, "consts.Currency": { "type": "string", "enum": [ @@ -4248,58 +3197,17 @@ const docTemplate = `{ "CurrencyCNY" ] }, - "consts.DiscountType": { + "consts.Gender": { "type": "string", "enum": [ - "none", - "percent", - "amount" + "male", + "female", + "secret" ], "x-enum-varnames": [ - "DiscountTypeNone", - "DiscountTypePercent", - "DiscountTypeAmount" - ] - }, - "consts.MediaAssetStatus": { - "type": "string", - "enum": [ - "uploaded", - "processing", - "ready", - "failed", - "deleted" - ], - "x-enum-varnames": [ - "MediaAssetStatusUploaded", - "MediaAssetStatusProcessing", - "MediaAssetStatusReady", - "MediaAssetStatusFailed", - "MediaAssetStatusDeleted" - ] - }, - "consts.MediaAssetType": { - "type": "string", - "enum": [ - "video", - "audio", - "image" - ], - "x-enum-varnames": [ - "MediaAssetTypeVideo", - "MediaAssetTypeAudio", - "MediaAssetTypeImage" - ] - }, - "consts.MediaAssetVariant": { - "type": "string", - "enum": [ - "main", - "preview" - ], - "x-enum-varnames": [ - "MediaAssetVariantMain", - "MediaAssetVariantPreview" + "GenderMale", + "GenderFemale", + "GenderSecret" ] }, "consts.OrderStatus": { @@ -4324,64 +3232,27 @@ const docTemplate = `{ "consts.OrderType": { "type": "string", "enum": [ - "content_purchase" + "content_purchase", + "recharge", + "withdrawal" ], "x-enum-varnames": [ - "OrderTypeContentPurchase" + "OrderTypeContentPurchase", + "OrderTypeRecharge", + "OrderTypeWithdrawal" ] }, "consts.Role": { "type": "string", "enum": [ "user", - "super_admin" + "super_admin", + "creator" ], "x-enum-varnames": [ "RoleUser", - "RoleSuperAdmin" - ] - }, - "consts.TenantInviteStatus": { - "type": "string", - "enum": [ - "active", - "disabled", - "expired" - ], - "x-enum-varnames": [ - "TenantInviteStatusActive", - "TenantInviteStatusDisabled", - "TenantInviteStatusExpired" - ] - }, - "consts.TenantJoinRequestStatus": { - "type": "string", - "enum": [ - "pending", - "approved", - "rejected" - ], - "x-enum-varnames": [ - "TenantJoinRequestStatusPending", - "TenantJoinRequestStatusApproved", - "TenantJoinRequestStatusRejected" - ] - }, - "consts.TenantLedgerType": { - "type": "string", - "enum": [ - "debit_purchase", - "credit_refund", - "freeze", - "unfreeze", - "adjustment" - ], - "x-enum-varnames": [ - "TenantLedgerTypeDebitPurchase", - "TenantLedgerTypeCreditRefund", - "TenantLedgerTypeFreeze", - "TenantLedgerTypeUnfreeze", - "TenantLedgerTypeAdjustment" + "RoleSuperAdmin", + "RoleCreator" ] }, "consts.TenantStatus": { @@ -4411,11 +3282,15 @@ const docTemplate = `{ "consts.UserStatus": { "type": "string", "enum": [ + "active", + "inactive", "pending_verify", "verified", "banned" ], "x-enum-varnames": [ + "UserStatusActive", + "UserStatusInactive", "UserStatusPendingVerify", "UserStatusVerified", "UserStatusBanned" @@ -4425,17 +3300,25 @@ const docTemplate = `{ "type": "object", "properties": { "content": { - "$ref": "#/definitions/models.Content" + "$ref": "#/definitions/dto.ContentItem" }, "owner": { "$ref": "#/definitions/dto.AdminContentOwnerLite" }, "price": { - "$ref": "#/definitions/models.ContentPrice" + "$ref": "#/definitions/dto.ContentPrice" }, "status_description": { "type": "string" }, + "tenant": { + "description": "Tenant 内容所属租户信息,用于超管列表展示与跳转。", + "allOf": [ + { + "$ref": "#/definitions/dto.SuperContentTenantLite" + } + ] + }, "visibility_description": { "type": "string" } @@ -4461,290 +3344,106 @@ const docTemplate = `{ } } }, - "dto.AdminLedgerItem": { + "dto.ApplyForm": { "type": "object", "properties": { - "ledger": { - "description": "Ledger 流水记录(租户内隔离)。", - "allOf": [ - { - "$ref": "#/definitions/models.TenantLedger" - } - ] + "avatar": { + "description": "Avatar 头像URL。", + "type": "string" }, - "type_description": { - "description": "TypeDescription 流水类型中文说明(用于前端展示)。", + "bio": { + "description": "Bio 频道简介。", + "type": "string" + }, + "name": { + "description": "Name 频道/创作者名称。", "type": "string" } } }, - "dto.AdminMediaAssetUploadCompleteForm": { + "dto.AssetDTO": { "type": "object", "properties": { - "content_type": { - "description": "ContentType is the MIME type observed during upload; optional.\nServer may record it for audit and later processing decisions.", - "type": "string" - }, - "etag": { - "description": "ETag is the storage returned ETag (or similar checksum); optional.\nUsed for audit/debugging and later integrity verification.", - "type": "string" - }, - "file_size": { - "description": "FileSize is the uploaded object size in bytes; optional.\nServer records it for quota/audit and later validation.", + "id": { + "description": "ID 资源ID。", "type": "integer" }, - "sha256": { - "description": "SHA256 is the hex-encoded sha256 of the uploaded object; optional.\nServer records it for integrity checks/deduplication.", - "type": "string" - } - } - }, - "dto.AdminMediaAssetUploadInitForm": { - "type": "object", - "properties": { - "content_type": { - "description": "ContentType is the MIME type reported by the client (e.g. video/mp4); optional.\nServer should not fully trust it, but can use it as a hint for validation/logging.", + "name": { + "description": "Name 文件名。", "type": "string" }, - "file_size": { - "description": "FileSize is the expected file size in bytes; optional.\nUsed for quota/limit checks and audit; client may omit when unknown.", - "type": "integer" - }, - "sha256": { - "description": "SHA256 is the hex-encoded sha256 of the file; optional.\nUsed for deduplication/audit; server may validate it later during upload-complete.", + "role": { + "description": "Role 资源角色(cover/media/preview)。", "type": "string" }, - "source_asset_id": { - "description": "SourceAssetID links a preview product to its main asset; only meaningful when variant=preview.", + "size": { + "description": "Size 文件大小描述。", + "type": "string" + }, + "sort": { + "description": "Sort 排序权重。", "type": "integer" }, "type": { - "description": "Type is the media asset type (video/audio/image).\nUsed to decide processing pipeline and validation rules; required.", + "description": "Type 资源类型(image/audio/video)。", "type": "string" }, - "variant": { - "description": "Variant indicates whether this asset is a main or preview product.\nAllowed: main/preview; default is main.", - "allOf": [ - { - "$ref": "#/definitions/consts.MediaAssetVariant" - } - ] + "url": { + "description": "URL 资源访问地址。", + "type": "string" } } }, - "dto.AdminMediaAssetUploadInitResponse": { + "dto.Comment": { "type": "object", "properties": { - "asset_id": { - "description": "AssetID is the created media asset id.", + "content": { + "description": "Content 评论内容。", + "type": "string" + }, + "create_time": { + "description": "CreateTime 评论创建时间(RFC3339)。", + "type": "string" + }, + "id": { + "description": "ID 评论ID。", "type": "integer" }, - "bucket": { - "description": "Bucket is the target bucket/container; for debugging/audit (may be empty in stub mode).", - "type": "string" - }, - "expires_at": { - "description": "ExpiresAt indicates when UploadURL/FormFields expire; optional.", - "type": "string" - }, - "form_fields": { - "description": "FormFields are form fields required for multipart form upload (S3 POST policy); optional.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "headers": { - "description": "Headers are additional headers required for upload (e.g. signed headers); optional.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "object_key": { - "description": "ObjectKey is the server-generated object key/path; client must NOT choose it.", - "type": "string" - }, - "provider": { - "description": "Provider is the storage provider identifier (e.g. s3/minio/oss/local); for debugging/audit.", - "type": "string" - }, - "upload_url": { - "description": "UploadURL is the URL the client should upload to (signed URL or service endpoint).", - "type": "string" - } - } - }, - "dto.AdminOrderDetail": { - "type": "object", - "properties": { - "order": { - "description": "Order is the order with items preloaded.", - "allOf": [ - { - "$ref": "#/definitions/models.Order" - } - ] - } - } - }, - "dto.AdminOrderExportResponse": { - "type": "object", - "properties": { - "content_type": { - "description": "ContentType 内容类型:当前固定为 text/csv。", - "type": "string" - }, - "csv": { - "description": "CSV CSV 文本内容:UTF-8 编码,包含表头与数据行;前端可直接下载为文件。", - "type": "string" - }, - "filename": { - "description": "Filename 建议文件名:前端可用于下载时的默认文件名。", - "type": "string" - } - } - }, - "dto.AdminOrderRefundForm": { - "type": "object", - "properties": { - "force": { - "description": "Force indicates bypassing the default refund window check (paid_at + 24h).\n强制退款:true 表示绕过默认退款时间窗限制(需审计)。", + "is_liked": { + "description": "IsLiked 当前用户是否点赞该评论。", "type": "boolean" }, - "idempotency_key": { - "description": "IdempotencyKey ensures refund request is processed at most once.\n幂等键:同一笔退款重复请求时返回一致结果,避免重复退款/重复回滚。", - "type": "string" - }, - "reason": { - "description": "Reason is the human-readable refund reason used for audit.\n退款原因:建议必填(由业务侧校验);用于审计与追责。", - "type": "string" - } - } - }, - "dto.AdminTenantInviteCreateForm": { - "type": "object", - "properties": { - "code": { - "description": "Code 邀请码(可选):为空时由后端生成;建议只包含数字/字母,便于人工输入。", - "type": "string" - }, - "expires_at": { - "description": "ExpiresAt 过期时间(可选):为空表示不过期;到期后不可再使用。", - "type": "string" - }, - "max_uses": { - "description": "MaxUses 最大可使用次数(可选):0 表示不限次数;大于 0 时用尽后自动失效。", + "likes": { + "description": "Likes 评论点赞数。", "type": "integer" }, - "remark": { - "description": "Remark 备注(可选):用于审计记录生成目的/投放渠道等。", - "type": "string" - } - } - }, - "dto.AdminTenantInviteDisableForm": { - "type": "object", - "properties": { - "reason": { - "description": "Reason 禁用原因(可选):用于审计与追溯。", - "type": "string" - } - } - }, - "dto.AdminTenantJoinRequestDecideForm": { - "type": "object", - "properties": { - "reason": { - "description": "Reason 审核说明(可选):用于审计记录通过/拒绝原因。", - "type": "string" - } - } - }, - "dto.AdminTenantUserItem": { - "type": "object", - "properties": { - "tenant_user": { - "description": "TenantUser 租户成员关系记录。", - "allOf": [ - { - "$ref": "#/definitions/models.TenantUser" - } - ] - }, - "user": { - "description": "User 用户基础信息(用于展示 username 等)。", - "allOf": [ - { - "$ref": "#/definitions/models.User" - } - ] - } - } - }, - "dto.AdminTenantUserJoinResponse": { - "type": "object", - "properties": { - "tenant_user": { - "description": "TenantUser 租户成员关系记录。", - "allOf": [ - { - "$ref": "#/definitions/models.TenantUser" - } - ] - } - } - }, - "dto.AdminTenantUserRoleUpdateForm": { - "type": "object", - "properties": { - "role": { - "description": "Role 角色:member/tenant_admin。", - "type": "string" - } - } - }, - "dto.ContentAssetAttachForm": { - "type": "object", - "properties": { - "asset_id": { - "description": "AssetID is the media asset id to attach.", + "reply_to": { + "description": "ReplyTo 回复的评论ID(0 表示一级评论)。", "type": "integer" }, - "role": { - "description": "Role indicates how this asset is used (main/cover/preview).", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentAssetRole" - } - ] + "user_avatar": { + "description": "UserAvatar 评论用户头像。", + "type": "string" }, - "sort": { - "description": "Sort controls ordering under the same role.", + "user_id": { + "description": "UserID 评论用户ID。", "type": "integer" + }, + "user_nickname": { + "description": "UserNickname 评论用户昵称。", + "type": "string" } } }, - "dto.ContentAssetsResponse": { + "dto.CommentCreateForm": { "type": "object", "properties": { - "assets": { - "description": "Assets is the list of playable assets for the requested role (preview/main).", - "type": "array", - "items": { - "$ref": "#/definitions/dto.ContentPlayableAsset" - } - }, "content": { - "description": "Content is the content entity.", - "allOf": [ - { - "$ref": "#/definitions/models.Content" - } - ] + "description": "Content 评论正文,不能为空。", + "type": "string" }, - "preview_seconds": { - "description": "PreviewSeconds indicates the max preview duration (only meaningful for preview response).", + "reply_to": { + "description": "ReplyTo 被回复评论ID(0 表示一级评论)。", "type": "integer" } } @@ -4752,400 +3451,564 @@ const docTemplate = `{ "dto.ContentCreateForm": { "type": "object", "properties": { - "description": { - "description": "Description is the content description.", + "cover_ids": { + "description": "CoverIDs 封面资源ID集合。", + "type": "array", + "items": { + "type": "integer" + } + }, + "genre": { + "description": "Genre 内容分类/风格。", "type": "string" }, - "preview_seconds": { - "description": "PreviewSeconds controls preview duration (defaults to 60 when omitted).", - "type": "integer" + "key": { + "description": "Key 音乐调性或主音。", + "type": "string" + }, + "media_ids": { + "description": "MediaIDs 媒体资源ID集合(音频/视频/图片)。", + "type": "array", + "items": { + "type": "integer" + } + }, + "price": { + "description": "Price 价格(单位元)。", + "type": "number" + }, + "status": { + "description": "Status 内容状态(draft/published)。", + "type": "string" }, "title": { - "description": "Title is the content title.", + "description": "Title 内容标题。", "type": "string" - }, - "visibility": { - "description": "Visibility controls who can view the content detail (main assets still require free/purchase).", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentVisibility" - } - ] } } }, "dto.ContentDetail": { "type": "object", "properties": { - "content": { - "description": "Content is the content entity.", - "allOf": [ - { - "$ref": "#/definitions/models.Content" - } - ] + "author_avatar": { + "description": "AuthorAvatar 作者头像URL。", + "type": "string" }, - "has_access": { - "description": "HasAccess indicates whether current user can access main assets (free/owner/purchased).", + "author_id": { + "description": "AuthorID 作者用户ID。", + "type": "integer" + }, + "author_is_following": { + "description": "AuthorIsFollowing 当前用户是否关注作者(未登录默认 false)。", "type": "boolean" }, - "price": { - "description": "Price is the current price settings for the content (may be nil if not set).", + "author_name": { + "description": "AuthorName 作者展示名(优先昵称)。", + "type": "string" + }, + "body": { + "description": "Body 详细正文/图文内容(文章类可为空)。", + "type": "string" + }, + "cover": { + "description": "Cover 封面URL(无封面时为空)。", + "type": "string" + }, + "created_at": { + "description": "CreatedAt 创建时间(RFC3339 格式)。", + "type": "string" + }, + "description": { + "description": "Description 内容描述(用于详情页摘要)。", + "type": "string" + }, + "genre": { + "description": "Genre 内容分类/风格标签。", + "type": "string" + }, + "id": { + "description": "ID 内容唯一ID。", + "type": "integer" + }, + "is_favorited": { + "description": "IsFavorited 当前用户是否收藏。", + "type": "boolean" + }, + "is_liked": { + "description": "IsLiked 当前用户是否点赞。", + "type": "boolean" + }, + "is_purchased": { + "description": "IsPurchased 是否已购买(用于内容列表快速判断)。", + "type": "boolean" + }, + "likes": { + "description": "Likes 点赞数统计。", + "type": "integer" + }, + "media_urls": { + "description": "MediaUrls 关联媒体资源(音频/视频/预览)。", + "type": "array", + "items": { + "$ref": "#/definitions/dto.MediaURL" + } + }, + "meta": { + "description": "Meta 内容元信息(曲风/调性/节拍等)。", "allOf": [ { - "$ref": "#/definitions/models.ContentPrice" + "$ref": "#/definitions/dto.Meta" } ] + }, + "price": { + "description": "Price 价格(单位元,免费为 0)。", + "type": "number" + }, + "published_at": { + "description": "PublishedAt 发布时间,未发布为空。", + "type": "string" + }, + "status": { + "description": "Status 内容状态(如 published/unpublished)。", + "type": "string" + }, + "tenant_id": { + "description": "TenantID 内容所属租户ID。", + "type": "integer" + }, + "title": { + "description": "Title 内容标题。", + "type": "string" + }, + "type": { + "description": "Type 内容媒体类型(video/audio/article)。", + "type": "string" + }, + "user_id": { + "description": "UserID 内容作者用户ID(与 author_id 同义,便于后台展示)。", + "type": "integer" + }, + "views": { + "description": "Views 浏览量统计。", + "type": "integer" + }, + "visibility": { + "description": "Visibility 内容可见性(如 public/tenant_only/private)。", + "type": "string" + } + } + }, + "dto.ContentEditDTO": { + "type": "object", + "properties": { + "assets": { + "description": "Assets 资源列表(封面/媒体)。", + "type": "array", + "items": { + "$ref": "#/definitions/dto.AssetDTO" + } + }, + "description": { + "description": "Description 内容简介。", + "type": "string" + }, + "enable_trial": { + "description": "EnableTrial 是否开启试读/试听。", + "type": "boolean" + }, + "genre": { + "description": "Genre 内容分类。", + "type": "string" + }, + "id": { + "description": "ID 内容ID。", + "type": "integer" + }, + "key": { + "description": "Key 音乐调性或主音。", + "type": "string" + }, + "preview_seconds": { + "description": "PreviewSeconds 试看/试听秒数。", + "type": "integer" + }, + "price": { + "description": "Price 价格(单位元)。", + "type": "number" + }, + "status": { + "description": "Status 内容状态。", + "type": "string" + }, + "title": { + "description": "Title 内容标题。", + "type": "string" } } }, "dto.ContentItem": { "type": "object", "properties": { - "content": { - "description": "Content is the content entity.", - "allOf": [ - { - "$ref": "#/definitions/models.Content" - } - ] - }, - "has_access": { - "description": "HasAccess indicates whether current user can access main assets (free/owner/purchased).", - "type": "boolean" - }, - "price": { - "description": "Price is the current price settings for the content (may be nil if not set).", - "allOf": [ - { - "$ref": "#/definitions/models.ContentPrice" - } - ] - } - } - }, - "dto.ContentPlayableAsset": { - "type": "object", - "properties": { - "asset_id": { - "type": "integer" - }, - "expires_at": { - "description": "ExpiresAt indicates when PlayURL/token expires; optional.", + "author_avatar": { + "description": "AuthorAvatar 作者头像URL。", "type": "string" }, - "meta": { - "description": "Meta is a display-safe whitelist (currently passthrough JSON); optional.", - "type": "array", - "items": { - "type": "integer" - } + "author_id": { + "description": "AuthorID 作者用户ID。", + "type": "integer" }, - "play_url": { - "description": "PlayURL is a short-lived URL; do NOT expose bucket/object_key directly.", + "author_is_following": { + "description": "AuthorIsFollowing 当前用户是否关注作者(未登录默认 false)。", + "type": "boolean" + }, + "author_name": { + "description": "AuthorName 作者展示名(优先昵称)。", + "type": "string" + }, + "cover": { + "description": "Cover 封面URL(无封面时为空)。", + "type": "string" + }, + "created_at": { + "description": "CreatedAt 创建时间(RFC3339 格式)。", + "type": "string" + }, + "genre": { + "description": "Genre 内容分类/风格标签。", + "type": "string" + }, + "id": { + "description": "ID 内容唯一ID。", + "type": "integer" + }, + "is_purchased": { + "description": "IsPurchased 是否已购买(用于内容列表快速判断)。", + "type": "boolean" + }, + "likes": { + "description": "Likes 点赞数统计。", + "type": "integer" + }, + "price": { + "description": "Price 价格(单位元,免费为 0)。", + "type": "number" + }, + "published_at": { + "description": "PublishedAt 发布时间,未发布为空。", + "type": "string" + }, + "status": { + "description": "Status 内容状态(如 published/unpublished)。", + "type": "string" + }, + "tenant_id": { + "description": "TenantID 内容所属租户ID。", + "type": "integer" + }, + "title": { + "description": "Title 内容标题。", "type": "string" }, "type": { - "$ref": "#/definitions/consts.MediaAssetType" + "description": "Type 内容媒体类型(video/audio/article)。", + "type": "string" + }, + "user_id": { + "description": "UserID 内容作者用户ID(与 author_id 同义,便于后台展示)。", + "type": "integer" + }, + "views": { + "description": "Views 浏览量统计。", + "type": "integer" + }, + "visibility": { + "description": "Visibility 内容可见性(如 public/tenant_only/private)。", + "type": "string" } } }, - "dto.ContentPriceUpsertForm": { + "dto.ContentPrice": { "type": "object", "properties": { "currency": { - "description": "Currency is fixed to CNY for now.", - "allOf": [ - { - "$ref": "#/definitions/consts.Currency" - } - ] + "description": "Currency 币种(CNY 等)。", + "type": "string" }, "discount_end_at": { - "description": "DiscountEndAt disables discount after this time (optional).", + "description": "DiscountEndAt 折扣结束时间(RFC3339)。", "type": "string" }, "discount_start_at": { - "description": "DiscountStartAt enables discount from this time (optional).", + "description": "DiscountStartAt 折扣开始时间(RFC3339)。", "type": "string" }, "discount_type": { - "description": "DiscountType defines the discount algorithm (none/percent/amount).", - "allOf": [ - { - "$ref": "#/definitions/consts.DiscountType" - } - ] + "description": "DiscountType 折扣类型(amount/percent)。", + "type": "string" }, "discount_value": { - "description": "DiscountValue is interpreted based on DiscountType.", - "type": "integer" + "description": "DiscountValue 折扣值(amount=元,percent=百分比)。", + "type": "number" }, "price_amount": { - "description": "PriceAmount is the base price in cents (CNY 分).", - "type": "integer" - } - } - }, - "dto.ContentPublishForm": { - "type": "object", - "properties": { - "audio_asset_ids": { - "description": "AudioAssetIDs 音频资源 ID 列表:可为空;每个资源必须为 audio/main/ready。", - "type": "array", - "items": { - "type": "integer" - } - }, - "cover_asset_ids": { - "description": "CoverAssetIDs 展示图(封面图)资源 ID 列表:1-3 张;每个资源必须为 image/main/ready。", - "type": "array", - "items": { - "type": "integer" - } - }, - "currency": { - "description": "Currency 币种:当前固定为 CNY;可不传(后端默认 CNY)。", - "allOf": [ - { - "$ref": "#/definitions/consts.Currency" - } - ] - }, - "detail": { - "description": "Detail 详细:用于详情页的长文本;可选;当非空时视为“文字内容”类型存在。", - "type": "string" - }, - "image_asset_ids": { - "description": "ImageAssetIDs 多图内容资源 ID 列表:可为空;每个资源必须为 image/main/ready;数量 \u003e= 2 时视为“多图内容”类型存在。", - "type": "array", - "items": { - "type": "integer" - } - }, - "preview_seconds": { - "description": "PreviewSeconds 试看秒数:仅对 preview 资源生效;默认 60;必须为正整数。", - "type": "integer" - }, - "price_amount": { - "description": "PriceAmount 价格:单位为分;0 表示免费;必填(前端可默认填 0)。", - "type": "integer" - }, - "summary": { - "description": "Summary 简介:用于列表/卡片展示的短文本;可选,建议 \u003c= 256 字符。", - "type": "string" - }, - "tags": { - "description": "Tags 标签:用于分类/检索;字符串数组;会做 trim/去重;可为空。", - "type": "array", - "items": { - "type": "string" - } - }, - "title": { - "description": "Title 标题:用于列表展示与搜索;必填。", - "type": "string" - }, - "video_asset_ids": { - "description": "VideoAssetIDs 视频资源 ID 列表:可为空;每个资源必须为 video/main/ready。", - "type": "array", - "items": { - "type": "integer" - } - }, - "visibility": { - "description": "Visibility 可见性:控制“详情页”可见范围;默认 tenant_only。", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentVisibility" - } - ] - } - } - }, - "dto.ContentPublishResponse": { - "type": "object", - "properties": { - "content": { - "description": "Content 内容主体(包含标题/简介/详细/状态等)。", - "allOf": [ - { - "$ref": "#/definitions/models.Content" - } - ] - }, - "content_types": { - "description": "ContentTypes 内容类型列表:text/audio/video/image/multi_image(用于前端展示)。", - "type": "array", - "items": { - "type": "string" - } - }, - "cover_assets": { - "description": "CoverAssets 封面图绑定结果(role=cover)。", - "type": "array", - "items": { - "$ref": "#/definitions/models.ContentAsset" - } - }, - "main_assets": { - "description": "MainAssets 主资源绑定结果(role=main;可能包含音频/视频/图片)。", - "type": "array", - "items": { - "$ref": "#/definitions/models.ContentAsset" - } - }, - "price": { - "description": "Price 定价信息(单位分)。", - "allOf": [ - { - "$ref": "#/definitions/models.ContentPrice" - } - ] + "description": "PriceAmount 原价金额(单位元)。", + "type": "number" } } }, "dto.ContentUpdateForm": { "type": "object", "properties": { - "description": { - "description": "Description updates the description when provided.", + "cover_ids": { + "description": "CoverIDs 封面资源ID集合。", + "type": "array", + "items": { + "type": "integer" + } + }, + "genre": { + "description": "Genre 内容分类/风格。", "type": "string" }, - "preview_seconds": { - "description": "PreviewSeconds updates preview duration when provided (must be \u003e 0).", + "is_pinned": { + "description": "IsPinned 是否置顶。", + "type": "boolean" + }, + "key": { + "description": "Key 音乐调性或主音。", + "type": "string" + }, + "media_ids": { + "description": "MediaIDs 媒体资源ID集合。", + "type": "array", + "items": { + "type": "integer" + } + }, + "price": { + "description": "Price 价格(单位元,nil 表示不修改)。", + "type": "number" + }, + "status": { + "description": "Status 内容状态(draft/published)。", + "type": "string" + }, + "title": { + "description": "Title 内容标题(为空表示不修改)。", + "type": "string" + } + } + }, + "dto.DashboardStats": { + "type": "object", + "properties": { + "new_messages": { + "description": "NewMessages 新消息数量。", + "type": "integer" + }, + "pending_refunds": { + "description": "PendingRefunds 待处理退款数量。", + "type": "integer" + }, + "total_followers": { + "description": "TotalFollowers 粉丝总数统计。", + "allOf": [ + { + "$ref": "#/definitions/dto.IntStatItem" + } + ] + }, + "total_revenue": { + "description": "TotalRevenue 累计收入统计(单位元)。", + "allOf": [ + { + "$ref": "#/definitions/dto.FloatStatItem" + } + ] + } + } + }, + "dto.FloatStatItem": { + "type": "object", + "properties": { + "trend": { + "description": "Trend 环比/同比变化比例。", + "type": "number" + }, + "value": { + "description": "Value 统计数值(浮点)。", + "type": "number" + } + } + }, + "dto.IntStatItem": { + "type": "object", + "properties": { + "trend": { + "description": "Trend 环比/同比变化比例。", + "type": "number" + }, + "value": { + "description": "Value 统计数值。", + "type": "integer" + } + } + }, + "dto.MediaURL": { + "type": "object", + "properties": { + "duration": { + "description": "Duration 媒体时长(秒),无时长则为 0。", + "type": "integer" + }, + "type": { + "description": "Type 媒体类型(audio/video/image/preview)。", + "type": "string" + }, + "url": { + "description": "URL 媒体资源地址。", + "type": "string" + } + } + }, + "dto.Meta": { + "type": "object", + "properties": { + "beat": { + "description": "Beat 节拍信息(如 4/4)。", + "type": "string" + }, + "key": { + "description": "Key 音乐调性或主音。", + "type": "string" + }, + "role": { + "description": "Role 内容角色/定位(如 demo/主稿)。", + "type": "string" + } + } + }, + "dto.Notification": { + "type": "object", + "properties": { + "content": { + "description": "Content 通知内容。", + "type": "string" + }, + "id": { + "description": "ID 通知ID。", + "type": "integer" + }, + "read": { + "description": "Read 是否已读。", + "type": "boolean" + }, + "time": { + "description": "Time 发送时间(RFC3339)。", + "type": "string" + }, + "title": { + "description": "Title 通知标题。", + "type": "string" + }, + "type": { + "description": "Type 通知类型(system/order/interaction)。", + "type": "string" + } + } + }, + "dto.OptionsResponse": { + "type": "object", + "properties": { + "content_genre": { + "description": "ContentGenre 内容类型/分类选项。", + "type": "array", + "items": { + "$ref": "#/definitions/requests.KV" + } + }, + "content_status": { + "description": "ContentStatus 内容状态选项。", + "type": "array", + "items": { + "$ref": "#/definitions/requests.KV" + } + } + } + }, + "dto.Order": { + "type": "object", + "properties": { + "amount": { + "description": "Amount 实付金额(单位元)。", + "type": "number" + }, + "buyer_avatar": { + "description": "BuyerAvatar 买家头像URL。", + "type": "string" + }, + "buyer_name": { + "description": "BuyerName 买家昵称。", + "type": "string" + }, + "cover": { + "description": "Cover 订单封面图。", + "type": "string" + }, + "create_time": { + "description": "CreateTime 创建时间(RFC3339)。", + "type": "string" + }, + "id": { + "description": "ID 订单ID。", + "type": "integer" + }, + "is_virtual": { + "description": "IsVirtual 是否虚拟订单。", + "type": "boolean" + }, + "items": { + "description": "Items 订单内容明细。", + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } + }, + "pay_time": { + "description": "PayTime 支付时间(RFC3339)。", + "type": "string" + }, + "quantity": { + "description": "Quantity 内容数量。", "type": "integer" }, "status": { - "description": "Status updates the content status when provided (e.g. publish/unpublish).", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentStatus" - } - ] - }, - "title": { - "description": "Title updates the title when provided.", + "description": "Status 订单状态。", "type": "string" }, - "visibility": { - "description": "Visibility updates the visibility when provided.", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentVisibility" - } - ] - } - } - }, - "dto.JoinByInviteForm": { - "type": "object", - "properties": { - "invite_code": { - "description": "InviteCode 邀请码:由租户管理员生成;用户提交后加入对应租户。", - "type": "string" - } - } - }, - "dto.JoinRequestCreateForm": { - "type": "object", - "properties": { - "reason": { - "description": "Reason 申请原因(可选):用于向租户管理员说明申请加入的目的。", - "type": "string" - } - } - }, - "dto.MeBalanceResponse": { - "type": "object", - "properties": { - "balance": { - "description": "Balance 可用余额:可用于购买/消费。", - "type": "integer" - }, - "balance_frozen": { - "description": "BalanceFrozen 冻结余额:用于下单冻结/争议期等。", - "type": "integer" - }, - "currency": { - "description": "Currency 币种:当前固定 CNY(金额单位为分)。", - "allOf": [ - { - "$ref": "#/definitions/consts.Currency" - } - ] - }, - "updated_at": { - "description": "UpdatedAt 更新时间:余额变更时更新。", - "type": "string" - } - } - }, - "dto.MyLedgerItem": { - "type": "object", - "properties": { - "ledger": { - "description": "Ledger 流水记录(租户内隔离)。", - "allOf": [ - { - "$ref": "#/definitions/models.TenantLedger" - } - ] - }, - "type_description": { - "description": "TypeDescription 流水类型中文说明(用于前端展示)。", - "type": "string" - } - } - }, - "dto.MyTenantItem": { - "type": "object", - "properties": { - "is_owner": { - "description": "IsOwner 是否为租户Owner(tenants.user_id == 当前用户)。\n说明:Owner 通常也在 tenant_users 里具备 tenant_admin 角色,但此字段更直观。", - "type": "boolean" - }, - "joined_at": { - "description": "JoinedAt 加入租户时间(tenant_users.created_at)。", - "type": "string" - }, - "member_roles": { - "description": "MemberRoles 当前用户在该租户下的角色(tenant_admin/member 等)。", - "type": "array", - "items": { - "$ref": "#/definitions/consts.TenantUserRole" - } - }, - "member_status": { - "description": "MemberStatus 当前用户在该租户下的成员状态。", - "allOf": [ - { - "$ref": "#/definitions/consts.UserStatus" - } - ] - }, - "tenant_code": { - "description": "TenantCode 租户Code(路由使用:/t/:tenantCode/...)。", + "status_description": { + "description": "StatusDescription 订单状态描述。", "type": "string" }, "tenant_id": { - "description": "TenantID 租户ID(数值型主键)。", + "description": "TenantID 内容所属租户ID。", "type": "integer" }, "tenant_name": { "description": "TenantName 租户名称。", "type": "string" }, - "tenant_status": { - "description": "TenantStatus 租户状态(pending/verified/expired 等)。", - "allOf": [ - { - "$ref": "#/definitions/consts.TenantStatus" - } - ] + "title": { + "description": "Title 订单标题(用于列表展示)。", + "type": "string" }, - "tenant_status_description": { - "description": "TenantStatusDescription 租户状态描述(便于前端展示)。", + "type": { + "description": "Type 订单类型(内容购买/充值等)。", + "type": "string" + }, + "type_description": { + "description": "TypeDescription 订单类型描述。", "type": "string" } } @@ -5161,6 +4024,58 @@ const docTemplate = `{ } } }, + "dto.OrderCreateForm": { + "type": "object", + "properties": { + "content_id": { + "description": "ContentID 内容ID。", + "type": "integer" + }, + "idempotency_key": { + "description": "IdempotencyKey 幂等键(同一业务请求需保持一致)。", + "type": "string" + }, + "quantity": { + "description": "Quantity 购买数量(默认 1)。", + "type": "integer" + }, + "sku": { + "description": "Sku 规格标识(可选)。", + "type": "string" + }, + "user_coupon_id": { + "description": "UserCouponID 用户券ID(可选)。", + "type": "integer" + } + } + }, + "dto.OrderCreateResponse": { + "type": "object", + "properties": { + "order_id": { + "description": "OrderID 创建成功的订单ID。", + "type": "integer" + } + } + }, + "dto.OrderPayForm": { + "type": "object", + "properties": { + "method": { + "description": "Method 支付方式(wechat/alipay/balance)。", + "type": "string" + } + } + }, + "dto.OrderPayResponse": { + "type": "object", + "properties": { + "pay_params": { + "description": "PayParams 支付参数(透传给前端)。", + "type": "string" + } + } + }, "dto.OrderStatisticsResponse": { "type": "object", "properties": { @@ -5195,6 +4110,15 @@ const docTemplate = `{ } } }, + "dto.OrderStatusResponse": { + "type": "object", + "properties": { + "status": { + "description": "Status 订单状态(unpaid/paid/completed 等)。", + "type": "string" + } + } + }, "dto.OrderTenantLite": { "type": "object", "properties": { @@ -5209,162 +4133,129 @@ const docTemplate = `{ } } }, - "dto.PasswordResetForm": { + "dto.PayoutAccount": { "type": "object", "properties": { - "confirmPassword": { - "description": "ConfirmPassword 确认新密码;必须与 Password 一致。", + "account": { + "description": "Account 收款账号。", "type": "string" }, - "password": { - "description": "Password 新密码(明文)。", - "type": "string" - }, - "resetToken": { - "description": "ResetToken 重置令牌;由验证码校验接口返回。", - "type": "string" - } - } - }, - "dto.PasswordResetResponse": { - "type": "object", - "properties": { - "ok": { - "description": "Ok 是否成功。", - "type": "boolean" - } - } - }, - "dto.PasswordResetSendSMSForm": { - "type": "object", - "properties": { - "phone": { - "description": "Phone 手机号;当前版本将其作为用户名使用(users.username)。", - "type": "string" - } - } - }, - "dto.PasswordResetSendSMSResponse": { - "type": "object", - "properties": { - "code": { - "description": "Code 验证码(预留:当前用于前端弹窗展示;正式接入短信后应移除/仅在开发环境返回)。", - "type": "string" - }, - "nextSendSeconds": { - "description": "NextSendSeconds 下次可发送剩余秒数(用于前端 60s 倒计时)。", - "type": "integer" - } - } - }, - "dto.PasswordResetVerifyForm": { - "type": "object", - "properties": { - "code": { - "description": "Code 短信验证码。", - "type": "string" - }, - "phone": { - "description": "Phone 手机号。", - "type": "string" - } - } - }, - "dto.PasswordResetVerifyResponse": { - "type": "object", - "properties": { - "resetToken": { - "description": "ResetToken 重置令牌;验证码校验通过后,用该令牌提交新密码。", - "type": "string" - } - } - }, - "dto.PurchaseContentForm": { - "type": "object", - "properties": { - "idempotency_key": { - "description": "IdempotencyKey is used to ensure the purchase request is processed at most once.\n建议由客户端生成并保持稳定:同一笔购买重复请求时返回相同结果,避免重复扣款/重复下单。", - "type": "string" - } - } - }, - "dto.PurchaseContentResponse": { - "type": "object", - "properties": { - "access": { - "description": "Access is the content access record after purchase grant.", - "allOf": [ - { - "$ref": "#/definitions/models.ContentAccess" - } - ] - }, - "amount_paid": { - "description": "AmountPaid is the final paid amount in cents (CNY 分).", + "id": { + "description": "ID 收款账户ID。", "type": "integer" }, - "item": { - "description": "Item is the single order item of this purchase (current implementation is 1 order -\u003e 1 content).", - "allOf": [ - { - "$ref": "#/definitions/models.OrderItem" - } - ] - }, - "order": { - "description": "Order is the created or existing order record (may be nil for owner/free-path without order).", - "allOf": [ - { - "$ref": "#/definitions/models.Order" - } - ] - } - } - }, - "dto.RegisterForm": { - "type": "object", - "properties": { - "confirmPassword": { - "description": "ConfirmPassword 确认密码;必须与 Password 一致,避免误输入导致无法登录。", + "name": { + "description": "Name 账户名称/开户行。", "type": "string" }, - "password": { - "description": "Password 明文密码;后端会在创建用户时自动加密(bcrypt)。", + "realname": { + "description": "Realname 收款人姓名。", "type": "string" }, - "username": { - "description": "Username 用户名;需全局唯一(users.username);建议仅允许字母/数字/下划线,且长度在合理范围内。", - "type": "string" - }, - "verifyCode": { - "description": "VerifyCode 验证码(预留字段);当前版本仅透传/占位,不做后端校验。", + "type": { + "description": "Type 账户类型(bank/alipay)。", "type": "string" } } }, - "dto.SuperContentItem": { + "dto.RealNameForm": { "type": "object", "properties": { - "content": { - "$ref": "#/definitions/models.Content" - }, - "owner": { - "$ref": "#/definitions/dto.SuperUserLite" - }, - "price": { - "$ref": "#/definitions/models.ContentPrice" - }, - "status_description": { + "id_card": { + "description": "IDCard 身份证号。", "type": "string" }, - "tenant": { - "$ref": "#/definitions/dto.SuperContentTenantLite" - }, - "visibility_description": { + "realname": { + "description": "Realname 真实姓名。", "type": "string" } } }, + "dto.RechargeForm": { + "type": "object", + "properties": { + "amount": { + "description": "Amount 充值金额(单位元)。", + "type": "number" + }, + "method": { + "description": "Method 充值方式(wechat/alipay)。", + "type": "string" + } + } + }, + "dto.RechargeResponse": { + "type": "object", + "properties": { + "order_id": { + "description": "OrderID 充值订单ID。", + "type": "integer" + }, + "pay_params": { + "description": "PayParams 支付参数(透传给前端)。", + "type": "string" + } + } + }, + "dto.RefundForm": { + "type": "object", + "properties": { + "action": { + "description": "Action 处理动作(accept/reject)。", + "type": "string" + }, + "reason": { + "description": "Reason 退款原因/备注。", + "type": "string" + } + } + }, + "dto.Settings": { + "type": "object", + "properties": { + "avatar": { + "description": "Avatar 头像URL。", + "type": "string" + }, + "bio": { + "description": "Bio 频道简介。", + "type": "string" + }, + "cover": { + "description": "Cover 封面图URL。", + "type": "string" + }, + "description": { + "description": "Description 详细描述。", + "type": "string" + }, + "id": { + "description": "ID 租户/频道ID。", + "type": "integer" + }, + "name": { + "description": "Name 频道名称。", + "type": "string" + } + } + }, + "dto.Stats": { + "type": "object", + "properties": { + "contents": { + "description": "Contents 内容数。", + "type": "integer" + }, + "followers": { + "description": "Followers 粉丝数。", + "type": "integer" + }, + "likes": { + "description": "Likes 累计点赞数。", + "type": "integer" + } + } + }, "dto.SuperContentTenantLite": { "type": "object", "properties": { @@ -5386,7 +4277,12 @@ const docTemplate = `{ "$ref": "#/definitions/dto.OrderBuyerLite" }, "order": { - "$ref": "#/definitions/models.Order" + "description": "Using SuperOrderItem as base, extend if needed", + "allOf": [ + { + "$ref": "#/definitions/dto.SuperOrderItem" + } + ] }, "tenant": { "$ref": "#/definitions/dto.OrderTenantLite" @@ -5417,12 +4313,22 @@ const docTemplate = `{ "id": { "type": "integer" }, + "items": { + "description": "Items 订单明细行,用于展示具体内容与金额拆分。", + "type": "array", + "items": { + "$ref": "#/definitions/dto.SuperOrderItemLine" + } + }, "paid_at": { "type": "string" }, "refunded_at": { "type": "string" }, + "snapshot": { + "description": "Snapshot 订单快照,包含下单时的关键参数与定价信息,便于审计回溯。" + }, "status": { "$ref": "#/definitions/consts.OrderStatus" }, @@ -5440,39 +4346,36 @@ const docTemplate = `{ } } }, + "dto.SuperOrderItemLine": { + "type": "object", + "properties": { + "amount_paid": { + "description": "AmountPaid 该明细实付金额(分)。", + "type": "integer" + }, + "content_id": { + "description": "ContentID 购买的内容ID。", + "type": "integer" + }, + "id": { + "description": "ID 订单明细ID。", + "type": "integer" + }, + "snapshot": { + "description": "Snapshot 明细快照,用于展示内容标题等历史信息。" + } + } + }, "dto.SuperOrderRefundForm": { "type": "object", "properties": { "force": { - "description": "Force indicates bypassing the default refund window check (paid_at + 24h).", "type": "boolean" }, "idempotency_key": { - "description": "IdempotencyKey ensures refund request is processed at most once.", "type": "string" }, "reason": { - "description": "Reason is the human-readable refund reason used for audit.", - "type": "string" - } - } - }, - "dto.SuperTenantContentItem": { - "type": "object", - "properties": { - "content": { - "$ref": "#/definitions/models.Content" - }, - "owner": { - "$ref": "#/definitions/dto.SuperUserLite" - }, - "price": { - "$ref": "#/definitions/models.ContentPrice" - }, - "status_description": { - "type": "string" - }, - "visibility_description": { "type": "string" } } @@ -5484,7 +4387,6 @@ const docTemplate = `{ ], "properties": { "status": { - "description": "Status supports: unpublished (下架) / blocked (封禁)", "enum": [ "unpublished", "blocked" @@ -5501,7 +4403,7 @@ const docTemplate = `{ "type": "object", "properties": { "tenant_user": { - "$ref": "#/definitions/models.TenantUser" + "$ref": "#/definitions/dto.TenantUser" }, "user": { "$ref": "#/definitions/dto.SuperUserLite" @@ -5551,56 +4453,6 @@ const docTemplate = `{ } } }, - "dto.TenantApplicationResponse": { - "type": "object", - "properties": { - "createdAt": { - "description": "CreatedAt 申请创建时间(租户记录创建时间)。", - "type": "string" - }, - "hasApplication": { - "description": "HasApplication 是否已提交过申请(或已成为创作者)。", - "type": "boolean" - }, - "status": { - "description": "Status 租户状态(pending_verify/verified/banned)。", - "allOf": [ - { - "$ref": "#/definitions/consts.TenantStatus" - } - ] - }, - "statusDescription": { - "description": "StatusDescription 状态描述(便于前端展示)。", - "type": "string" - }, - "tenantCode": { - "description": "TenantCode 租户 Code。", - "type": "string" - }, - "tenantId": { - "description": "TenantID 租户ID。", - "type": "integer" - }, - "tenantName": { - "description": "TenantName 租户名称。", - "type": "string" - } - } - }, - "dto.TenantApplyForm": { - "type": "object", - "properties": { - "code": { - "description": "Code 租户 ID(用于 URL/系统标识);全局唯一(tenants.code,忽略大小写)。", - "type": "string" - }, - "name": { - "description": "Name 租户名称(展示用)。", - "type": "string" - } - } - }, "dto.TenantCreateForm": { "type": "object", "required": [ @@ -5618,7 +4470,6 @@ const docTemplate = `{ "maxLength": 64 }, "duration": { - "description": "Duration 租户有效期(天),从“创建时刻”起算;与续期接口保持一致。", "type": "integer", "enum": [ 7, @@ -5665,6 +4516,7 @@ const docTemplate = `{ "type": "string" }, "config": { + "description": "Replace with actual config struct if needed", "type": "array", "items": { "type": "integer" @@ -5680,7 +4532,6 @@ const docTemplate = `{ "type": "integer" }, "income_amount_paid_sum": { - "description": "IncomeAmountPaidSum 累计收入金额(单位:分,CNY):按 orders 聚合得到的已支付净收入(不含退款中/已退款订单)。", "type": "integer" }, "name": { @@ -5707,7 +4558,7 @@ const docTemplate = `{ "users": { "type": "array", "items": { - "$ref": "#/definitions/models.User" + "$ref": "#/definitions/dto.SuperUserLite" } }, "uuid": { @@ -5726,6 +4577,51 @@ const docTemplate = `{ } } }, + "dto.TenantProfile": { + "type": "object", + "properties": { + "avatar": { + "description": "Avatar 头像URL。", + "type": "string" + }, + "bio": { + "description": "Bio 简短简介。", + "type": "string" + }, + "cert_type": { + "description": "CertType 认证类型(personal/enterprise)。", + "type": "string" + }, + "cover": { + "description": "Cover 封面图URL。", + "type": "string" + }, + "description": { + "description": "Description 详细描述。", + "type": "string" + }, + "id": { + "description": "ID 租户ID。", + "type": "integer" + }, + "is_following": { + "description": "IsFollowing 当前用户是否关注。", + "type": "boolean" + }, + "name": { + "description": "Name 租户名称。", + "type": "string" + }, + "stats": { + "description": "Stats 统计信息。", + "allOf": [ + { + "$ref": "#/definitions/dto.Stats" + } + ] + } + } + }, "dto.TenantStatusUpdateForm": { "type": "object", "required": [ @@ -5733,15 +4629,207 @@ const docTemplate = `{ ], "properties": { "status": { - "enum": [ - "normal", - "disabled" - ], - "allOf": [ - { - "$ref": "#/definitions/consts.TenantStatus" - } - ] + "$ref": "#/definitions/consts.TenantStatus" + } + } + }, + "dto.TenantUser": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "role": { + "type": "array", + "items": { + "$ref": "#/definitions/consts.TenantUserRole" + } + }, + "status": { + "$ref": "#/definitions/consts.UserStatus" + }, + "tenant_id": { + "type": "integer" + }, + "updated_at": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "dto.Topic": { + "type": "object", + "properties": { + "count": { + "description": "Count 专题内内容数量。", + "type": "integer" + }, + "cover": { + "description": "Cover 专题封面图。", + "type": "string" + }, + "id": { + "description": "ID 专题ID。", + "type": "integer" + }, + "tag": { + "description": "Tag 专题标签(用于筛选/展示)。", + "type": "string" + }, + "title": { + "description": "Title 专题标题。", + "type": "string" + } + } + }, + "dto.Transaction": { + "type": "object", + "properties": { + "amount": { + "description": "Amount 发生金额(单位元)。", + "type": "number" + }, + "date": { + "description": "Date 发生时间(RFC3339)。", + "type": "string" + }, + "id": { + "description": "ID 流水ID。", + "type": "integer" + }, + "title": { + "description": "Title 流水标题/描述。", + "type": "string" + }, + "type": { + "description": "Type 流水类型(income/expense)。", + "type": "string" + } + } + }, + "dto.UploadCompleteForm": { + "type": "object", + "properties": { + "upload_id": { + "description": "UploadID 分片上传ID。", + "type": "string" + } + } + }, + "dto.UploadInitForm": { + "type": "object", + "properties": { + "filename": { + "description": "Filename 原始文件名。", + "type": "string" + }, + "hash": { + "description": "Hash 文件 MD5 哈希(用于秒传校验)。", + "type": "string" + }, + "mime_type": { + "description": "MimeType 文件类型(如 image/png)。", + "type": "string" + }, + "size": { + "description": "Size 文件大小(字节)。", + "type": "integer" + }, + "type": { + "description": "Type 业务类型(如 cover/media/avatar)。", + "type": "string" + } + } + }, + "dto.UploadInitResponse": { + "type": "object", + "properties": { + "chunk_size": { + "description": "ChunkSize 分片大小(字节)。", + "type": "integer" + }, + "key": { + "description": "Key 对象存储Key(S3 直传使用)。", + "type": "string" + }, + "upload_id": { + "description": "UploadID 分片上传ID。", + "type": "string" + } + } + }, + "dto.UploadResult": { + "type": "object", + "properties": { + "filename": { + "description": "Filename 原始文件名。", + "type": "string" + }, + "id": { + "description": "ID 媒体资源ID。", + "type": "integer" + }, + "mime_type": { + "description": "MimeType 文件类型(如 image/png)。", + "type": "string" + }, + "size": { + "description": "Size 文件大小(字节)。", + "type": "integer" + }, + "url": { + "description": "URL 访问地址(包含签名或公共URL)。", + "type": "string" + } + } + }, + "dto.UserCouponItem": { + "type": "object", + "properties": { + "coupon_id": { + "description": "CouponID 券模板ID。", + "type": "integer" + }, + "description": { + "description": "Description 券描述。", + "type": "string" + }, + "end_at": { + "description": "EndAt 过期时间(RFC3339)。", + "type": "string" + }, + "id": { + "description": "ID 用户券ID。", + "type": "integer" + }, + "min_order_amount": { + "description": "MinOrderAmount 使用门槛金额(分)。", + "type": "integer" + }, + "start_at": { + "description": "StartAt 生效时间(RFC3339)。", + "type": "string" + }, + "status": { + "description": "Status 当前状态(可用/已用/过期)。", + "type": "string" + }, + "title": { + "description": "Title 券标题。", + "type": "string" + }, + "type": { + "description": "Type 券类型(满减/折扣)。", + "type": "string" + }, + "value": { + "description": "Value 券面值(分/百分比)。", + "type": "integer" } } }, @@ -5825,15 +4913,7 @@ const docTemplate = `{ ], "properties": { "status": { - "enum": [ - "normal", - "disabled" - ], - "allOf": [ - { - "$ref": "#/definitions/consts.UserStatus" - } - ] + "$ref": "#/definitions/consts.UserStatus" } } }, @@ -5878,805 +4958,88 @@ const docTemplate = `{ } } }, - "gorm.DeletedAt": { + "dto.UserUpdate": { "type": "object", "properties": { - "time": { + "avatar": { + "description": "Avatar 头像URL。", "type": "string" }, - "valid": { - "description": "Valid is true if Time is not NULL", - "type": "boolean" - } - } - }, - "models.Content": { - "type": "object", - "properties": { - "created_at": { - "description": "创建时间:默认 now();用于审计与排序", + "bio": { + "description": "Bio 个人简介。", "type": "string" }, - "deleted_at": { - "description": "软删除时间:非空表示已删除;对外接口需过滤", + "birthday": { + "description": "Birthday 生日(YYYY-MM-DD)。", + "type": "string" + }, + "gender": { + "description": "Gender 性别(枚举)。", "allOf": [ { - "$ref": "#/definitions/gorm.DeletedAt" + "$ref": "#/definitions/consts.Gender" } ] }, - "description": { - "description": "描述:用于详情页展示;可为空字符串", - "type": "string" - }, - "id": { - "description": "主键ID:自增;用于内容引用", - "type": "integer" - }, - "preview_downloadable": { - "description": "试看是否允许下载:默认 false;当前策略固定为不允许下载(仅 streaming)", - "type": "boolean" - }, - "preview_seconds": { - "description": "试看秒数:默认 60;只对 preview 资源生效;必须为正整数", - "type": "integer" - }, - "published_at": { - "description": "发布时间:首次发布时写入;用于时间窗与排序", - "type": "string" - }, - "status": { - "description": "状态:draft/reviewing/published/unpublished/blocked;published 才对外展示", + "location": { + "description": "Location 地区信息(省/市)。", "allOf": [ { - "$ref": "#/definitions/consts.ContentStatus" + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.Location" } ] }, - "summary": { - "description": "简介:用于列表/卡片展示的短文本;建议 \u003c= 256 字符(由业务校验)", - "type": "string" - }, - "tags": { - "description": "标签:JSON 数组(字符串列表);用于分类/检索与聚合展示", - "type": "array", - "items": { - "type": "integer" - } - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id", - "type": "integer" - }, - "title": { - "description": "标题:用于列表展示与搜索;建议限制长度(由业务校验)", - "type": "string" - }, - "updated_at": { - "description": "更新时间:默认 now();编辑内容时写入", - "type": "string" - }, - "user_id": { - "description": "用户ID:内容创建者/发布者;用于权限与审计(例如私有内容仅作者可见)", - "type": "integer" - }, - "visibility": { - "description": "可见性:public/tenant_only/private;仅控制详情可见,正片资源仍需按价格/权益校验", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentVisibility" - } - ] - } - } - }, - "models.ContentAccess": { - "type": "object", - "properties": { - "content_id": { - "description": "内容ID:权益对应内容;唯一约束 (tenant_id, user_id, content_id)", - "type": "integer" - }, - "created_at": { - "description": "创建时间:默认 now();用于审计", - "type": "string" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "order_id": { - "description": "订单ID:产生该权益的订单;可为空(例如后台补发/迁移)", - "type": "integer" - }, - "revoked_at": { - "description": "撤销时间:当 status=revoked 时写入;用于审计与追责", - "type": "string" - }, - "status": { - "description": "权益状态:active/revoked/expired;revoked 表示立即失效(例如退款/违规)", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentAccessStatus" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离;与内容、用户归属一致", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now();更新 status 时写入", - "type": "string" - }, - "user_id": { - "description": "用户ID:权益所属用户;用于访问校验", - "type": "integer" - } - } - }, - "models.ContentAsset": { - "type": "object", - "properties": { - "asset_id": { - "description": "资源ID:关联 media_assets.id;用于查询资源归属内容", - "type": "integer" - }, - "content_id": { - "description": "内容ID:关联 contents.id;用于查询内容下资源列表", - "type": "integer" - }, - "created_at": { - "description": "创建时间:默认 now();用于审计", - "type": "string" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "role": { - "description": "资源角色:main/cover/preview;preview 必须为独立资源以满足禁下载与防绕过", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentAssetRole" - } - ] - }, - "sort": { - "description": "排序:同一 role 下的展示顺序,数值越小越靠前", - "type": "integer" - }, - "tenant_id": { - "description": "租户ID:多租户隔离;必须与 content_id、asset_id 所属租户一致", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now();更新 sort/role 时写入", - "type": "string" - }, - "user_id": { - "description": "用户ID:操作人/绑定人;用于审计(通常为租户管理员或作者)", - "type": "integer" - } - } - }, - "models.ContentPrice": { - "type": "object", - "properties": { - "content_id": { - "description": "内容ID:唯一约束 (tenant_id, content_id);一个内容在一个租户内仅一份定价", - "type": "integer" - }, - "created_at": { - "description": "创建时间:默认 now();用于审计", - "type": "string" - }, - "currency": { - "description": "币种:当前固定 CNY;金额单位为分", - "allOf": [ - { - "$ref": "#/definitions/consts.Currency" - } - ] - }, - "discount_end_at": { - "description": "折扣结束时间:可为空;为空表示长期有效(由业务逻辑解释)", - "type": "string" - }, - "discount_start_at": { - "description": "折扣开始时间:可为空;为空表示立即生效(由业务逻辑解释)", - "type": "string" - }, - "discount_type": { - "description": "折扣类型:none/percent/amount;仅影响下单时成交价,需写入订单快照", - "allOf": [ - { - "$ref": "#/definitions/consts.DiscountType" - } - ] - }, - "discount_value": { - "description": "折扣值:percent=0-100(按业务校验);amount=分;none 时忽略", - "type": "integer" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "price_amount": { - "description": "基础价格:分;0 表示免费(可直接访问正片资源)", - "type": "integer" - }, - "tenant_id": { - "description": "租户ID:多租户隔离;与内容归属一致", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now();更新价格/折扣时写入", - "type": "string" - }, - "user_id": { - "description": "用户ID:设置/更新价格的操作人(通常为 tenant_admin);用于审计", - "type": "integer" - } - } - }, - "models.MediaAsset": { - "type": "object", - "properties": { - "bucket": { - "description": "存储桶:对象所在 bucket;与 provider 组合确定存储定位", - "type": "string" - }, - "created_at": { - "description": "创建时间:默认 now();用于审计与排序", - "type": "string" - }, - "deleted_at": { - "description": "软删除时间:非空表示已删除;对外接口需过滤", - "allOf": [ - { - "$ref": "#/definitions/gorm.DeletedAt" - } - ] - }, - "id": { - "description": "主键ID:自增;仅用于内部关联", - "type": "integer" - }, - "meta": { - "description": "元数据:JSON;包含 hash、duration、width、height、bitrate、codec 等;用于展示与计费/风控", - "type": "array", - "items": { - "type": "integer" - } - }, - "object_key": { - "description": "对象键:对象在 bucket 内的 key;不得暴露可长期复用的直链(通过签名URL/token下发)", - "type": "string" - }, - "provider": { - "description": "存储提供方:例如 s3/minio/oss;便于多存储扩展", - "type": "string" - }, - "source_asset_id": { - "description": "派生来源资源ID:preview 产物可指向对应 main 资源;用于建立 preview/main 的 1:1 追溯关系", - "type": "integer" - }, - "status": { - "description": "处理状态:uploaded/processing/ready/failed/deleted;ready 才可被内容引用对外提供", - "allOf": [ - { - "$ref": "#/definitions/consts.MediaAssetStatus" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id", - "type": "integer" - }, - "type": { - "description": "资源类型:video/audio/image;决定后续处理流程(转码/缩略图/封面等)", - "allOf": [ - { - "$ref": "#/definitions/consts.MediaAssetType" - } - ] - }, - "updated_at": { - "description": "更新时间:默认 now();更新状态/元数据时写入", - "type": "string" - }, - "user_id": { - "description": "用户ID:资源上传者;用于审计与权限控制", - "type": "integer" - }, - "variant": { - "description": "产物类型:main/preview;用于强制试看资源必须绑定独立产物,避免用正片绕过", - "allOf": [ - { - "$ref": "#/definitions/consts.MediaAssetVariant" - } - ] - } - } - }, - "models.Order": { - "type": "object", - "properties": { - "amount_discount": { - "description": "优惠金额:分;amount_paid = amount_original - amount_discount(下单时快照)", - "type": "integer" - }, - "amount_original": { - "description": "原价金额:分;未折扣前金额(用于展示与对账)", - "type": "integer" - }, - "amount_paid": { - "description": "实付金额:分;从租户内余额扣款的金额(下单时快照)", - "type": "integer" - }, - "created_at": { - "description": "创建时间:默认 now();用于审计与排序", - "type": "string" - }, - "currency": { - "description": "币种:当前固定 CNY;金额单位为分", - "allOf": [ - { - "$ref": "#/definitions/consts.Currency" - } - ] - }, - "id": { - "description": "主键ID:自增;用于关联订单明细、账本流水、权益等", - "type": "integer" - }, - "idempotency_key": { - "description": "幂等键:同一租户同一用户同一业务请求可用;用于防重复下单/重复扣款(建议由客户端生成)", - "type": "string" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/models.OrderItem" - } - }, - "paid_at": { - "description": "支付/扣款完成时间:余额支付在 debit_purchase 成功后写入", - "type": "string" - }, - "refund_forced": { - "description": "是否强制退款:true 表示租户管理侧绕过时间窗执行退款(需审计)", - "type": "boolean" - }, - "refund_operator_user_id": { - "description": "退款操作人用户ID:租户管理员/系统;用于审计与追责", - "type": "integer" - }, - "refund_reason": { - "description": "退款原因:后台/用户发起退款的原因说明;用于审计", - "type": "string" - }, - "refunded_at": { - "description": "退款完成时间:退款落账成功后写入", - "type": "string" - }, - "snapshot": { - "description": "订单快照:JSON;建议包含 content 标题/定价/折扣、请求来源等,避免改价影响历史展示", - "allOf": [ - { - "$ref": "#/definitions/types.JSONType-fields_OrdersSnapshot" - } - ] - }, - "status": { - "description": "订单状态:created/paid/refunding/refunded/canceled/failed;状态变更需与账本/权益保持一致", - "allOf": [ - { - "$ref": "#/definitions/consts.OrderStatus" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id", - "type": "integer" - }, - "type": { - "description": "订单类型:content_purchase(购买内容)等;当前默认 content_purchase", - "allOf": [ - { - "$ref": "#/definitions/consts.OrderType" - } - ] - }, - "updated_at": { - "description": "更新时间:默认 now();状态变更/退款写入时更新", - "type": "string" - }, - "user_id": { - "description": "用户ID:下单用户(buyer);余额扣款与权益归属以该 user_id 为准", - "type": "integer" - } - } - }, - "models.OrderItem": { - "type": "object", - "properties": { - "amount_paid": { - "description": "该行实付金额:分;通常等于订单 amount_paid(单内容场景)", - "type": "integer" - }, - "content": { - "$ref": "#/definitions/models.Content" - }, - "content_id": { - "description": "内容ID:关联 contents.id;用于生成/撤销 content_access", - "type": "integer" - }, - "content_user_id": { - "description": "内容作者用户ID:用于后续分成/对账扩展;当前可为 0 或写入内容创建者", - "type": "integer" - }, - "created_at": { - "description": "创建时间:默认 now()", - "type": "string" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "order": { - "$ref": "#/definitions/models.Order" - }, - "order_id": { - "description": "订单ID:关联 orders.id;用于聚合订单明细", - "type": "integer" - }, - "snapshot": { - "description": "内容快照:JSON;建议包含 title/price/discount 等,用于历史展示与审计", - "allOf": [ - { - "$ref": "#/definitions/types.JSONType-fields_OrderItemsSnapshot" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;必须与 orders.tenant_id 一致", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now()", - "type": "string" - }, - "user_id": { - "description": "用户ID:下单用户(buyer);冗余字段用于查询加速与审计", - "type": "integer" - } - } - }, - "models.Tenant": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "config": { - "type": "array", - "items": { - "type": "integer" - } - }, - "created_at": { - "type": "string" - }, - "expired_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/consts.TenantStatus" - }, - "updated_at": { - "type": "string" - }, - "user_id": { - "type": "integer" - }, - "users": { - "type": "array", - "items": { - "$ref": "#/definitions/models.User" - } - }, - "uuid": { + "nickname": { + "description": "Nickname 昵称。", "type": "string" } } }, - "models.TenantInvite": { - "type": "object", - "properties": { - "code": { - "description": "邀请码:用户加入租户时提交;同一租户内唯一", - "type": "string" - }, - "created_at": { - "description": "创建时间:默认 now()", - "type": "string" - }, - "disabled_at": { - "description": "禁用时间:租户管理员禁用该邀请的时间(UTC)", - "type": "string" - }, - "disabled_operator_user_id": { - "description": "禁用操作人用户ID:租户管理员(审计用)", - "type": "integer" - }, - "expires_at": { - "description": "过期时间:到期后不可再使用(UTC);为空表示不过期", - "type": "string" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "max_uses": { - "description": "最大可使用次数:0 表示不限制;\u003e0 时 used_count 达到该值后视为失效", - "type": "integer" - }, - "remark": { - "description": "备注:生成/禁用原因等(审计用)", - "type": "string" - }, - "status": { - "description": "邀请状态:active/disabled/expired;expired 也可由 expires_at 推导,业务侧需保持一致", - "allOf": [ - { - "$ref": "#/definitions/consts.TenantInviteStatus" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now()", - "type": "string" - }, - "used_count": { - "description": "已使用次数:每次成功加入时 +1;需事务保证并发下不超发", - "type": "integer" - }, - "user_id": { - "description": "创建人用户ID:生成邀请码的租户管理员(审计用)", - "type": "integer" - } - } - }, - "models.TenantJoinRequest": { - "type": "object", - "properties": { - "created_at": { - "description": "创建时间:默认 now()", - "type": "string" - }, - "decided_at": { - "description": "处理时间:审核通过/拒绝时记录(UTC)", - "type": "string" - }, - "decided_operator_user_id": { - "description": "处理人用户ID:租户管理员(审计用)", - "type": "integer" - }, - "decided_reason": { - "description": "处理说明:管理员通过/拒绝的原因(可选,审计用)", - "type": "string" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "reason": { - "description": "申请原因:用户填写的加入说明(可选)", - "type": "string" - }, - "status": { - "description": "申请状态:pending/approved/rejected;状态变更需记录 decided_at 与 decided_operator_user_id", - "allOf": [ - { - "$ref": "#/definitions/consts.TenantJoinRequestStatus" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now()", - "type": "string" - }, - "user_id": { - "description": "申请人用户ID:发起加入申请的用户", - "type": "integer" - } - } - }, - "models.TenantLedger": { - "type": "object", - "properties": { - "amount": { - "description": "流水金额:分/最小货币单位;通常为正数,方向由 type 决定(由业务层约束)", - "type": "integer" - }, - "balance_after": { - "description": "变更后可用余额:用于审计与对账回放", - "type": "integer" - }, - "balance_before": { - "description": "变更前可用余额:用于审计与对账回放", - "type": "integer" - }, - "biz_ref_id": { - "description": "业务引用ID:与 biz_ref_type 配合使用(例如 orders.id);用于对账与审计", - "type": "integer" - }, - "biz_ref_type": { - "description": "业务引用类型:order/refund/etc;与 biz_ref_id 组成可选的结构化幂等/追溯键", - "type": "string" - }, - "created_at": { - "description": "创建时间:默认 now()", - "type": "string" - }, - "frozen_after": { - "description": "变更后冻结余额:用于审计与对账回放", - "type": "integer" - }, - "frozen_before": { - "description": "变更前冻结余额:用于审计与对账回放", - "type": "integer" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "idempotency_key": { - "description": "幂等键:同一租户同一用户同一业务操作固定;用于防止重复落账(建议由业务层生成)", - "type": "string" - }, - "operator_user_id": { - "description": "操作者用户ID:谁触发该流水(admin/buyer/system);用于审计与追责;可为空(历史数据或无法识别时)", - "type": "integer" - }, - "order": { - "$ref": "#/definitions/models.Order" - }, - "order_id": { - "description": "关联订单ID:购买/退款类流水应关联 orders.id;非订单类可为空", - "type": "integer" - }, - "remark": { - "description": "备注:业务说明/后台操作原因等;用于审计", - "type": "string" - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;必须与 tenant_users.tenant_id 一致", - "type": "integer" - }, - "type": { - "description": "流水类型:debit_purchase/credit_refund/freeze/unfreeze/adjustment;不同类型决定余额/冻结余额的变更方向", - "allOf": [ - { - "$ref": "#/definitions/consts.TenantLedgerType" - } - ] - }, - "updated_at": { - "description": "更新时间:默认 now()", - "type": "string" - }, - "user_id": { - "description": "用户ID:余额账户归属用户;对应 tenant_users.user_id", - "type": "integer" - } - } - }, - "models.TenantUser": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "role": { - "type": "array", - "items": { - "$ref": "#/definitions/consts.TenantUserRole" - } - }, - "status": { - "$ref": "#/definitions/consts.UserStatus" - }, - "tenant_id": { - "type": "integer" - }, - "updated_at": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - } - }, - "models.User": { + "dto.WalletResponse": { "type": "object", "properties": { "balance": { - "description": "全局可用余额:分/最小货币单位;用户在所有已加入租户内共享该余额;默认 0", - "type": "integer" + "description": "Balance 账户余额(单位元)。", + "type": "number" }, - "balance_frozen": { - "description": "全局冻结余额:分/最小货币单位;用于下单冻结等;默认 0", - "type": "integer" - }, - "created_at": { - "type": "string" - }, - "deleted_at": { - "$ref": "#/definitions/gorm.DeletedAt" - }, - "id": { - "type": "integer" - }, - "metas": { + "transactions": { + "description": "Transactions 交易流水列表。", "type": "array", "items": { - "type": "integer" + "$ref": "#/definitions/dto.Transaction" } + } + } + }, + "dto.WithdrawForm": { + "type": "object", + "properties": { + "account_id": { + "description": "AccountID 收款账户ID。", + "type": "integer" }, - "owned": { - "$ref": "#/definitions/models.Tenant" + "amount": { + "description": "Amount 提现金额(单位元)。", + "type": "number" }, - "password": { - "type": "string" - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/consts.Role" - } - }, - "status": { - "$ref": "#/definitions/consts.UserStatus" - }, - "tenants": { - "type": "array", - "items": { - "$ref": "#/definitions/models.Tenant" - } - }, - "updated_at": { - "type": "string" - }, - "username": { - "type": "string" - }, - "verified_at": { + "method": { + "description": "Method 提现方式(wallet/external)。", "type": "string" } } }, - "quyun_v2_app_http_super_dto.LoginForm": { + "quyun_v2_app_http_super_v1_dto.Location": { + "type": "object", + "properties": { + "city": { + "type": "string" + }, + "province": { + "type": "string" + } + } + }, + "quyun_v2_app_http_super_v1_dto.LoginForm": { "type": "object", "properties": { "password": { @@ -6687,102 +5050,162 @@ const docTemplate = `{ } } }, - "quyun_v2_app_http_super_dto.LoginResponse": { + "quyun_v2_app_http_super_v1_dto.LoginResponse": { "type": "object", "properties": { "token": { "type": "string" - } - } - }, - "quyun_v2_app_http_tenant_dto.MeResponse": { - "type": "object", - "properties": { - "tenant": { - "description": "Tenant is the resolved tenant by ` + "`" + `tenantCode` + "`" + `.", - "allOf": [ - { - "$ref": "#/definitions/models.Tenant" - } - ] - }, - "tenant_user": { - "description": "TenantUser is the membership record of the authenticated user within the tenant.", - "allOf": [ - { - "$ref": "#/definitions/models.TenantUser" - } - ] }, "user": { - "description": "User is the authenticated user derived from JWT ` + "`" + `user_id` + "`" + `.", - "allOf": [ - { - "$ref": "#/definitions/models.User" - } - ] + "$ref": "#/definitions/quyun_v2_app_http_super_v1_dto.User" } } }, - "quyun_v2_app_http_web_dto.LoginForm": { + "quyun_v2_app_http_super_v1_dto.User": { "type": "object", "properties": { - "password": { - "description": "Password 明文密码;后端会与 users.password 的 bcrypt hash 做比对。", + "avatar": { "type": "string" }, - "username": { - "description": "Username 用户名;必须与数据库 users.username 精确匹配。", + "balance": { + "type": "number" + }, + "bio": { + "type": "string" + }, + "birthday": { + "description": "YYYY-MM-DD", + "type": "string" + }, + "gender": { + "$ref": "#/definitions/consts.Gender" + }, + "id": { + "type": "integer" + }, + "is_real_name_verified": { + "type": "boolean" + }, + "location": { + "$ref": "#/definitions/quyun_v2_app_http_super_v1_dto.Location" + }, + "nickname": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "points": { + "type": "integer" + } + } + }, + "quyun_v2_app_http_v1_dto.Location": { + "type": "object", + "properties": { + "city": { + "description": "City 城市名称。", + "type": "string" + }, + "province": { + "description": "Province 省份名称。", "type": "string" } } }, - "quyun_v2_app_http_web_dto.LoginResponse": { + "quyun_v2_app_http_v1_dto.LoginForm": { + "type": "object", + "properties": { + "otp": { + "description": "OTP 短信验证码。", + "type": "string" + }, + "phone": { + "description": "Phone 手机号(登录账号)。", + "type": "string" + } + } + }, + "quyun_v2_app_http_v1_dto.LoginResponse": { "type": "object", "properties": { "token": { - "description": "Token JWT 访问令牌;前端应以 ` + "`" + `Authorization: Bearer \u003ctoken\u003e` + "`" + ` 方式携带。", + "description": "Token 登录成功后的 JWT。", + "type": "string" + }, + "user": { + "description": "User 当前登录用户信息。", + "allOf": [ + { + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.User" + } + ] + } + } + }, + "quyun_v2_app_http_v1_dto.SendOTPForm": { + "type": "object", + "properties": { + "phone": { + "description": "Phone 手机号(用于发送验证码)。", "type": "string" } } }, - "quyun_v2_app_http_web_dto.MeResponse": { + "quyun_v2_app_http_v1_dto.User": { "type": "object", "properties": { - "created_at": { - "description": "CreatedAt 用户创建时间。", + "avatar": { + "description": "Avatar 头像URL。", "type": "string" }, - "id": { - "description": "ID 用户ID(全局唯一)。", - "type": "integer" + "balance": { + "description": "Balance 余额(单位元)。", + "type": "number" }, - "roles": { - "description": "Roles 用户全局角色数组(如 user/super_admin 等)。", - "type": "array", - "items": { - "$ref": "#/definitions/consts.Role" - } + "bio": { + "description": "Bio 个人简介。", + "type": "string" }, - "status": { - "description": "Status 用户状态(active/verified/banned 等)。", + "birthday": { + "description": "Birthday 生日(YYYY-MM-DD)。", + "type": "string" + }, + "gender": { + "description": "Gender 性别(枚举)。", "allOf": [ { - "$ref": "#/definitions/consts.UserStatus" + "$ref": "#/definitions/consts.Gender" } ] }, - "status_description": { - "description": "StatusDescription 用户状态描述(便于前端展示)。", + "id": { + "description": "ID 用户ID。", + "type": "integer" + }, + "is_real_name_verified": { + "description": "IsRealNameVerified 是否完成实名认证。", + "type": "boolean" + }, + "location": { + "description": "Location 地区信息(省/市)。", + "allOf": [ + { + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.Location" + } + ] + }, + "nickname": { + "description": "Nickname 昵称。", "type": "string" }, - "updated_at": { - "description": "UpdatedAt 用户更新时间。", + "phone": { + "description": "Phone 绑定手机号。", "type": "string" }, - "username": { - "description": "Username 用户名。", - "type": "string" + "points": { + "description": "Points 积分余额。", + "type": "integer" } } }, @@ -6818,11 +5241,16 @@ const docTemplate = `{ } } }, - "types.JSONType-fields_OrderItemsSnapshot": { - "type": "object" - }, - "types.JSONType-fields_OrdersSnapshot": { - "type": "object" + "v1.WebhookForm": { + "type": "object", + "properties": { + "external_id": { + "type": "string" + }, + "order_id": { + "type": "integer" + } + } } }, "securityDefinitions": { diff --git a/backend/docs/swagger.json b/backend/docs/swagger.json index f234228..c13e898 100644 --- a/backend/docs/swagger.json +++ b/backend/docs/swagger.json @@ -20,6 +20,7 @@ "paths": { "/super/v1/auth/login": { "post": { + "description": "Login", "consumes": [ "application/json" ], @@ -27,24 +28,25 @@ "application/json" ], "tags": [ - "Super" + "Auth" ], + "summary": "Login", "parameters": [ { - "description": "form", + "description": "Login form", "name": "form", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginForm" + "$ref": "#/definitions/quyun_v2_app_http_super_v1_dto.LoginForm" } } ], "responses": { "200": { - "description": "成功", + "description": "OK", "schema": { - "$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginResponse" + "$ref": "#/definitions/quyun_v2_app_http_super_v1_dto.LoginResponse" } } } @@ -52,6 +54,7 @@ }, "/super/v1/auth/token": { "get": { + "description": "Check token", "consumes": [ "application/json" ], @@ -59,13 +62,14 @@ "application/json" ], "tags": [ - "Super" + "Auth" ], + "summary": "Check token", "responses": { "200": { - "description": "成功", + "description": "OK", "schema": { - "$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginResponse" + "$ref": "#/definitions/quyun_v2_app_http_super_v1_dto.LoginResponse" } } } @@ -73,6 +77,7 @@ }, "/super/v1/contents": { "get": { + "description": "List contents", "consumes": [ "application/json" ], @@ -80,131 +85,20 @@ "application/json" ], "tags": [ - "Super" + "Content" ], - "summary": "内容列表(平台侧汇总)", + "summary": "List contents", "parameters": [ - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, { "type": "integer", - "name": "id", - "in": "query" - }, - { - "type": "string", - "name": "keyword", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", - "name": "price_amount_max", - "in": "query" - }, - { - "type": "integer", - "name": "price_amount_min", - "in": "query" - }, - { - "type": "string", - "name": "published_at_from", - "in": "query" - }, - { - "type": "string", - "name": "published_at_to", - "in": "query" - }, - { - "enum": [ - "draft", - "reviewing", - "published", - "unpublished", - "blocked" - ], - "type": "string", - "x-enum-varnames": [ - "ContentStatusDraft", - "ContentStatusReviewing", - "ContentStatusPublished", - "ContentStatusUnpublished", - "ContentStatusBlocked" - ], - "name": "status", - "in": "query" - }, - { - "type": "string", - "name": "tenant_code", - "in": "query" - }, - { - "type": "integer", - "name": "tenant_id", - "in": "query" - }, - { - "type": "string", - "name": "tenant_name", - "in": "query" - }, - { - "type": "integer", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "name": "username", - "in": "query" - }, - { - "enum": [ - "public", - "tenant_only", - "private" - ], - "type": "string", - "x-enum-varnames": [ - "ContentVisibilityPublic", - "ContentVisibilityTenantOnly", - "ContentVisibilityPrivate" - ], - "name": "visibility", + "description": "Page size", + "name": "limit", "in": "query" } ], @@ -220,7 +114,10 @@ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.SuperContentItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.AdminContentItem" + } } } } @@ -232,6 +129,7 @@ }, "/super/v1/orders": { "get": { + "description": "List orders", "consumes": [ "application/json" ], @@ -239,134 +137,20 @@ "application/json" ], "tags": [ - "Super" + "Order" ], - "summary": "订单列表", + "summary": "List orders", "parameters": [ { "type": "integer", - "name": "amount_paid_max", - "in": "query" - }, - { - "type": "integer", - "name": "amount_paid_min", - "in": "query" - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "integer", - "name": "content_id", - "in": "query" - }, - { - "type": "string", - "name": "content_title", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "name": "id", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, - { - "type": "string", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "name": "status", - "in": "query" - }, - { - "type": "string", - "name": "tenant_code", - "in": "query" - }, { "type": "integer", - "name": "tenant_id", - "in": "query" - }, - { - "type": "string", - "name": "tenant_name", - "in": "query" - }, - { - "enum": [ - "content_purchase" - ], - "type": "string", - "x-enum-varnames": [ - "OrderTypeContentPurchase" - ], - "name": "type", - "in": "query" - }, - { - "type": "integer", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "name": "username", + "description": "Page size", + "name": "limit", "in": "query" } ], @@ -382,7 +166,10 @@ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.SuperOrderItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.SuperOrderItem" + } } } } @@ -394,6 +181,7 @@ }, "/super/v1/orders/statistics": { "get": { + "description": "Order statistics", "consumes": [ "application/json" ], @@ -401,9 +189,9 @@ "application/json" ], "tags": [ - "Super" + "Order" ], - "summary": "订单统计信息", + "summary": "Order statistics", "responses": { "200": { "description": "OK", @@ -414,8 +202,9 @@ } } }, - "/super/v1/orders/{orderID}": { + "/super/v1/orders/{id}": { "get": { + "description": "Get order", "consumes": [ "application/json" ], @@ -423,15 +212,15 @@ "application/json" ], "tags": [ - "Super" + "Order" ], - "summary": "订单详情", + "summary": "Get order", "parameters": [ { "type": "integer", "format": "int64", - "description": "OrderID", - "name": "orderID", + "description": "Order ID", + "name": "id", "in": "path", "required": true } @@ -446,9 +235,9 @@ } } }, - "/super/v1/orders/{orderID}/refund": { + "/super/v1/orders/{id}/refund": { "post": { - "description": "该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。", + "description": "Refund order", "consumes": [ "application/json" ], @@ -456,20 +245,20 @@ "application/json" ], "tags": [ - "Super" + "Order" ], - "summary": "订单退款(平台)", + "summary": "Refund order", "parameters": [ { "type": "integer", "format": "int64", - "description": "OrderID", - "name": "orderID", + "description": "Order ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Refund form", "name": "form", "in": "body", "required": true, @@ -480,9 +269,9 @@ ], "responses": { "200": { - "description": "OK", + "description": "Refunded", "schema": { - "$ref": "#/definitions/models.Order" + "type": "string" } } } @@ -490,6 +279,7 @@ }, "/super/v1/tenants": { "get": { + "description": "List tenants", "consumes": [ "application/json" ], @@ -497,88 +287,27 @@ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "租户列表", + "summary": "List tenants", "parameters": [ { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "code", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "string", - "name": "expired_at_from", - "in": "query" - }, - { - "type": "string", - "name": "expired_at_to", + "type": "integer", + "description": "Page number", + "name": "page", "in": "query" }, { "type": "integer", - "name": "id", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "description": "Page size", "name": "limit", "in": "query" }, { "type": "string", + "description": "Name", "name": "name", "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "TenantStatusPendingVerify", - "TenantStatusVerified", - "TenantStatusBanned" - ], - "name": "status", - "in": "query" - }, - { - "type": "integer", - "name": "user_id", - "in": "query" } ], "responses": { @@ -593,7 +322,10 @@ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.TenantItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.TenantItem" + } } } } @@ -603,6 +335,7 @@ } }, "post": { + "description": "Create tenant", "consumes": [ "application/json" ], @@ -610,12 +343,12 @@ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "创建租户并设置租户管理员", + "summary": "Create tenant", "parameters": [ { - "description": "Form", + "description": "Create form", "name": "form", "in": "body", "required": true, @@ -626,9 +359,9 @@ ], "responses": { "200": { - "description": "OK", + "description": "Created", "schema": { - "$ref": "#/definitions/models.Tenant" + "type": "string" } } } @@ -636,6 +369,7 @@ }, "/super/v1/tenants/statuses": { "get": { + "description": "Tenant statuses", "consumes": [ "application/json" ], @@ -643,9 +377,9 @@ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "租户状态列表", + "summary": "Tenant statuses", "responses": { "200": { "description": "OK", @@ -659,8 +393,9 @@ } } }, - "/super/v1/tenants/{tenantID}": { + "/super/v1/tenants/{id}": { "get": { + "description": "Get tenant", "consumes": [ "application/json" ], @@ -668,15 +403,15 @@ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "租户详情", + "summary": "Get tenant", "parameters": [ { "type": "integer", "format": "int64", - "description": "TenantID", - "name": "tenantID", + "description": "Tenant ID", + "name": "id", "in": "path", "required": true } @@ -691,6 +426,7 @@ } }, "patch": { + "description": "Update tenant expire", "consumes": [ "application/json" ], @@ -698,20 +434,20 @@ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "更新过期时间", + "summary": "Update tenant expire", "parameters": [ { "type": "integer", "format": "int64", - "description": "TenantID", - "name": "tenantID", + "description": "Tenant ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, @@ -720,11 +456,19 @@ } } ], - "responses": {} + "responses": { + "200": { + "description": "Updated", + "schema": { + "type": "string" + } + } + } } }, - "/super/v1/tenants/{tenantID}/contents": { - "get": { + "/super/v1/tenants/{id}/status": { + "patch": { + "description": "Update tenant status", "consumes": [ "application/json" ], @@ -732,104 +476,70 @@ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "租户内容列表(平台侧)", + "summary": "Update tenant status", "parameters": [ { "type": "integer", "format": "int64", - "description": "TenantID", + "description": "Tenant ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Update form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.TenantStatusUpdateForm" + } + } + ], + "responses": { + "200": { + "description": "Updated", + "schema": { + "type": "string" + } + } + } + } + }, + "/super/v1/tenants/{tenantID}/contents": { + "get": { + "description": "List contents by tenant", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Content" + ], + "summary": "List tenant contents", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Tenant ID", "name": "tenantID", "in": "path", "required": true }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "string", - "name": "keyword", - "in": "query" - }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, - { - "type": "string", - "name": "published_at_from", - "in": "query" - }, - { - "type": "string", - "name": "published_at_to", - "in": "query" - }, - { - "enum": [ - "draft", - "reviewing", - "published", - "unpublished", - "blocked" - ], - "type": "string", - "x-enum-varnames": [ - "ContentStatusDraft", - "ContentStatusReviewing", - "ContentStatusPublished", - "ContentStatusUnpublished", - "ContentStatusBlocked" - ], - "name": "status", - "in": "query" - }, { "type": "integer", - "name": "user_id", - "in": "query" - }, - { - "enum": [ - "public", - "tenant_only", - "private" - ], - "type": "string", - "x-enum-varnames": [ - "ContentVisibilityPublic", - "ContentVisibilityTenantOnly", - "ContentVisibilityPrivate" - ], - "name": "visibility", + "description": "Page size", + "name": "limit", "in": "query" } ], @@ -845,7 +555,10 @@ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.SuperTenantContentItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.AdminContentItem" + } } } } @@ -857,6 +570,7 @@ }, "/super/v1/tenants/{tenantID}/contents/{contentID}/status": { "patch": { + "description": "Update content status", "consumes": [ "application/json" ], @@ -864,14 +578,14 @@ "application/json" ], "tags": [ - "Super" + "Content" ], - "summary": "更新租户内容状态(平台侧:下架/封禁)", + "summary": "Update content status", "parameters": [ { "type": "integer", "format": "int64", - "description": "TenantID", + "description": "Tenant ID", "name": "tenantID", "in": "path", "required": true @@ -879,13 +593,13 @@ { "type": "integer", "format": "int64", - "description": "ContentID", + "description": "Content ID", "name": "contentID", "in": "path", "required": true }, { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, @@ -896,50 +610,17 @@ ], "responses": { "200": { - "description": "OK", + "description": "Updated", "schema": { - "$ref": "#/definitions/models.Content" + "type": "string" } } } } }, - "/super/v1/tenants/{tenantID}/status": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Super" - ], - "summary": "更新租户状态", - "parameters": [ - { - "type": "integer", - "format": "int64", - "description": "TenantID", - "name": "tenantID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.TenantStatusUpdateForm" - } - } - ], - "responses": {} - } - }, "/super/v1/tenants/{tenantID}/users": { "get": { + "description": "List tenant users", "consumes": [ "application/json" ], @@ -947,70 +628,28 @@ "application/json" ], "tags": [ - "Super" + "Tenant" ], - "summary": "租户成员列表(平台侧)", + "summary": "List tenant users", "parameters": [ { "type": "integer", "format": "int64", - "description": "TenantID", + "description": "Tenant ID", "name": "tenantID", "in": "path", "required": true }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, - { - "enum": [ - "member", - "tenant_admin" - ], - "type": "string", - "x-enum-varnames": [ - "TenantUserRoleMember", - "TenantUserRoleTenantAdmin" - ], - "description": "Role 按角色过滤(可选):member/tenant_admin。", - "name": "role", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "UserStatusPendingVerify", - "UserStatusVerified", - "UserStatusBanned" - ], - "description": "Status 按成员状态过滤(可选):pending_verify/verified/banned。", - "name": "status", - "in": "query" - }, { "type": "integer", - "description": "UserID 按用户ID过滤(可选)。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 按用户名模糊查询(可选,支持包含匹配)。", - "name": "username", + "description": "Page size", + "name": "limit", "in": "query" } ], @@ -1026,7 +665,10 @@ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.SuperTenantUserItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.SuperTenantUserItem" + } } } } @@ -1038,6 +680,7 @@ }, "/super/v1/users": { "get": { + "description": "List users", "consumes": [ "application/json" ], @@ -1045,98 +688,27 @@ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "用户列表", + "summary": "List users", "parameters": [ - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, { "type": "integer", - "name": "id", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, - { - "enum": [ - "user", - "super_admin" - ], - "type": "string", - "x-enum-varnames": [ - "RoleUser", - "RoleSuperAdmin" - ], - "description": "Role filters users containing a role (user/super_admin).", - "name": "role", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "UserStatusPendingVerify", - "UserStatusVerified", - "UserStatusBanned" - ], - "name": "status", - "in": "query" - }, { "type": "integer", - "description": "TenantID filters users by membership in the given tenant.", - "name": "tenant_id", + "description": "Page size", + "name": "limit", "in": "query" }, { "type": "string", + "description": "Username", "name": "username", "in": "query" - }, - { - "type": "string", - "name": "verified_at_from", - "in": "query" - }, - { - "type": "string", - "name": "verified_at_to", - "in": "query" } ], "responses": { @@ -1151,7 +723,10 @@ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.UserItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.UserItem" + } } } } @@ -1163,6 +738,7 @@ }, "/super/v1/users/statistics": { "get": { + "description": "User statistics", "consumes": [ "application/json" ], @@ -1170,9 +746,9 @@ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "用户统计信息", + "summary": "User statistics", "responses": { "200": { "description": "OK", @@ -1188,6 +764,7 @@ }, "/super/v1/users/statuses": { "get": { + "description": "User statuses", "consumes": [ "application/json" ], @@ -1195,9 +772,9 @@ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "用户状态列表", + "summary": "User statuses", "responses": { "200": { "description": "OK", @@ -1211,8 +788,9 @@ } } }, - "/super/v1/users/{userID}": { + "/super/v1/users/{id}": { "get": { + "description": "Get user", "consumes": [ "application/json" ], @@ -1220,15 +798,15 @@ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "用户详情", + "summary": "Get user", "parameters": [ { "type": "integer", "format": "int64", - "description": "UserID", - "name": "userID", + "description": "User ID", + "name": "id", "in": "path", "required": true } @@ -1243,8 +821,9 @@ } } }, - "/super/v1/users/{userID}/roles": { + "/super/v1/users/{id}/roles": { "patch": { + "description": "Update user roles", "consumes": [ "application/json" ], @@ -1252,20 +831,20 @@ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "更新用户角色", + "summary": "Update user roles", "parameters": [ { "type": "integer", "format": "int64", - "description": "UserID", - "name": "userID", + "description": "User ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, @@ -1274,11 +853,19 @@ } } ], - "responses": {} + "responses": { + "200": { + "description": "Updated", + "schema": { + "type": "string" + } + } + } } }, - "/super/v1/users/{userID}/status": { + "/super/v1/users/{id}/status": { "patch": { + "description": "Update user status", "consumes": [ "application/json" ], @@ -1286,20 +873,20 @@ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "更新用户状态", + "summary": "Update user status", "parameters": [ { "type": "integer", "format": "int64", - "description": "UserID", - "name": "userID", + "description": "User ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, @@ -1308,11 +895,19 @@ } } ], - "responses": {} + "responses": { + "200": { + "description": "Updated", + "schema": { + "type": "string" + } + } + } } }, - "/super/v1/users/{userID}/tenants": { + "/super/v1/users/{id}/tenants": { "get": { + "description": "List tenants joined by user", "consumes": [ "application/json" ], @@ -1320,83 +915,28 @@ "application/json" ], "tags": [ - "Super" + "User" ], - "summary": "用户加入的租户列表", + "summary": "List user tenants", "parameters": [ { "type": "integer", "format": "int64", - "description": "UserID", - "name": "userID", + "description": "User ID", + "name": "id", "in": "path", "required": true }, - { - "type": "string", - "name": "code", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "string", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" }, - { - "enum": [ - "member", - "tenant_admin" - ], - "type": "string", - "x-enum-varnames": [ - "TenantUserRoleMember", - "TenantUserRoleTenantAdmin" - ], - "description": "Role filters tenant_users.role containing a role (tenant_admin/member).", - "name": "role", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "UserStatusPendingVerify", - "UserStatusVerified", - "UserStatusBanned" - ], - "description": "Status filters tenant_users.status.", - "name": "status", - "in": "query" - }, { "type": "integer", - "name": "tenant_id", + "description": "Page size", + "name": "limit", "in": "query" } ], @@ -1412,7 +952,10 @@ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.UserTenantItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.UserTenantItem" + } } } } @@ -1422,8 +965,133 @@ } } }, + "/t/{tenantCode}/v1/auth/login": { + "post": { + "description": "Login or register user using phone number and OTP", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Auth" + ], + "summary": "Login or Register with OTP", + "parameters": [ + { + "description": "Login form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.LoginForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.LoginResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/auth/otp": { + "post": { + "description": "Send OTP to phone number", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Auth" + ], + "summary": "Send OTP", + "parameters": [ + { + "description": "Phone number", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.SendOTPForm" + } + } + ], + "responses": { + "200": { + "description": "OTP sent", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/comments/{id}/like": { + "post": { + "description": "Like a comment", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Content" + ], + "summary": "Like comment", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Comment ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Liked", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/common/options": { + "get": { + "description": "Get global options (enums)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Get options", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.OptionsResponse" + } + } + } + } + }, "/t/{tenantCode}/v1/contents": { "get": { + "description": "List contents with filtering and pagination", "consumes": [ "application/json" ], @@ -1431,32 +1099,43 @@ "application/json" ], "tags": [ - "Tenant" + "Content" ], - "summary": "内容列表(已发布)", + "summary": "List contents", "parameters": [ { "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Keyword filters by title keyword (LIKE).", + "description": "Search keyword", "name": "keyword", "in": "query" }, { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", + "type": "string", + "description": "Genre", + "name": "genre", "in": "query" }, { "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "format": "int64", + "description": "Filter by creator", + "name": "tenant_id", + "in": "query" + }, + { + "enum": [ + "latest", + "hot", + "price_asc" + ], + "type": "string", + "description": "Sort order", + "name": "sort", + "in": "query" + }, + { + "type": "integer", + "description": "Page number", "name": "page", "in": "query" } @@ -1473,7 +1152,10 @@ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.ContentItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } } } } @@ -1483,8 +1165,9 @@ } } }, - "/t/{tenantCode}/v1/contents/{contentID}": { + "/t/{tenantCode}/v1/contents/{id}": { "get": { + "description": "Get content detail by ID", "consumes": [ "application/json" ], @@ -1492,22 +1175,15 @@ "application/json" ], "tags": [ - "Tenant" + "Content" ], - "summary": "内容详情(可见性+权益校验)", + "summary": "Get content detail", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "ContentID", - "name": "contentID", + "description": "Content ID", + "name": "id", "in": "path", "required": true } @@ -1522,8 +1198,9 @@ } } }, - "/t/{tenantCode}/v1/contents/{contentID}/assets": { + "/t/{tenantCode}/v1/contents/{id}/comments": { "get": { + "description": "Get comments for a content", "consumes": [ "application/json" ], @@ -1531,315 +1208,23 @@ "application/json" ], "tags": [ - "Tenant" + "Content" ], - "summary": "获取正片资源(main role,需要已购或免费)", + "summary": "Get comments", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.ContentAssetsResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/contents/{contentID}/preview": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "获取试看资源(preview role)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.ContentAssetsResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/contents/{contentID}/purchase": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "购买内容(余额支付)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PurchaseContentForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.PurchaseContentResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/join/invite": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TenantJoin" - ], - "summary": "通过邀请码加入租户", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.JoinByInviteForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantUser" - } - } - } - } - }, - "/t/{tenantCode}/v1/join/request": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TenantJoin" - ], - "summary": "提交加入租户申请", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.JoinRequestCreateForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/contents": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "内容列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", + "description": "Content ID", "name": "id", - "in": "query" - }, - { - "type": "string", - "name": "keyword", - "in": "query" + "in": "path", + "required": true }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" - }, - { - "type": "string", - "name": "published_at_from", - "in": "query" - }, - { - "type": "string", - "name": "published_at_to", - "in": "query" - }, - { - "enum": [ - "draft", - "reviewing", - "published", - "unpublished", - "blocked" - ], - "type": "string", - "x-enum-varnames": [ - "ContentStatusDraft", - "ContentStatusReviewing", - "ContentStatusPublished", - "ContentStatusUnpublished", - "ContentStatusBlocked" - ], - "name": "status", - "in": "query" - }, - { - "type": "integer", - "name": "user_id", - "in": "query" - }, - { - "enum": [ - "public", - "tenant_only", - "private" - ], - "type": "string", - "x-enum-varnames": [ - "ContentVisibilityPublic", - "ContentVisibilityTenantOnly", - "ContentVisibilityPrivate" - ], - "name": "visibility", - "in": "query" } ], "responses": { @@ -1854,7 +1239,10 @@ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.AdminContentItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.Comment" + } } } } @@ -1864,6 +1252,7 @@ } }, "post": { + "description": "Post a comment to a content", "consumes": [ "application/json" ], @@ -1871,19 +1260,232 @@ "application/json" ], "tags": [ - "Tenant" + "Content" ], - "summary": "创建内容(草稿)", + "summary": "Post comment", "parameters": [ { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Comment form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CommentCreateForm" + } + } + ], + "responses": { + "200": { + "description": "Comment created", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/contents/{id}/favorite": { + "post": { + "tags": [ + "Content" + ], + "summary": "Add favorite", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Favorited", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "tags": [ + "Content" + ], + "summary": "Remove favorite", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Unfavorited", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/contents/{id}/like": { + "post": { + "tags": [ + "Content" + ], + "summary": "Add like", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Liked", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "tags": [ + "Content" + ], + "summary": "Remove like", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Unliked", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/apply": { + "post": { + "description": "Apply to become a creator", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Apply creator", + "parameters": [ + { + "description": "Apply form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ApplyForm" + } + } + ], + "responses": { + "200": { + "description": "Application submitted", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/contents": { + "get": { + "description": "List creator contents", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "List contents", + "parameters": [ + { + "type": "string", + "description": "Status", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "Genre", + "name": "genre", + "in": "query" + }, + { + "type": "string", + "description": "Keyword", + "name": "keyword", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } + } + } + } + }, + "post": { + "description": "Create/Publish content", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Create content", + "parameters": [ + { + "description": "Content form", "name": "form", "in": "body", "required": true, @@ -1894,16 +1496,17 @@ ], "responses": { "200": { - "description": "OK", + "description": "Created", "schema": { - "$ref": "#/definitions/models.Content" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/management/contents/publish": { - "post": { + "/t/{tenantCode}/v1/creator/contents/{id}": { + "get": { + "description": "Get content details for edit", "consumes": [ "application/json" ], @@ -1911,39 +1514,30 @@ "application/json" ], "tags": [ - "Tenant" + "CreatorCenter" ], - "summary": "内容发布(创建+绑定资源+定价)", + "summary": "Get content", "parameters": [ { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "id", "in": "path", "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentPublishForm" - } } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dto.ContentPublishResponse" + "$ref": "#/definitions/dto.ContentEditDTO" } } } - } - }, - "/t/{tenantCode}/v1/management/contents/{contentID}": { - "patch": { + }, + "put": { + "description": "Update content", "consumes": [ "application/json" ], @@ -1951,27 +1545,20 @@ "application/json" ], "tags": [ - "Tenant" + "CreatorCenter" ], - "summary": "更新内容(标题/描述/状态等)", + "summary": "Update content", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "ContentID", - "name": "contentID", + "description": "Content ID", + "name": "id", "in": "path", "required": true }, { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, @@ -1982,16 +1569,15 @@ ], "responses": { "200": { - "description": "OK", + "description": "Updated", "schema": { - "$ref": "#/definitions/models.Content" + "type": "string" } } } - } - }, - "/t/{tenantCode}/v1/management/contents/{contentID}/assets": { - "post": { + }, + "delete": { + "description": "Delete content", "consumes": [ "application/json" ], @@ -1999,47 +1585,247 @@ "application/json" ], "tags": [ - "Tenant" + "CreatorCenter" ], - "summary": "绑定媒体资源到内容(main/cover/preview)", + "summary": "Delete content", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "ContentID", - "name": "contentID", + "description": "Content ID", + "name": "id", "in": "path", "required": true + } + ], + "responses": { + "200": { + "description": "Deleted", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/dashboard": { + "get": { + "description": "Get creator dashboard stats", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Dashboard stats", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.DashboardStats" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/orders": { + "get": { + "description": "List sales orders", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "List sales orders", + "parameters": [ + { + "type": "string", + "description": "Status", + "name": "status", + "in": "query" }, { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentAssetAttachForm" - } + "type": "string", + "description": "Keyword", + "name": "keyword", + "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/models.ContentAsset" + "type": "array", + "items": { + "$ref": "#/definitions/dto.Order" + } } } } } }, - "/t/{tenantCode}/v1/management/contents/{contentID}/price": { + "/t/{tenantCode}/v1/creator/orders/{id}/refund": { + "post": { + "description": "Process refund", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Process refund", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Order ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Refund form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RefundForm" + } + } + ], + "responses": { + "200": { + "description": "Processed", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/payout-accounts": { + "get": { + "description": "List payout accounts", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "List payout accounts", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.PayoutAccount" + } + } + } + } + }, + "post": { + "description": "Add payout account", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Add payout account", + "parameters": [ + { + "description": "Account form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PayoutAccount" + } + } + ], + "responses": { + "200": { + "description": "Added", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "description": "Remove payout account", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Remove payout account", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Account ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Removed", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/creator/settings": { + "get": { + "description": "Get channel settings", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CreatorCenter" + ], + "summary": "Get settings", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.Settings" + } + } + } + }, "put": { + "description": "Update channel settings", "consumes": [ "application/json" ], @@ -2047,122 +1833,33 @@ "application/json" ], "tags": [ - "Tenant" + "CreatorCenter" ], - "summary": "设置内容价格与折扣", + "summary": "Update settings", "parameters": [ { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - }, - { - "description": "Form", + "description": "Settings form", "name": "form", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.ContentPriceUpsertForm" + "$ref": "#/definitions/dto.Settings" } } ], "responses": { "200": { - "description": "OK", + "description": "Updated", "schema": { - "$ref": "#/definitions/models.ContentPrice" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/management/invites": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "邀请码列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Code 按邀请码模糊过滤(可选):支持部分匹配(like)。", - "name": "code", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "active", - "disabled", - "expired" - ], - "type": "string", - "x-enum-varnames": [ - "TenantInviteStatusActive", - "TenantInviteStatusDisabled", - "TenantInviteStatusExpired" - ], - "description": "Status 按状态过滤(可选):active/disabled/expired。", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.TenantInvite" - } - } - } - ] - } - } - } - }, + "/t/{tenantCode}/v1/creator/withdraw": { "post": { + "description": "Request withdrawal", "consumes": [ "application/json" ], @@ -2170,39 +1867,33 @@ "application/json" ], "tags": [ - "Tenant" + "CreatorCenter" ], - "summary": "创建邀请码(租户管理)", + "summary": "Request withdrawal", "parameters": [ { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", + "description": "Withdraw form", "name": "form", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.AdminTenantInviteCreateForm" + "$ref": "#/definitions/dto.WithdrawForm" } } ], "responses": { "200": { - "description": "OK", + "description": "Withdrawal requested", "schema": { - "$ref": "#/definitions/models.TenantInvite" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/management/invites/{inviteID}/disable": { - "patch": { + "/t/{tenantCode}/v1/creators/{id}/contents": { + "get": { + "description": "List contents of a specific creator", "consumes": [ "application/json" ], @@ -2210,1135 +1901,29 @@ "application/json" ], "tags": [ - "Tenant" + "TenantPublic" ], - "summary": "禁用邀请码(租户管理)", + "summary": "List creator contents", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "InviteID", - "name": "inviteID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantInviteDisableForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantInvite" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/join-requests": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "加入申请列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", + "description": "Tenant ID", + "name": "id", "in": "path", "required": true }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page", "name": "page", "in": "query" }, - { - "enum": [ - "pending", - "approved", - "rejected" - ], - "type": "string", - "x-enum-varnames": [ - "TenantJoinRequestStatusPending", - "TenantJoinRequestStatusApproved", - "TenantJoinRequestStatusRejected" - ], - "description": "Status 按申请状态过滤(可选):pending/approved/rejected。", - "name": "status", - "in": "query" - }, { "type": "integer", - "description": "UserID 按申请人用户ID过滤(可选)。", - "name": "user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/management/join-requests/{requestID}/approve": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "通过加入申请(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "RequestID", - "name": "requestID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/join-requests/{requestID}/reject": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "拒绝加入申请(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "RequestID", - "name": "requestID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/ledgers": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "余额流水列表(租户管理/审计)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "BizRefID 按业务引用ID过滤(可选)。", - "name": "biz_ref_id", - "in": "query" - }, - { - "type": "string", - "description": "BizRefType 按业务引用类型过滤(可选)。\n约定:当前业务写入为 \"order\";未来可扩展为 refund 等。", - "name": "biz_ref_type", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "description": "Limit", "name": "limit", "in": "query" - }, - { - "type": "integer", - "description": "OperatorUserID 按操作者用户ID过滤(可选)。\n典型场景:后台检索“某个管理员发起的退款/调账”等敏感操作流水。", - "name": "operator_user_id", - "in": "query" - }, - { - "type": "integer", - "description": "OrderID 按关联订单过滤(可选)。", - "name": "order_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "debit_purchase", - "credit_refund", - "freeze", - "unfreeze", - "adjustment" - ], - "type": "string", - "x-enum-varnames": [ - "TenantLedgerTypeDebitPurchase", - "TenantLedgerTypeCreditRefund", - "TenantLedgerTypeFreeze", - "TenantLedgerTypeUnfreeze", - "TenantLedgerTypeAdjustment" - ], - "description": "Type 按流水类型过滤(可选)。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 按余额账户归属用户ID过滤(可选)。\n典型场景:查看某个租户成员的资金变化全链路。", - "name": "user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.AdminLedgerItem" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/management/media_assets": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "媒体资源列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom filters assets by created_at \u003e= this time; optional.", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo filters assets by created_at \u003c= this time; optional.", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "uploaded", - "processing", - "ready", - "failed", - "deleted" - ], - "type": "string", - "x-enum-varnames": [ - "MediaAssetStatusUploaded", - "MediaAssetStatusProcessing", - "MediaAssetStatusReady", - "MediaAssetStatusFailed", - "MediaAssetStatusDeleted" - ], - "description": "Status filters by processing status (uploaded/processing/ready/failed/deleted); optional.", - "name": "status", - "in": "query" - }, - { - "enum": [ - "video", - "audio", - "image" - ], - "type": "string", - "x-enum-varnames": [ - "MediaAssetTypeVideo", - "MediaAssetTypeAudio", - "MediaAssetTypeImage" - ], - "description": "Type filters by media type (video/audio/image); optional.", - "name": "type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/management/media_assets/upload_init": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "初始化媒体资源上传(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadInitForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadInitResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/media_assets/{assetID}": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "媒体资源详情(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - }, - "delete": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "删除媒体资源(租户管理,软删)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/media_assets/{assetID}/upload_complete": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "确认上传完成并进入处理(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadCompleteForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/orders": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", - "name": "amount_paid_max", - "in": "query" - }, - { - "type": "integer", - "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", - "name": "amount_paid_min", - "in": "query" - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "integer", - "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", - "name": "content_id", - "in": "query" - }, - { - "type": "string", - "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", - "name": "content_title", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", - "name": "status", - "in": "query" - }, - { - "enum": [ - "content_purchase" - ], - "type": "string", - "x-enum-varnames": [ - "OrderTypeContentPurchase" - ], - "description": "Type 订单类型(可选):content_purchase 等。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.Order" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/management/orders/export": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单导出(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", - "name": "amount_paid_max", - "in": "query" - }, - { - "type": "integer", - "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", - "name": "amount_paid_min", - "in": "query" - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "integer", - "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", - "name": "content_id", - "in": "query" - }, - { - "type": "string", - "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", - "name": "content_title", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", - "name": "status", - "in": "query" - }, - { - "enum": [ - "content_purchase" - ], - "type": "string", - "x-enum-varnames": [ - "OrderTypeContentPurchase" - ], - "description": "Type 订单类型(可选):content_purchase 等。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminOrderExportResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/orders/{orderID}": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单详情(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "OrderID", - "name": "orderID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminOrderDetail" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/orders/{orderID}/refund": { - "post": { - "description": "该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。\n重复请求幂等:订单处于 refunding/refunded 时会返回当前订单状态,不会重复入账/重复回收权益。", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单退款(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "OrderID", - "name": "orderID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminOrderRefundForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.Order" - } - } - } - } - }, - "/t/{tenantCode}/v1/management/users": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "成员列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "member", - "tenant_admin" - ], - "type": "string", - "x-enum-varnames": [ - "TenantUserRoleMember", - "TenantUserRoleTenantAdmin" - ], - "description": "Role 按角色过滤(可选):member/tenant_admin。", - "name": "role", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "UserStatusPendingVerify", - "UserStatusVerified", - "UserStatusBanned" - ], - "description": "Status 按成员状态过滤(可选):pending_verify/verified/banned。", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 按用户ID过滤(可选)。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 按用户名模糊查询(可选,支持包含匹配)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.AdminTenantUserItem" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/management/users/{userID}": { - "delete": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "移除租户成员(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true } ], "responses": { @@ -3351,8 +1936,9 @@ } } }, - "/t/{tenantCode}/v1/management/users/{userID}/join": { - "post": { + "/t/{tenantCode}/v1/me": { + "get": { + "description": "Get current user profile", "consumes": [ "application/json" ], @@ -3360,38 +1946,20 @@ "application/json" ], "tags": [ - "Tenant" - ], - "summary": "添加租户成员(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true - } + "UserCenter" ], + "summary": "Get user profile", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.User" } } } - } - }, - "/t/{tenantCode}/v1/management/users/{userID}/role": { - "patch": { + }, + "put": { + "description": "Update user profile", "consumes": [ "application/json" ], @@ -3399,47 +1967,33 @@ "application/json" ], "tags": [ - "Tenant" + "UserCenter" ], - "summary": "设置成员角色(租户管理)", + "summary": "Update user profile", "parameters": [ { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true - }, - { - "description": "Form", + "description": "Update form", "name": "form", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.AdminTenantUserRoleUpdateForm" + "$ref": "#/definitions/dto.UserUpdate" } } ], "responses": { "200": { - "description": "OK", + "description": "Updated", "schema": { - "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/me": { + "/t/{tenantCode}/v1/me/coupons": { "get": { + "description": "List my coupons", "consumes": [ "application/json" ], @@ -3447,202 +2001,13 @@ "application/json" ], "tags": [ - "Tenant" + "UserCenter" ], - "summary": "当前租户上下文信息", + "summary": "List coupons", "parameters": [ { "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_tenant_dto.MeResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/me/balance": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "当前租户余额信息", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.MeBalanceResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/me/ledgers": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "当前租户余额流水(分页)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.MyLedgerItem" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/media/play": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TenantMedia" - ], - "summary": "媒体播放入口(短时效 token)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Play token", - "name": "token", - "in": "query", - "required": true - } - ], - "responses": {} - } - }, - "/t/{tenantCode}/v1/orders": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "我的订单列表(当前租户)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "ContentID filters orders by purchased content id (via order_items join).", - "name": "content_id", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtFrom filters orders by paid_at \u003e= this time.", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtTo filters orders by paid_at \u003c= this time.", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "description": "Status filters orders by order status.", + "description": "Status (unused, used, expired)", "name": "status", "in": "query" } @@ -3651,26 +2016,18 @@ "200": { "description": "OK", "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.Order" - } - } - } - ] + "type": "array", + "items": { + "$ref": "#/definitions/dto.UserCouponItem" + } } } } } }, - "/t/{tenantCode}/v1/orders/{orderID}": { + "/t/{tenantCode}/v1/me/favorites": { "get": { + "description": "Get favorites", "consumes": [ "application/json" ], @@ -3678,38 +2035,89 @@ "application/json" ], "tags": [ - "Tenant" + "UserCenter" ], - "summary": "我的订单详情(当前租户)", + "summary": "Get favorites", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } + } + } + } + }, + "post": { + "description": "Add to favorites", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Add favorite", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "OrderID", - "name": "orderID", + "description": "Content ID", + "name": "contentId", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Added", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/favorites/{contentId}": { + "delete": { + "description": "Remove from favorites", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Remove favorite", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "contentId", "in": "path", "required": true } ], "responses": { "200": { - "description": "OK", + "description": "Removed", "schema": { - "$ref": "#/definitions/models.Order" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/public/contents": { + "/t/{tenantCode}/v1/me/following": { "get": { + "description": "Get following tenants", "consumes": [ "application/json" ], @@ -3717,32 +2125,161 @@ "application/json" ], "tags": [ - "TenantPublic" + "UserCenter" ], - "summary": "公开内容列表(已发布 + public)", + "summary": "Get following", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.TenantProfile" + } + } + } + } + } + }, + "/t/{tenantCode}/v1/me/library": { + "get": { + "description": "Get purchased content", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Get library", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } + } + } + } + } + }, + "/t/{tenantCode}/v1/me/likes": { + "get": { + "description": "Get liked contents", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Get likes", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } + } + } + } + }, + "post": { + "description": "Like content", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Like content", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "contentId", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Liked", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/likes/{contentId}": { + "delete": { + "description": "Unlike content", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Unlike content", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Content ID", + "name": "contentId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Unliked", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/notifications": { + "get": { + "description": "Get notifications", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Get notifications", "parameters": [ { "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Keyword filters by title keyword (LIKE).", - "name": "keyword", + "description": "Type enum(all, system, order, audit, interaction)", + "name": "type", "in": "query" }, { "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "description": "Page number", "name": "page", "in": "query" } @@ -3759,7 +2296,10 @@ "type": "object", "properties": { "items": { - "$ref": "#/definitions/dto.ContentItem" + "type": "array", + "items": { + "$ref": "#/definitions/dto.Notification" + } } } } @@ -3769,8 +2309,8 @@ } } }, - "/t/{tenantCode}/v1/public/contents/{contentID}": { - "get": { + "/t/{tenantCode}/v1/me/notifications/read-all": { + "post": { "consumes": [ "application/json" ], @@ -3778,22 +2318,37 @@ "application/json" ], "tags": [ - "TenantPublic" + "UserCenter" ], - "summary": "公开内容详情(已发布 + public)", + "summary": "Mark all as read", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/notifications/{id}/read": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Mark as read", "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, { "type": "integer", "format": "int64", - "description": "ContentID", - "name": "contentID", + "description": "Notification ID", + "name": "id", "in": "path", "required": true } @@ -3802,14 +2357,15 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dto.ContentDetail" + "type": "string" } } } } }, - "/t/{tenantCode}/v1/public/contents/{contentID}/assets": { + "/t/{tenantCode}/v1/me/orders": { "get": { + "description": "List user orders", "consumes": [ "application/json" ], @@ -3817,311 +2373,33 @@ "application/json" ], "tags": [ - "TenantPublic" + "UserCenter" ], - "summary": "获取公开正片资源(main role;免费/作者/已购)", + "summary": "List orders", "parameters": [ { "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true + "description": "Status enum(all, unpaid, completed, refund)", + "name": "status", + "in": "query" } ], "responses": { "200": { "description": "OK", - "schema": { - "$ref": "#/definitions/dto.ContentAssetsResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/public/contents/{contentID}/preview": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "TenantPublic" - ], - "summary": "获取公开试看资源(preview role)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.ContentAssetsResponse" - } - } - } - } - }, - "/v1/auth/login": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "用户登录", - "parameters": [ - { - "description": "form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_web_dto.LoginForm" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_web_dto.LoginResponse" - } - } - } - } - }, - "/v1/auth/password/reset": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "找回密码-重置密码", - "parameters": [ - { - "description": "form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasswordResetForm" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/dto.PasswordResetResponse" - } - } - } - } - }, - "/v1/auth/password/reset/sms": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "找回密码-发送短信验证码", - "parameters": [ - { - "description": "form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasswordResetSendSMSForm" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/dto.PasswordResetSendSMSResponse" - } - } - } - } - }, - "/v1/auth/password/reset/verify": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "找回密码-校验验证码", - "parameters": [ - { - "description": "form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.PasswordResetVerifyForm" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/dto.PasswordResetVerifyResponse" - } - } - } - } - }, - "/v1/auth/register": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "用户注册", - "parameters": [ - { - "description": "form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.RegisterForm" - } - } - ], - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_web_dto.LoginResponse" - } - } - } - } - }, - "/v1/auth/token": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "刷新 Token", - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_web_dto.LoginResponse" - } - } - } - } - }, - "/v1/me": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "当前用户信息", - "responses": { - "200": { - "description": "成功", - "schema": { - "$ref": "#/definitions/quyun_v2_app_http_web_dto.MeResponse" - } - } - } - } - }, - "/v1/me/tenants": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Web" - ], - "summary": "我的租户列表", - "responses": { - "200": { - "description": "成功", "schema": { "type": "array", "items": { - "$ref": "#/definitions/dto.MyTenantItem" + "$ref": "#/definitions/dto.Order" } } } } } }, - "/v1/tenant/application": { + "/t/{tenantCode}/v1/me/orders/{id}": { "get": { + "description": "Get user order detail", "consumes": [ "application/json" ], @@ -4129,21 +2407,32 @@ "application/json" ], "tags": [ - "Web" + "UserCenter" + ], + "summary": "Get order detail", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Order ID", + "name": "id", + "in": "path", + "required": true + } ], - "summary": "获取租户申请信息(申请创作者)", "responses": { "200": { - "description": "成功", + "description": "OK", "schema": { - "$ref": "#/definitions/dto.TenantApplicationResponse" + "$ref": "#/definitions/dto.Order" } } } } }, - "/v1/tenant/apply": { + "/t/{tenantCode}/v1/me/realname": { "post": { + "description": "Submit real-name authentication", "consumes": [ "application/json" ], @@ -4151,25 +2440,724 @@ "application/json" ], "tags": [ - "Web" + "UserCenter" ], - "summary": "提交租户申请(申请创作者)", + "summary": "Realname auth", "parameters": [ { - "description": "form", + "description": "Realname form", "name": "form", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.TenantApplyForm" + "$ref": "#/definitions/dto.RealNameForm" } } ], "responses": { "200": { - "description": "成功", + "description": "Submitted", "schema": { - "$ref": "#/definitions/dto.TenantApplicationResponse" + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/wallet": { + "get": { + "description": "Get wallet balance and transactions", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Get wallet", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.WalletResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/me/wallet/recharge": { + "post": { + "description": "Recharge wallet", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "UserCenter" + ], + "summary": "Recharge wallet", + "parameters": [ + { + "description": "Recharge form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RechargeForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.RechargeResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/media-assets/{id}": { + "delete": { + "description": "Delete media asset", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Delete media asset", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Asset ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/orders": { + "post": { + "description": "Create Order", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Transaction" + ], + "summary": "Create Order", + "parameters": [ + { + "description": "Create form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.OrderCreateForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.OrderCreateResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/orders/{id}/pay": { + "post": { + "description": "Pay for order", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Transaction" + ], + "summary": "Pay for order", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Order ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Pay form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.OrderPayForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.OrderPayResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/orders/{id}/status": { + "get": { + "description": "Check order payment status", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Transaction" + ], + "summary": "Check order status", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Order ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.OrderStatusResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/storage/{any}": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/octet-stream" + ], + "tags": [ + "Storage" + ], + "summary": "Download file", + "parameters": [ + { + "type": "string", + "description": "any path", + "name": "any", + "in": "path" + }, + { + "type": "string", + "description": "Expiry", + "name": "expires", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "Signature", + "name": "sign", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "file" + } + } + } + }, + "put": { + "consumes": [ + "application/octet-stream" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Storage" + ], + "summary": "Upload file", + "parameters": [ + { + "type": "string", + "description": "any path", + "name": "any", + "in": "path" + }, + { + "type": "string", + "description": "Expiry", + "name": "expires", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "Signature", + "name": "sign", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/tenants": { + "get": { + "description": "Search tenants", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TenantPublic" + ], + "summary": "List tenants", + "parameters": [ + { + "type": "string", + "description": "Keyword", + "name": "keyword", + "in": "query" + }, + { + "type": "integer", + "description": "Page", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "Limit", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/requests.Pager" + } + } + } + } + }, + "/t/{tenantCode}/v1/tenants/{id}": { + "get": { + "description": "Get tenant public profile", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TenantPublic" + ], + "summary": "Get tenant profile", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Tenant ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.TenantProfile" + } + } + } + } + }, + "/t/{tenantCode}/v1/tenants/{id}/follow": { + "post": { + "description": "Follow a tenant", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TenantPublic" + ], + "summary": "Follow tenant", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Tenant ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Followed", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "description": "Unfollow a tenant", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "TenantPublic" + ], + "summary": "Unfollow tenant", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Tenant ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Unfollowed", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/topics": { + "get": { + "description": "List curated topics", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Content" + ], + "summary": "List topics", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.Topic" + } + } + } + } + } + }, + "/t/{tenantCode}/v1/upload": { + "post": { + "description": "Upload file", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Upload file", + "parameters": [ + { + "type": "file", + "description": "File", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "Type 上传资源类型(如 cover/media/avatar)。", + "name": "type", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.UploadResult" + } + } + } + } + }, + "/t/{tenantCode}/v1/upload/check": { + "get": { + "description": "Check if file hash exists", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Check hash", + "parameters": [ + { + "type": "string", + "description": "File MD5 Hash", + "name": "hash", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.UploadResult" + } + } + } + } + }, + "/t/{tenantCode}/v1/upload/complete": { + "post": { + "description": "Complete multipart upload", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Complete upload", + "parameters": [ + { + "description": "Complete form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.UploadCompleteForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.UploadResult" + } + } + } + } + }, + "/t/{tenantCode}/v1/upload/init": { + "post": { + "description": "Initialize multipart upload", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Init multipart upload", + "parameters": [ + { + "description": "Init form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.UploadInitForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.UploadInitResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/upload/part": { + "post": { + "description": "Upload a part", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Upload part", + "parameters": [ + { + "type": "file", + "description": "Part File", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "integer", + "description": "PartNumber 分片序号(从 1 开始)。", + "name": "part_number", + "in": "formData" + }, + { + "type": "string", + "description": "UploadID 分片上传ID。", + "name": "upload_id", + "in": "formData" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/upload/{uploadId}": { + "delete": { + "description": "Abort multipart upload", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Common" + ], + "summary": "Abort upload", + "parameters": [ + { + "type": "string", + "description": "Upload ID", + "name": "uploadId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/t/{tenantCode}/v1/webhook/payment/notify": { + "post": { + "description": "Payment Webhook", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Transaction" + ], + "summary": "Payment Webhook", + "parameters": [ + { + "description": "Webhook Data", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.WebhookForm" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" } } } @@ -4177,32 +3165,6 @@ } }, "definitions": { - "consts.ContentAccessStatus": { - "type": "string", - "enum": [ - "active", - "revoked", - "expired" - ], - "x-enum-varnames": [ - "ContentAccessStatusActive", - "ContentAccessStatusRevoked", - "ContentAccessStatusExpired" - ] - }, - "consts.ContentAssetRole": { - "type": "string", - "enum": [ - "main", - "cover", - "preview" - ], - "x-enum-varnames": [ - "ContentAssetRoleMain", - "ContentAssetRoleCover", - "ContentAssetRolePreview" - ] - }, "consts.ContentStatus": { "type": "string", "enum": [ @@ -4220,19 +3182,6 @@ "ContentStatusBlocked" ] }, - "consts.ContentVisibility": { - "type": "string", - "enum": [ - "public", - "tenant_only", - "private" - ], - "x-enum-varnames": [ - "ContentVisibilityPublic", - "ContentVisibilityTenantOnly", - "ContentVisibilityPrivate" - ] - }, "consts.Currency": { "type": "string", "enum": [ @@ -4242,58 +3191,17 @@ "CurrencyCNY" ] }, - "consts.DiscountType": { + "consts.Gender": { "type": "string", "enum": [ - "none", - "percent", - "amount" + "male", + "female", + "secret" ], "x-enum-varnames": [ - "DiscountTypeNone", - "DiscountTypePercent", - "DiscountTypeAmount" - ] - }, - "consts.MediaAssetStatus": { - "type": "string", - "enum": [ - "uploaded", - "processing", - "ready", - "failed", - "deleted" - ], - "x-enum-varnames": [ - "MediaAssetStatusUploaded", - "MediaAssetStatusProcessing", - "MediaAssetStatusReady", - "MediaAssetStatusFailed", - "MediaAssetStatusDeleted" - ] - }, - "consts.MediaAssetType": { - "type": "string", - "enum": [ - "video", - "audio", - "image" - ], - "x-enum-varnames": [ - "MediaAssetTypeVideo", - "MediaAssetTypeAudio", - "MediaAssetTypeImage" - ] - }, - "consts.MediaAssetVariant": { - "type": "string", - "enum": [ - "main", - "preview" - ], - "x-enum-varnames": [ - "MediaAssetVariantMain", - "MediaAssetVariantPreview" + "GenderMale", + "GenderFemale", + "GenderSecret" ] }, "consts.OrderStatus": { @@ -4318,64 +3226,27 @@ "consts.OrderType": { "type": "string", "enum": [ - "content_purchase" + "content_purchase", + "recharge", + "withdrawal" ], "x-enum-varnames": [ - "OrderTypeContentPurchase" + "OrderTypeContentPurchase", + "OrderTypeRecharge", + "OrderTypeWithdrawal" ] }, "consts.Role": { "type": "string", "enum": [ "user", - "super_admin" + "super_admin", + "creator" ], "x-enum-varnames": [ "RoleUser", - "RoleSuperAdmin" - ] - }, - "consts.TenantInviteStatus": { - "type": "string", - "enum": [ - "active", - "disabled", - "expired" - ], - "x-enum-varnames": [ - "TenantInviteStatusActive", - "TenantInviteStatusDisabled", - "TenantInviteStatusExpired" - ] - }, - "consts.TenantJoinRequestStatus": { - "type": "string", - "enum": [ - "pending", - "approved", - "rejected" - ], - "x-enum-varnames": [ - "TenantJoinRequestStatusPending", - "TenantJoinRequestStatusApproved", - "TenantJoinRequestStatusRejected" - ] - }, - "consts.TenantLedgerType": { - "type": "string", - "enum": [ - "debit_purchase", - "credit_refund", - "freeze", - "unfreeze", - "adjustment" - ], - "x-enum-varnames": [ - "TenantLedgerTypeDebitPurchase", - "TenantLedgerTypeCreditRefund", - "TenantLedgerTypeFreeze", - "TenantLedgerTypeUnfreeze", - "TenantLedgerTypeAdjustment" + "RoleSuperAdmin", + "RoleCreator" ] }, "consts.TenantStatus": { @@ -4405,11 +3276,15 @@ "consts.UserStatus": { "type": "string", "enum": [ + "active", + "inactive", "pending_verify", "verified", "banned" ], "x-enum-varnames": [ + "UserStatusActive", + "UserStatusInactive", "UserStatusPendingVerify", "UserStatusVerified", "UserStatusBanned" @@ -4419,17 +3294,25 @@ "type": "object", "properties": { "content": { - "$ref": "#/definitions/models.Content" + "$ref": "#/definitions/dto.ContentItem" }, "owner": { "$ref": "#/definitions/dto.AdminContentOwnerLite" }, "price": { - "$ref": "#/definitions/models.ContentPrice" + "$ref": "#/definitions/dto.ContentPrice" }, "status_description": { "type": "string" }, + "tenant": { + "description": "Tenant 内容所属租户信息,用于超管列表展示与跳转。", + "allOf": [ + { + "$ref": "#/definitions/dto.SuperContentTenantLite" + } + ] + }, "visibility_description": { "type": "string" } @@ -4455,290 +3338,106 @@ } } }, - "dto.AdminLedgerItem": { + "dto.ApplyForm": { "type": "object", "properties": { - "ledger": { - "description": "Ledger 流水记录(租户内隔离)。", - "allOf": [ - { - "$ref": "#/definitions/models.TenantLedger" - } - ] + "avatar": { + "description": "Avatar 头像URL。", + "type": "string" }, - "type_description": { - "description": "TypeDescription 流水类型中文说明(用于前端展示)。", + "bio": { + "description": "Bio 频道简介。", + "type": "string" + }, + "name": { + "description": "Name 频道/创作者名称。", "type": "string" } } }, - "dto.AdminMediaAssetUploadCompleteForm": { + "dto.AssetDTO": { "type": "object", "properties": { - "content_type": { - "description": "ContentType is the MIME type observed during upload; optional.\nServer may record it for audit and later processing decisions.", - "type": "string" - }, - "etag": { - "description": "ETag is the storage returned ETag (or similar checksum); optional.\nUsed for audit/debugging and later integrity verification.", - "type": "string" - }, - "file_size": { - "description": "FileSize is the uploaded object size in bytes; optional.\nServer records it for quota/audit and later validation.", + "id": { + "description": "ID 资源ID。", "type": "integer" }, - "sha256": { - "description": "SHA256 is the hex-encoded sha256 of the uploaded object; optional.\nServer records it for integrity checks/deduplication.", - "type": "string" - } - } - }, - "dto.AdminMediaAssetUploadInitForm": { - "type": "object", - "properties": { - "content_type": { - "description": "ContentType is the MIME type reported by the client (e.g. video/mp4); optional.\nServer should not fully trust it, but can use it as a hint for validation/logging.", + "name": { + "description": "Name 文件名。", "type": "string" }, - "file_size": { - "description": "FileSize is the expected file size in bytes; optional.\nUsed for quota/limit checks and audit; client may omit when unknown.", - "type": "integer" - }, - "sha256": { - "description": "SHA256 is the hex-encoded sha256 of the file; optional.\nUsed for deduplication/audit; server may validate it later during upload-complete.", + "role": { + "description": "Role 资源角色(cover/media/preview)。", "type": "string" }, - "source_asset_id": { - "description": "SourceAssetID links a preview product to its main asset; only meaningful when variant=preview.", + "size": { + "description": "Size 文件大小描述。", + "type": "string" + }, + "sort": { + "description": "Sort 排序权重。", "type": "integer" }, "type": { - "description": "Type is the media asset type (video/audio/image).\nUsed to decide processing pipeline and validation rules; required.", + "description": "Type 资源类型(image/audio/video)。", "type": "string" }, - "variant": { - "description": "Variant indicates whether this asset is a main or preview product.\nAllowed: main/preview; default is main.", - "allOf": [ - { - "$ref": "#/definitions/consts.MediaAssetVariant" - } - ] + "url": { + "description": "URL 资源访问地址。", + "type": "string" } } }, - "dto.AdminMediaAssetUploadInitResponse": { + "dto.Comment": { "type": "object", "properties": { - "asset_id": { - "description": "AssetID is the created media asset id.", + "content": { + "description": "Content 评论内容。", + "type": "string" + }, + "create_time": { + "description": "CreateTime 评论创建时间(RFC3339)。", + "type": "string" + }, + "id": { + "description": "ID 评论ID。", "type": "integer" }, - "bucket": { - "description": "Bucket is the target bucket/container; for debugging/audit (may be empty in stub mode).", - "type": "string" - }, - "expires_at": { - "description": "ExpiresAt indicates when UploadURL/FormFields expire; optional.", - "type": "string" - }, - "form_fields": { - "description": "FormFields are form fields required for multipart form upload (S3 POST policy); optional.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "headers": { - "description": "Headers are additional headers required for upload (e.g. signed headers); optional.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "object_key": { - "description": "ObjectKey is the server-generated object key/path; client must NOT choose it.", - "type": "string" - }, - "provider": { - "description": "Provider is the storage provider identifier (e.g. s3/minio/oss/local); for debugging/audit.", - "type": "string" - }, - "upload_url": { - "description": "UploadURL is the URL the client should upload to (signed URL or service endpoint).", - "type": "string" - } - } - }, - "dto.AdminOrderDetail": { - "type": "object", - "properties": { - "order": { - "description": "Order is the order with items preloaded.", - "allOf": [ - { - "$ref": "#/definitions/models.Order" - } - ] - } - } - }, - "dto.AdminOrderExportResponse": { - "type": "object", - "properties": { - "content_type": { - "description": "ContentType 内容类型:当前固定为 text/csv。", - "type": "string" - }, - "csv": { - "description": "CSV CSV 文本内容:UTF-8 编码,包含表头与数据行;前端可直接下载为文件。", - "type": "string" - }, - "filename": { - "description": "Filename 建议文件名:前端可用于下载时的默认文件名。", - "type": "string" - } - } - }, - "dto.AdminOrderRefundForm": { - "type": "object", - "properties": { - "force": { - "description": "Force indicates bypassing the default refund window check (paid_at + 24h).\n强制退款:true 表示绕过默认退款时间窗限制(需审计)。", + "is_liked": { + "description": "IsLiked 当前用户是否点赞该评论。", "type": "boolean" }, - "idempotency_key": { - "description": "IdempotencyKey ensures refund request is processed at most once.\n幂等键:同一笔退款重复请求时返回一致结果,避免重复退款/重复回滚。", - "type": "string" - }, - "reason": { - "description": "Reason is the human-readable refund reason used for audit.\n退款原因:建议必填(由业务侧校验);用于审计与追责。", - "type": "string" - } - } - }, - "dto.AdminTenantInviteCreateForm": { - "type": "object", - "properties": { - "code": { - "description": "Code 邀请码(可选):为空时由后端生成;建议只包含数字/字母,便于人工输入。", - "type": "string" - }, - "expires_at": { - "description": "ExpiresAt 过期时间(可选):为空表示不过期;到期后不可再使用。", - "type": "string" - }, - "max_uses": { - "description": "MaxUses 最大可使用次数(可选):0 表示不限次数;大于 0 时用尽后自动失效。", + "likes": { + "description": "Likes 评论点赞数。", "type": "integer" }, - "remark": { - "description": "Remark 备注(可选):用于审计记录生成目的/投放渠道等。", - "type": "string" - } - } - }, - "dto.AdminTenantInviteDisableForm": { - "type": "object", - "properties": { - "reason": { - "description": "Reason 禁用原因(可选):用于审计与追溯。", - "type": "string" - } - } - }, - "dto.AdminTenantJoinRequestDecideForm": { - "type": "object", - "properties": { - "reason": { - "description": "Reason 审核说明(可选):用于审计记录通过/拒绝原因。", - "type": "string" - } - } - }, - "dto.AdminTenantUserItem": { - "type": "object", - "properties": { - "tenant_user": { - "description": "TenantUser 租户成员关系记录。", - "allOf": [ - { - "$ref": "#/definitions/models.TenantUser" - } - ] - }, - "user": { - "description": "User 用户基础信息(用于展示 username 等)。", - "allOf": [ - { - "$ref": "#/definitions/models.User" - } - ] - } - } - }, - "dto.AdminTenantUserJoinResponse": { - "type": "object", - "properties": { - "tenant_user": { - "description": "TenantUser 租户成员关系记录。", - "allOf": [ - { - "$ref": "#/definitions/models.TenantUser" - } - ] - } - } - }, - "dto.AdminTenantUserRoleUpdateForm": { - "type": "object", - "properties": { - "role": { - "description": "Role 角色:member/tenant_admin。", - "type": "string" - } - } - }, - "dto.ContentAssetAttachForm": { - "type": "object", - "properties": { - "asset_id": { - "description": "AssetID is the media asset id to attach.", + "reply_to": { + "description": "ReplyTo 回复的评论ID(0 表示一级评论)。", "type": "integer" }, - "role": { - "description": "Role indicates how this asset is used (main/cover/preview).", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentAssetRole" - } - ] + "user_avatar": { + "description": "UserAvatar 评论用户头像。", + "type": "string" }, - "sort": { - "description": "Sort controls ordering under the same role.", + "user_id": { + "description": "UserID 评论用户ID。", "type": "integer" + }, + "user_nickname": { + "description": "UserNickname 评论用户昵称。", + "type": "string" } } }, - "dto.ContentAssetsResponse": { + "dto.CommentCreateForm": { "type": "object", "properties": { - "assets": { - "description": "Assets is the list of playable assets for the requested role (preview/main).", - "type": "array", - "items": { - "$ref": "#/definitions/dto.ContentPlayableAsset" - } - }, "content": { - "description": "Content is the content entity.", - "allOf": [ - { - "$ref": "#/definitions/models.Content" - } - ] + "description": "Content 评论正文,不能为空。", + "type": "string" }, - "preview_seconds": { - "description": "PreviewSeconds indicates the max preview duration (only meaningful for preview response).", + "reply_to": { + "description": "ReplyTo 被回复评论ID(0 表示一级评论)。", "type": "integer" } } @@ -4746,400 +3445,564 @@ "dto.ContentCreateForm": { "type": "object", "properties": { - "description": { - "description": "Description is the content description.", + "cover_ids": { + "description": "CoverIDs 封面资源ID集合。", + "type": "array", + "items": { + "type": "integer" + } + }, + "genre": { + "description": "Genre 内容分类/风格。", "type": "string" }, - "preview_seconds": { - "description": "PreviewSeconds controls preview duration (defaults to 60 when omitted).", - "type": "integer" + "key": { + "description": "Key 音乐调性或主音。", + "type": "string" + }, + "media_ids": { + "description": "MediaIDs 媒体资源ID集合(音频/视频/图片)。", + "type": "array", + "items": { + "type": "integer" + } + }, + "price": { + "description": "Price 价格(单位元)。", + "type": "number" + }, + "status": { + "description": "Status 内容状态(draft/published)。", + "type": "string" }, "title": { - "description": "Title is the content title.", + "description": "Title 内容标题。", "type": "string" - }, - "visibility": { - "description": "Visibility controls who can view the content detail (main assets still require free/purchase).", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentVisibility" - } - ] } } }, "dto.ContentDetail": { "type": "object", "properties": { - "content": { - "description": "Content is the content entity.", - "allOf": [ - { - "$ref": "#/definitions/models.Content" - } - ] + "author_avatar": { + "description": "AuthorAvatar 作者头像URL。", + "type": "string" }, - "has_access": { - "description": "HasAccess indicates whether current user can access main assets (free/owner/purchased).", + "author_id": { + "description": "AuthorID 作者用户ID。", + "type": "integer" + }, + "author_is_following": { + "description": "AuthorIsFollowing 当前用户是否关注作者(未登录默认 false)。", "type": "boolean" }, - "price": { - "description": "Price is the current price settings for the content (may be nil if not set).", + "author_name": { + "description": "AuthorName 作者展示名(优先昵称)。", + "type": "string" + }, + "body": { + "description": "Body 详细正文/图文内容(文章类可为空)。", + "type": "string" + }, + "cover": { + "description": "Cover 封面URL(无封面时为空)。", + "type": "string" + }, + "created_at": { + "description": "CreatedAt 创建时间(RFC3339 格式)。", + "type": "string" + }, + "description": { + "description": "Description 内容描述(用于详情页摘要)。", + "type": "string" + }, + "genre": { + "description": "Genre 内容分类/风格标签。", + "type": "string" + }, + "id": { + "description": "ID 内容唯一ID。", + "type": "integer" + }, + "is_favorited": { + "description": "IsFavorited 当前用户是否收藏。", + "type": "boolean" + }, + "is_liked": { + "description": "IsLiked 当前用户是否点赞。", + "type": "boolean" + }, + "is_purchased": { + "description": "IsPurchased 是否已购买(用于内容列表快速判断)。", + "type": "boolean" + }, + "likes": { + "description": "Likes 点赞数统计。", + "type": "integer" + }, + "media_urls": { + "description": "MediaUrls 关联媒体资源(音频/视频/预览)。", + "type": "array", + "items": { + "$ref": "#/definitions/dto.MediaURL" + } + }, + "meta": { + "description": "Meta 内容元信息(曲风/调性/节拍等)。", "allOf": [ { - "$ref": "#/definitions/models.ContentPrice" + "$ref": "#/definitions/dto.Meta" } ] + }, + "price": { + "description": "Price 价格(单位元,免费为 0)。", + "type": "number" + }, + "published_at": { + "description": "PublishedAt 发布时间,未发布为空。", + "type": "string" + }, + "status": { + "description": "Status 内容状态(如 published/unpublished)。", + "type": "string" + }, + "tenant_id": { + "description": "TenantID 内容所属租户ID。", + "type": "integer" + }, + "title": { + "description": "Title 内容标题。", + "type": "string" + }, + "type": { + "description": "Type 内容媒体类型(video/audio/article)。", + "type": "string" + }, + "user_id": { + "description": "UserID 内容作者用户ID(与 author_id 同义,便于后台展示)。", + "type": "integer" + }, + "views": { + "description": "Views 浏览量统计。", + "type": "integer" + }, + "visibility": { + "description": "Visibility 内容可见性(如 public/tenant_only/private)。", + "type": "string" + } + } + }, + "dto.ContentEditDTO": { + "type": "object", + "properties": { + "assets": { + "description": "Assets 资源列表(封面/媒体)。", + "type": "array", + "items": { + "$ref": "#/definitions/dto.AssetDTO" + } + }, + "description": { + "description": "Description 内容简介。", + "type": "string" + }, + "enable_trial": { + "description": "EnableTrial 是否开启试读/试听。", + "type": "boolean" + }, + "genre": { + "description": "Genre 内容分类。", + "type": "string" + }, + "id": { + "description": "ID 内容ID。", + "type": "integer" + }, + "key": { + "description": "Key 音乐调性或主音。", + "type": "string" + }, + "preview_seconds": { + "description": "PreviewSeconds 试看/试听秒数。", + "type": "integer" + }, + "price": { + "description": "Price 价格(单位元)。", + "type": "number" + }, + "status": { + "description": "Status 内容状态。", + "type": "string" + }, + "title": { + "description": "Title 内容标题。", + "type": "string" } } }, "dto.ContentItem": { "type": "object", "properties": { - "content": { - "description": "Content is the content entity.", - "allOf": [ - { - "$ref": "#/definitions/models.Content" - } - ] - }, - "has_access": { - "description": "HasAccess indicates whether current user can access main assets (free/owner/purchased).", - "type": "boolean" - }, - "price": { - "description": "Price is the current price settings for the content (may be nil if not set).", - "allOf": [ - { - "$ref": "#/definitions/models.ContentPrice" - } - ] - } - } - }, - "dto.ContentPlayableAsset": { - "type": "object", - "properties": { - "asset_id": { - "type": "integer" - }, - "expires_at": { - "description": "ExpiresAt indicates when PlayURL/token expires; optional.", + "author_avatar": { + "description": "AuthorAvatar 作者头像URL。", "type": "string" }, - "meta": { - "description": "Meta is a display-safe whitelist (currently passthrough JSON); optional.", - "type": "array", - "items": { - "type": "integer" - } + "author_id": { + "description": "AuthorID 作者用户ID。", + "type": "integer" }, - "play_url": { - "description": "PlayURL is a short-lived URL; do NOT expose bucket/object_key directly.", + "author_is_following": { + "description": "AuthorIsFollowing 当前用户是否关注作者(未登录默认 false)。", + "type": "boolean" + }, + "author_name": { + "description": "AuthorName 作者展示名(优先昵称)。", + "type": "string" + }, + "cover": { + "description": "Cover 封面URL(无封面时为空)。", + "type": "string" + }, + "created_at": { + "description": "CreatedAt 创建时间(RFC3339 格式)。", + "type": "string" + }, + "genre": { + "description": "Genre 内容分类/风格标签。", + "type": "string" + }, + "id": { + "description": "ID 内容唯一ID。", + "type": "integer" + }, + "is_purchased": { + "description": "IsPurchased 是否已购买(用于内容列表快速判断)。", + "type": "boolean" + }, + "likes": { + "description": "Likes 点赞数统计。", + "type": "integer" + }, + "price": { + "description": "Price 价格(单位元,免费为 0)。", + "type": "number" + }, + "published_at": { + "description": "PublishedAt 发布时间,未发布为空。", + "type": "string" + }, + "status": { + "description": "Status 内容状态(如 published/unpublished)。", + "type": "string" + }, + "tenant_id": { + "description": "TenantID 内容所属租户ID。", + "type": "integer" + }, + "title": { + "description": "Title 内容标题。", "type": "string" }, "type": { - "$ref": "#/definitions/consts.MediaAssetType" + "description": "Type 内容媒体类型(video/audio/article)。", + "type": "string" + }, + "user_id": { + "description": "UserID 内容作者用户ID(与 author_id 同义,便于后台展示)。", + "type": "integer" + }, + "views": { + "description": "Views 浏览量统计。", + "type": "integer" + }, + "visibility": { + "description": "Visibility 内容可见性(如 public/tenant_only/private)。", + "type": "string" } } }, - "dto.ContentPriceUpsertForm": { + "dto.ContentPrice": { "type": "object", "properties": { "currency": { - "description": "Currency is fixed to CNY for now.", - "allOf": [ - { - "$ref": "#/definitions/consts.Currency" - } - ] + "description": "Currency 币种(CNY 等)。", + "type": "string" }, "discount_end_at": { - "description": "DiscountEndAt disables discount after this time (optional).", + "description": "DiscountEndAt 折扣结束时间(RFC3339)。", "type": "string" }, "discount_start_at": { - "description": "DiscountStartAt enables discount from this time (optional).", + "description": "DiscountStartAt 折扣开始时间(RFC3339)。", "type": "string" }, "discount_type": { - "description": "DiscountType defines the discount algorithm (none/percent/amount).", - "allOf": [ - { - "$ref": "#/definitions/consts.DiscountType" - } - ] + "description": "DiscountType 折扣类型(amount/percent)。", + "type": "string" }, "discount_value": { - "description": "DiscountValue is interpreted based on DiscountType.", - "type": "integer" + "description": "DiscountValue 折扣值(amount=元,percent=百分比)。", + "type": "number" }, "price_amount": { - "description": "PriceAmount is the base price in cents (CNY 分).", - "type": "integer" - } - } - }, - "dto.ContentPublishForm": { - "type": "object", - "properties": { - "audio_asset_ids": { - "description": "AudioAssetIDs 音频资源 ID 列表:可为空;每个资源必须为 audio/main/ready。", - "type": "array", - "items": { - "type": "integer" - } - }, - "cover_asset_ids": { - "description": "CoverAssetIDs 展示图(封面图)资源 ID 列表:1-3 张;每个资源必须为 image/main/ready。", - "type": "array", - "items": { - "type": "integer" - } - }, - "currency": { - "description": "Currency 币种:当前固定为 CNY;可不传(后端默认 CNY)。", - "allOf": [ - { - "$ref": "#/definitions/consts.Currency" - } - ] - }, - "detail": { - "description": "Detail 详细:用于详情页的长文本;可选;当非空时视为“文字内容”类型存在。", - "type": "string" - }, - "image_asset_ids": { - "description": "ImageAssetIDs 多图内容资源 ID 列表:可为空;每个资源必须为 image/main/ready;数量 \u003e= 2 时视为“多图内容”类型存在。", - "type": "array", - "items": { - "type": "integer" - } - }, - "preview_seconds": { - "description": "PreviewSeconds 试看秒数:仅对 preview 资源生效;默认 60;必须为正整数。", - "type": "integer" - }, - "price_amount": { - "description": "PriceAmount 价格:单位为分;0 表示免费;必填(前端可默认填 0)。", - "type": "integer" - }, - "summary": { - "description": "Summary 简介:用于列表/卡片展示的短文本;可选,建议 \u003c= 256 字符。", - "type": "string" - }, - "tags": { - "description": "Tags 标签:用于分类/检索;字符串数组;会做 trim/去重;可为空。", - "type": "array", - "items": { - "type": "string" - } - }, - "title": { - "description": "Title 标题:用于列表展示与搜索;必填。", - "type": "string" - }, - "video_asset_ids": { - "description": "VideoAssetIDs 视频资源 ID 列表:可为空;每个资源必须为 video/main/ready。", - "type": "array", - "items": { - "type": "integer" - } - }, - "visibility": { - "description": "Visibility 可见性:控制“详情页”可见范围;默认 tenant_only。", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentVisibility" - } - ] - } - } - }, - "dto.ContentPublishResponse": { - "type": "object", - "properties": { - "content": { - "description": "Content 内容主体(包含标题/简介/详细/状态等)。", - "allOf": [ - { - "$ref": "#/definitions/models.Content" - } - ] - }, - "content_types": { - "description": "ContentTypes 内容类型列表:text/audio/video/image/multi_image(用于前端展示)。", - "type": "array", - "items": { - "type": "string" - } - }, - "cover_assets": { - "description": "CoverAssets 封面图绑定结果(role=cover)。", - "type": "array", - "items": { - "$ref": "#/definitions/models.ContentAsset" - } - }, - "main_assets": { - "description": "MainAssets 主资源绑定结果(role=main;可能包含音频/视频/图片)。", - "type": "array", - "items": { - "$ref": "#/definitions/models.ContentAsset" - } - }, - "price": { - "description": "Price 定价信息(单位分)。", - "allOf": [ - { - "$ref": "#/definitions/models.ContentPrice" - } - ] + "description": "PriceAmount 原价金额(单位元)。", + "type": "number" } } }, "dto.ContentUpdateForm": { "type": "object", "properties": { - "description": { - "description": "Description updates the description when provided.", + "cover_ids": { + "description": "CoverIDs 封面资源ID集合。", + "type": "array", + "items": { + "type": "integer" + } + }, + "genre": { + "description": "Genre 内容分类/风格。", "type": "string" }, - "preview_seconds": { - "description": "PreviewSeconds updates preview duration when provided (must be \u003e 0).", + "is_pinned": { + "description": "IsPinned 是否置顶。", + "type": "boolean" + }, + "key": { + "description": "Key 音乐调性或主音。", + "type": "string" + }, + "media_ids": { + "description": "MediaIDs 媒体资源ID集合。", + "type": "array", + "items": { + "type": "integer" + } + }, + "price": { + "description": "Price 价格(单位元,nil 表示不修改)。", + "type": "number" + }, + "status": { + "description": "Status 内容状态(draft/published)。", + "type": "string" + }, + "title": { + "description": "Title 内容标题(为空表示不修改)。", + "type": "string" + } + } + }, + "dto.DashboardStats": { + "type": "object", + "properties": { + "new_messages": { + "description": "NewMessages 新消息数量。", + "type": "integer" + }, + "pending_refunds": { + "description": "PendingRefunds 待处理退款数量。", + "type": "integer" + }, + "total_followers": { + "description": "TotalFollowers 粉丝总数统计。", + "allOf": [ + { + "$ref": "#/definitions/dto.IntStatItem" + } + ] + }, + "total_revenue": { + "description": "TotalRevenue 累计收入统计(单位元)。", + "allOf": [ + { + "$ref": "#/definitions/dto.FloatStatItem" + } + ] + } + } + }, + "dto.FloatStatItem": { + "type": "object", + "properties": { + "trend": { + "description": "Trend 环比/同比变化比例。", + "type": "number" + }, + "value": { + "description": "Value 统计数值(浮点)。", + "type": "number" + } + } + }, + "dto.IntStatItem": { + "type": "object", + "properties": { + "trend": { + "description": "Trend 环比/同比变化比例。", + "type": "number" + }, + "value": { + "description": "Value 统计数值。", + "type": "integer" + } + } + }, + "dto.MediaURL": { + "type": "object", + "properties": { + "duration": { + "description": "Duration 媒体时长(秒),无时长则为 0。", + "type": "integer" + }, + "type": { + "description": "Type 媒体类型(audio/video/image/preview)。", + "type": "string" + }, + "url": { + "description": "URL 媒体资源地址。", + "type": "string" + } + } + }, + "dto.Meta": { + "type": "object", + "properties": { + "beat": { + "description": "Beat 节拍信息(如 4/4)。", + "type": "string" + }, + "key": { + "description": "Key 音乐调性或主音。", + "type": "string" + }, + "role": { + "description": "Role 内容角色/定位(如 demo/主稿)。", + "type": "string" + } + } + }, + "dto.Notification": { + "type": "object", + "properties": { + "content": { + "description": "Content 通知内容。", + "type": "string" + }, + "id": { + "description": "ID 通知ID。", + "type": "integer" + }, + "read": { + "description": "Read 是否已读。", + "type": "boolean" + }, + "time": { + "description": "Time 发送时间(RFC3339)。", + "type": "string" + }, + "title": { + "description": "Title 通知标题。", + "type": "string" + }, + "type": { + "description": "Type 通知类型(system/order/interaction)。", + "type": "string" + } + } + }, + "dto.OptionsResponse": { + "type": "object", + "properties": { + "content_genre": { + "description": "ContentGenre 内容类型/分类选项。", + "type": "array", + "items": { + "$ref": "#/definitions/requests.KV" + } + }, + "content_status": { + "description": "ContentStatus 内容状态选项。", + "type": "array", + "items": { + "$ref": "#/definitions/requests.KV" + } + } + } + }, + "dto.Order": { + "type": "object", + "properties": { + "amount": { + "description": "Amount 实付金额(单位元)。", + "type": "number" + }, + "buyer_avatar": { + "description": "BuyerAvatar 买家头像URL。", + "type": "string" + }, + "buyer_name": { + "description": "BuyerName 买家昵称。", + "type": "string" + }, + "cover": { + "description": "Cover 订单封面图。", + "type": "string" + }, + "create_time": { + "description": "CreateTime 创建时间(RFC3339)。", + "type": "string" + }, + "id": { + "description": "ID 订单ID。", + "type": "integer" + }, + "is_virtual": { + "description": "IsVirtual 是否虚拟订单。", + "type": "boolean" + }, + "items": { + "description": "Items 订单内容明细。", + "type": "array", + "items": { + "$ref": "#/definitions/dto.ContentItem" + } + }, + "pay_time": { + "description": "PayTime 支付时间(RFC3339)。", + "type": "string" + }, + "quantity": { + "description": "Quantity 内容数量。", "type": "integer" }, "status": { - "description": "Status updates the content status when provided (e.g. publish/unpublish).", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentStatus" - } - ] - }, - "title": { - "description": "Title updates the title when provided.", + "description": "Status 订单状态。", "type": "string" }, - "visibility": { - "description": "Visibility updates the visibility when provided.", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentVisibility" - } - ] - } - } - }, - "dto.JoinByInviteForm": { - "type": "object", - "properties": { - "invite_code": { - "description": "InviteCode 邀请码:由租户管理员生成;用户提交后加入对应租户。", - "type": "string" - } - } - }, - "dto.JoinRequestCreateForm": { - "type": "object", - "properties": { - "reason": { - "description": "Reason 申请原因(可选):用于向租户管理员说明申请加入的目的。", - "type": "string" - } - } - }, - "dto.MeBalanceResponse": { - "type": "object", - "properties": { - "balance": { - "description": "Balance 可用余额:可用于购买/消费。", - "type": "integer" - }, - "balance_frozen": { - "description": "BalanceFrozen 冻结余额:用于下单冻结/争议期等。", - "type": "integer" - }, - "currency": { - "description": "Currency 币种:当前固定 CNY(金额单位为分)。", - "allOf": [ - { - "$ref": "#/definitions/consts.Currency" - } - ] - }, - "updated_at": { - "description": "UpdatedAt 更新时间:余额变更时更新。", - "type": "string" - } - } - }, - "dto.MyLedgerItem": { - "type": "object", - "properties": { - "ledger": { - "description": "Ledger 流水记录(租户内隔离)。", - "allOf": [ - { - "$ref": "#/definitions/models.TenantLedger" - } - ] - }, - "type_description": { - "description": "TypeDescription 流水类型中文说明(用于前端展示)。", - "type": "string" - } - } - }, - "dto.MyTenantItem": { - "type": "object", - "properties": { - "is_owner": { - "description": "IsOwner 是否为租户Owner(tenants.user_id == 当前用户)。\n说明:Owner 通常也在 tenant_users 里具备 tenant_admin 角色,但此字段更直观。", - "type": "boolean" - }, - "joined_at": { - "description": "JoinedAt 加入租户时间(tenant_users.created_at)。", - "type": "string" - }, - "member_roles": { - "description": "MemberRoles 当前用户在该租户下的角色(tenant_admin/member 等)。", - "type": "array", - "items": { - "$ref": "#/definitions/consts.TenantUserRole" - } - }, - "member_status": { - "description": "MemberStatus 当前用户在该租户下的成员状态。", - "allOf": [ - { - "$ref": "#/definitions/consts.UserStatus" - } - ] - }, - "tenant_code": { - "description": "TenantCode 租户Code(路由使用:/t/:tenantCode/...)。", + "status_description": { + "description": "StatusDescription 订单状态描述。", "type": "string" }, "tenant_id": { - "description": "TenantID 租户ID(数值型主键)。", + "description": "TenantID 内容所属租户ID。", "type": "integer" }, "tenant_name": { "description": "TenantName 租户名称。", "type": "string" }, - "tenant_status": { - "description": "TenantStatus 租户状态(pending/verified/expired 等)。", - "allOf": [ - { - "$ref": "#/definitions/consts.TenantStatus" - } - ] + "title": { + "description": "Title 订单标题(用于列表展示)。", + "type": "string" }, - "tenant_status_description": { - "description": "TenantStatusDescription 租户状态描述(便于前端展示)。", + "type": { + "description": "Type 订单类型(内容购买/充值等)。", + "type": "string" + }, + "type_description": { + "description": "TypeDescription 订单类型描述。", "type": "string" } } @@ -5155,6 +4018,58 @@ } } }, + "dto.OrderCreateForm": { + "type": "object", + "properties": { + "content_id": { + "description": "ContentID 内容ID。", + "type": "integer" + }, + "idempotency_key": { + "description": "IdempotencyKey 幂等键(同一业务请求需保持一致)。", + "type": "string" + }, + "quantity": { + "description": "Quantity 购买数量(默认 1)。", + "type": "integer" + }, + "sku": { + "description": "Sku 规格标识(可选)。", + "type": "string" + }, + "user_coupon_id": { + "description": "UserCouponID 用户券ID(可选)。", + "type": "integer" + } + } + }, + "dto.OrderCreateResponse": { + "type": "object", + "properties": { + "order_id": { + "description": "OrderID 创建成功的订单ID。", + "type": "integer" + } + } + }, + "dto.OrderPayForm": { + "type": "object", + "properties": { + "method": { + "description": "Method 支付方式(wechat/alipay/balance)。", + "type": "string" + } + } + }, + "dto.OrderPayResponse": { + "type": "object", + "properties": { + "pay_params": { + "description": "PayParams 支付参数(透传给前端)。", + "type": "string" + } + } + }, "dto.OrderStatisticsResponse": { "type": "object", "properties": { @@ -5189,6 +4104,15 @@ } } }, + "dto.OrderStatusResponse": { + "type": "object", + "properties": { + "status": { + "description": "Status 订单状态(unpaid/paid/completed 等)。", + "type": "string" + } + } + }, "dto.OrderTenantLite": { "type": "object", "properties": { @@ -5203,162 +4127,129 @@ } } }, - "dto.PasswordResetForm": { + "dto.PayoutAccount": { "type": "object", "properties": { - "confirmPassword": { - "description": "ConfirmPassword 确认新密码;必须与 Password 一致。", + "account": { + "description": "Account 收款账号。", "type": "string" }, - "password": { - "description": "Password 新密码(明文)。", - "type": "string" - }, - "resetToken": { - "description": "ResetToken 重置令牌;由验证码校验接口返回。", - "type": "string" - } - } - }, - "dto.PasswordResetResponse": { - "type": "object", - "properties": { - "ok": { - "description": "Ok 是否成功。", - "type": "boolean" - } - } - }, - "dto.PasswordResetSendSMSForm": { - "type": "object", - "properties": { - "phone": { - "description": "Phone 手机号;当前版本将其作为用户名使用(users.username)。", - "type": "string" - } - } - }, - "dto.PasswordResetSendSMSResponse": { - "type": "object", - "properties": { - "code": { - "description": "Code 验证码(预留:当前用于前端弹窗展示;正式接入短信后应移除/仅在开发环境返回)。", - "type": "string" - }, - "nextSendSeconds": { - "description": "NextSendSeconds 下次可发送剩余秒数(用于前端 60s 倒计时)。", - "type": "integer" - } - } - }, - "dto.PasswordResetVerifyForm": { - "type": "object", - "properties": { - "code": { - "description": "Code 短信验证码。", - "type": "string" - }, - "phone": { - "description": "Phone 手机号。", - "type": "string" - } - } - }, - "dto.PasswordResetVerifyResponse": { - "type": "object", - "properties": { - "resetToken": { - "description": "ResetToken 重置令牌;验证码校验通过后,用该令牌提交新密码。", - "type": "string" - } - } - }, - "dto.PurchaseContentForm": { - "type": "object", - "properties": { - "idempotency_key": { - "description": "IdempotencyKey is used to ensure the purchase request is processed at most once.\n建议由客户端生成并保持稳定:同一笔购买重复请求时返回相同结果,避免重复扣款/重复下单。", - "type": "string" - } - } - }, - "dto.PurchaseContentResponse": { - "type": "object", - "properties": { - "access": { - "description": "Access is the content access record after purchase grant.", - "allOf": [ - { - "$ref": "#/definitions/models.ContentAccess" - } - ] - }, - "amount_paid": { - "description": "AmountPaid is the final paid amount in cents (CNY 分).", + "id": { + "description": "ID 收款账户ID。", "type": "integer" }, - "item": { - "description": "Item is the single order item of this purchase (current implementation is 1 order -\u003e 1 content).", - "allOf": [ - { - "$ref": "#/definitions/models.OrderItem" - } - ] - }, - "order": { - "description": "Order is the created or existing order record (may be nil for owner/free-path without order).", - "allOf": [ - { - "$ref": "#/definitions/models.Order" - } - ] - } - } - }, - "dto.RegisterForm": { - "type": "object", - "properties": { - "confirmPassword": { - "description": "ConfirmPassword 确认密码;必须与 Password 一致,避免误输入导致无法登录。", + "name": { + "description": "Name 账户名称/开户行。", "type": "string" }, - "password": { - "description": "Password 明文密码;后端会在创建用户时自动加密(bcrypt)。", + "realname": { + "description": "Realname 收款人姓名。", "type": "string" }, - "username": { - "description": "Username 用户名;需全局唯一(users.username);建议仅允许字母/数字/下划线,且长度在合理范围内。", - "type": "string" - }, - "verifyCode": { - "description": "VerifyCode 验证码(预留字段);当前版本仅透传/占位,不做后端校验。", + "type": { + "description": "Type 账户类型(bank/alipay)。", "type": "string" } } }, - "dto.SuperContentItem": { + "dto.RealNameForm": { "type": "object", "properties": { - "content": { - "$ref": "#/definitions/models.Content" - }, - "owner": { - "$ref": "#/definitions/dto.SuperUserLite" - }, - "price": { - "$ref": "#/definitions/models.ContentPrice" - }, - "status_description": { + "id_card": { + "description": "IDCard 身份证号。", "type": "string" }, - "tenant": { - "$ref": "#/definitions/dto.SuperContentTenantLite" - }, - "visibility_description": { + "realname": { + "description": "Realname 真实姓名。", "type": "string" } } }, + "dto.RechargeForm": { + "type": "object", + "properties": { + "amount": { + "description": "Amount 充值金额(单位元)。", + "type": "number" + }, + "method": { + "description": "Method 充值方式(wechat/alipay)。", + "type": "string" + } + } + }, + "dto.RechargeResponse": { + "type": "object", + "properties": { + "order_id": { + "description": "OrderID 充值订单ID。", + "type": "integer" + }, + "pay_params": { + "description": "PayParams 支付参数(透传给前端)。", + "type": "string" + } + } + }, + "dto.RefundForm": { + "type": "object", + "properties": { + "action": { + "description": "Action 处理动作(accept/reject)。", + "type": "string" + }, + "reason": { + "description": "Reason 退款原因/备注。", + "type": "string" + } + } + }, + "dto.Settings": { + "type": "object", + "properties": { + "avatar": { + "description": "Avatar 头像URL。", + "type": "string" + }, + "bio": { + "description": "Bio 频道简介。", + "type": "string" + }, + "cover": { + "description": "Cover 封面图URL。", + "type": "string" + }, + "description": { + "description": "Description 详细描述。", + "type": "string" + }, + "id": { + "description": "ID 租户/频道ID。", + "type": "integer" + }, + "name": { + "description": "Name 频道名称。", + "type": "string" + } + } + }, + "dto.Stats": { + "type": "object", + "properties": { + "contents": { + "description": "Contents 内容数。", + "type": "integer" + }, + "followers": { + "description": "Followers 粉丝数。", + "type": "integer" + }, + "likes": { + "description": "Likes 累计点赞数。", + "type": "integer" + } + } + }, "dto.SuperContentTenantLite": { "type": "object", "properties": { @@ -5380,7 +4271,12 @@ "$ref": "#/definitions/dto.OrderBuyerLite" }, "order": { - "$ref": "#/definitions/models.Order" + "description": "Using SuperOrderItem as base, extend if needed", + "allOf": [ + { + "$ref": "#/definitions/dto.SuperOrderItem" + } + ] }, "tenant": { "$ref": "#/definitions/dto.OrderTenantLite" @@ -5411,12 +4307,22 @@ "id": { "type": "integer" }, + "items": { + "description": "Items 订单明细行,用于展示具体内容与金额拆分。", + "type": "array", + "items": { + "$ref": "#/definitions/dto.SuperOrderItemLine" + } + }, "paid_at": { "type": "string" }, "refunded_at": { "type": "string" }, + "snapshot": { + "description": "Snapshot 订单快照,包含下单时的关键参数与定价信息,便于审计回溯。" + }, "status": { "$ref": "#/definitions/consts.OrderStatus" }, @@ -5434,39 +4340,36 @@ } } }, + "dto.SuperOrderItemLine": { + "type": "object", + "properties": { + "amount_paid": { + "description": "AmountPaid 该明细实付金额(分)。", + "type": "integer" + }, + "content_id": { + "description": "ContentID 购买的内容ID。", + "type": "integer" + }, + "id": { + "description": "ID 订单明细ID。", + "type": "integer" + }, + "snapshot": { + "description": "Snapshot 明细快照,用于展示内容标题等历史信息。" + } + } + }, "dto.SuperOrderRefundForm": { "type": "object", "properties": { "force": { - "description": "Force indicates bypassing the default refund window check (paid_at + 24h).", "type": "boolean" }, "idempotency_key": { - "description": "IdempotencyKey ensures refund request is processed at most once.", "type": "string" }, "reason": { - "description": "Reason is the human-readable refund reason used for audit.", - "type": "string" - } - } - }, - "dto.SuperTenantContentItem": { - "type": "object", - "properties": { - "content": { - "$ref": "#/definitions/models.Content" - }, - "owner": { - "$ref": "#/definitions/dto.SuperUserLite" - }, - "price": { - "$ref": "#/definitions/models.ContentPrice" - }, - "status_description": { - "type": "string" - }, - "visibility_description": { "type": "string" } } @@ -5478,7 +4381,6 @@ ], "properties": { "status": { - "description": "Status supports: unpublished (下架) / blocked (封禁)", "enum": [ "unpublished", "blocked" @@ -5495,7 +4397,7 @@ "type": "object", "properties": { "tenant_user": { - "$ref": "#/definitions/models.TenantUser" + "$ref": "#/definitions/dto.TenantUser" }, "user": { "$ref": "#/definitions/dto.SuperUserLite" @@ -5545,56 +4447,6 @@ } } }, - "dto.TenantApplicationResponse": { - "type": "object", - "properties": { - "createdAt": { - "description": "CreatedAt 申请创建时间(租户记录创建时间)。", - "type": "string" - }, - "hasApplication": { - "description": "HasApplication 是否已提交过申请(或已成为创作者)。", - "type": "boolean" - }, - "status": { - "description": "Status 租户状态(pending_verify/verified/banned)。", - "allOf": [ - { - "$ref": "#/definitions/consts.TenantStatus" - } - ] - }, - "statusDescription": { - "description": "StatusDescription 状态描述(便于前端展示)。", - "type": "string" - }, - "tenantCode": { - "description": "TenantCode 租户 Code。", - "type": "string" - }, - "tenantId": { - "description": "TenantID 租户ID。", - "type": "integer" - }, - "tenantName": { - "description": "TenantName 租户名称。", - "type": "string" - } - } - }, - "dto.TenantApplyForm": { - "type": "object", - "properties": { - "code": { - "description": "Code 租户 ID(用于 URL/系统标识);全局唯一(tenants.code,忽略大小写)。", - "type": "string" - }, - "name": { - "description": "Name 租户名称(展示用)。", - "type": "string" - } - } - }, "dto.TenantCreateForm": { "type": "object", "required": [ @@ -5612,7 +4464,6 @@ "maxLength": 64 }, "duration": { - "description": "Duration 租户有效期(天),从“创建时刻”起算;与续期接口保持一致。", "type": "integer", "enum": [ 7, @@ -5659,6 +4510,7 @@ "type": "string" }, "config": { + "description": "Replace with actual config struct if needed", "type": "array", "items": { "type": "integer" @@ -5674,7 +4526,6 @@ "type": "integer" }, "income_amount_paid_sum": { - "description": "IncomeAmountPaidSum 累计收入金额(单位:分,CNY):按 orders 聚合得到的已支付净收入(不含退款中/已退款订单)。", "type": "integer" }, "name": { @@ -5701,7 +4552,7 @@ "users": { "type": "array", "items": { - "$ref": "#/definitions/models.User" + "$ref": "#/definitions/dto.SuperUserLite" } }, "uuid": { @@ -5720,6 +4571,51 @@ } } }, + "dto.TenantProfile": { + "type": "object", + "properties": { + "avatar": { + "description": "Avatar 头像URL。", + "type": "string" + }, + "bio": { + "description": "Bio 简短简介。", + "type": "string" + }, + "cert_type": { + "description": "CertType 认证类型(personal/enterprise)。", + "type": "string" + }, + "cover": { + "description": "Cover 封面图URL。", + "type": "string" + }, + "description": { + "description": "Description 详细描述。", + "type": "string" + }, + "id": { + "description": "ID 租户ID。", + "type": "integer" + }, + "is_following": { + "description": "IsFollowing 当前用户是否关注。", + "type": "boolean" + }, + "name": { + "description": "Name 租户名称。", + "type": "string" + }, + "stats": { + "description": "Stats 统计信息。", + "allOf": [ + { + "$ref": "#/definitions/dto.Stats" + } + ] + } + } + }, "dto.TenantStatusUpdateForm": { "type": "object", "required": [ @@ -5727,15 +4623,207 @@ ], "properties": { "status": { - "enum": [ - "normal", - "disabled" - ], - "allOf": [ - { - "$ref": "#/definitions/consts.TenantStatus" - } - ] + "$ref": "#/definitions/consts.TenantStatus" + } + } + }, + "dto.TenantUser": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "role": { + "type": "array", + "items": { + "$ref": "#/definitions/consts.TenantUserRole" + } + }, + "status": { + "$ref": "#/definitions/consts.UserStatus" + }, + "tenant_id": { + "type": "integer" + }, + "updated_at": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + } + }, + "dto.Topic": { + "type": "object", + "properties": { + "count": { + "description": "Count 专题内内容数量。", + "type": "integer" + }, + "cover": { + "description": "Cover 专题封面图。", + "type": "string" + }, + "id": { + "description": "ID 专题ID。", + "type": "integer" + }, + "tag": { + "description": "Tag 专题标签(用于筛选/展示)。", + "type": "string" + }, + "title": { + "description": "Title 专题标题。", + "type": "string" + } + } + }, + "dto.Transaction": { + "type": "object", + "properties": { + "amount": { + "description": "Amount 发生金额(单位元)。", + "type": "number" + }, + "date": { + "description": "Date 发生时间(RFC3339)。", + "type": "string" + }, + "id": { + "description": "ID 流水ID。", + "type": "integer" + }, + "title": { + "description": "Title 流水标题/描述。", + "type": "string" + }, + "type": { + "description": "Type 流水类型(income/expense)。", + "type": "string" + } + } + }, + "dto.UploadCompleteForm": { + "type": "object", + "properties": { + "upload_id": { + "description": "UploadID 分片上传ID。", + "type": "string" + } + } + }, + "dto.UploadInitForm": { + "type": "object", + "properties": { + "filename": { + "description": "Filename 原始文件名。", + "type": "string" + }, + "hash": { + "description": "Hash 文件 MD5 哈希(用于秒传校验)。", + "type": "string" + }, + "mime_type": { + "description": "MimeType 文件类型(如 image/png)。", + "type": "string" + }, + "size": { + "description": "Size 文件大小(字节)。", + "type": "integer" + }, + "type": { + "description": "Type 业务类型(如 cover/media/avatar)。", + "type": "string" + } + } + }, + "dto.UploadInitResponse": { + "type": "object", + "properties": { + "chunk_size": { + "description": "ChunkSize 分片大小(字节)。", + "type": "integer" + }, + "key": { + "description": "Key 对象存储Key(S3 直传使用)。", + "type": "string" + }, + "upload_id": { + "description": "UploadID 分片上传ID。", + "type": "string" + } + } + }, + "dto.UploadResult": { + "type": "object", + "properties": { + "filename": { + "description": "Filename 原始文件名。", + "type": "string" + }, + "id": { + "description": "ID 媒体资源ID。", + "type": "integer" + }, + "mime_type": { + "description": "MimeType 文件类型(如 image/png)。", + "type": "string" + }, + "size": { + "description": "Size 文件大小(字节)。", + "type": "integer" + }, + "url": { + "description": "URL 访问地址(包含签名或公共URL)。", + "type": "string" + } + } + }, + "dto.UserCouponItem": { + "type": "object", + "properties": { + "coupon_id": { + "description": "CouponID 券模板ID。", + "type": "integer" + }, + "description": { + "description": "Description 券描述。", + "type": "string" + }, + "end_at": { + "description": "EndAt 过期时间(RFC3339)。", + "type": "string" + }, + "id": { + "description": "ID 用户券ID。", + "type": "integer" + }, + "min_order_amount": { + "description": "MinOrderAmount 使用门槛金额(分)。", + "type": "integer" + }, + "start_at": { + "description": "StartAt 生效时间(RFC3339)。", + "type": "string" + }, + "status": { + "description": "Status 当前状态(可用/已用/过期)。", + "type": "string" + }, + "title": { + "description": "Title 券标题。", + "type": "string" + }, + "type": { + "description": "Type 券类型(满减/折扣)。", + "type": "string" + }, + "value": { + "description": "Value 券面值(分/百分比)。", + "type": "integer" } } }, @@ -5819,15 +4907,7 @@ ], "properties": { "status": { - "enum": [ - "normal", - "disabled" - ], - "allOf": [ - { - "$ref": "#/definitions/consts.UserStatus" - } - ] + "$ref": "#/definitions/consts.UserStatus" } } }, @@ -5872,805 +4952,88 @@ } } }, - "gorm.DeletedAt": { + "dto.UserUpdate": { "type": "object", "properties": { - "time": { + "avatar": { + "description": "Avatar 头像URL。", "type": "string" }, - "valid": { - "description": "Valid is true if Time is not NULL", - "type": "boolean" - } - } - }, - "models.Content": { - "type": "object", - "properties": { - "created_at": { - "description": "创建时间:默认 now();用于审计与排序", + "bio": { + "description": "Bio 个人简介。", "type": "string" }, - "deleted_at": { - "description": "软删除时间:非空表示已删除;对外接口需过滤", + "birthday": { + "description": "Birthday 生日(YYYY-MM-DD)。", + "type": "string" + }, + "gender": { + "description": "Gender 性别(枚举)。", "allOf": [ { - "$ref": "#/definitions/gorm.DeletedAt" + "$ref": "#/definitions/consts.Gender" } ] }, - "description": { - "description": "描述:用于详情页展示;可为空字符串", - "type": "string" - }, - "id": { - "description": "主键ID:自增;用于内容引用", - "type": "integer" - }, - "preview_downloadable": { - "description": "试看是否允许下载:默认 false;当前策略固定为不允许下载(仅 streaming)", - "type": "boolean" - }, - "preview_seconds": { - "description": "试看秒数:默认 60;只对 preview 资源生效;必须为正整数", - "type": "integer" - }, - "published_at": { - "description": "发布时间:首次发布时写入;用于时间窗与排序", - "type": "string" - }, - "status": { - "description": "状态:draft/reviewing/published/unpublished/blocked;published 才对外展示", + "location": { + "description": "Location 地区信息(省/市)。", "allOf": [ { - "$ref": "#/definitions/consts.ContentStatus" + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.Location" } ] }, - "summary": { - "description": "简介:用于列表/卡片展示的短文本;建议 \u003c= 256 字符(由业务校验)", - "type": "string" - }, - "tags": { - "description": "标签:JSON 数组(字符串列表);用于分类/检索与聚合展示", - "type": "array", - "items": { - "type": "integer" - } - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id", - "type": "integer" - }, - "title": { - "description": "标题:用于列表展示与搜索;建议限制长度(由业务校验)", - "type": "string" - }, - "updated_at": { - "description": "更新时间:默认 now();编辑内容时写入", - "type": "string" - }, - "user_id": { - "description": "用户ID:内容创建者/发布者;用于权限与审计(例如私有内容仅作者可见)", - "type": "integer" - }, - "visibility": { - "description": "可见性:public/tenant_only/private;仅控制详情可见,正片资源仍需按价格/权益校验", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentVisibility" - } - ] - } - } - }, - "models.ContentAccess": { - "type": "object", - "properties": { - "content_id": { - "description": "内容ID:权益对应内容;唯一约束 (tenant_id, user_id, content_id)", - "type": "integer" - }, - "created_at": { - "description": "创建时间:默认 now();用于审计", - "type": "string" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "order_id": { - "description": "订单ID:产生该权益的订单;可为空(例如后台补发/迁移)", - "type": "integer" - }, - "revoked_at": { - "description": "撤销时间:当 status=revoked 时写入;用于审计与追责", - "type": "string" - }, - "status": { - "description": "权益状态:active/revoked/expired;revoked 表示立即失效(例如退款/违规)", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentAccessStatus" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离;与内容、用户归属一致", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now();更新 status 时写入", - "type": "string" - }, - "user_id": { - "description": "用户ID:权益所属用户;用于访问校验", - "type": "integer" - } - } - }, - "models.ContentAsset": { - "type": "object", - "properties": { - "asset_id": { - "description": "资源ID:关联 media_assets.id;用于查询资源归属内容", - "type": "integer" - }, - "content_id": { - "description": "内容ID:关联 contents.id;用于查询内容下资源列表", - "type": "integer" - }, - "created_at": { - "description": "创建时间:默认 now();用于审计", - "type": "string" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "role": { - "description": "资源角色:main/cover/preview;preview 必须为独立资源以满足禁下载与防绕过", - "allOf": [ - { - "$ref": "#/definitions/consts.ContentAssetRole" - } - ] - }, - "sort": { - "description": "排序:同一 role 下的展示顺序,数值越小越靠前", - "type": "integer" - }, - "tenant_id": { - "description": "租户ID:多租户隔离;必须与 content_id、asset_id 所属租户一致", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now();更新 sort/role 时写入", - "type": "string" - }, - "user_id": { - "description": "用户ID:操作人/绑定人;用于审计(通常为租户管理员或作者)", - "type": "integer" - } - } - }, - "models.ContentPrice": { - "type": "object", - "properties": { - "content_id": { - "description": "内容ID:唯一约束 (tenant_id, content_id);一个内容在一个租户内仅一份定价", - "type": "integer" - }, - "created_at": { - "description": "创建时间:默认 now();用于审计", - "type": "string" - }, - "currency": { - "description": "币种:当前固定 CNY;金额单位为分", - "allOf": [ - { - "$ref": "#/definitions/consts.Currency" - } - ] - }, - "discount_end_at": { - "description": "折扣结束时间:可为空;为空表示长期有效(由业务逻辑解释)", - "type": "string" - }, - "discount_start_at": { - "description": "折扣开始时间:可为空;为空表示立即生效(由业务逻辑解释)", - "type": "string" - }, - "discount_type": { - "description": "折扣类型:none/percent/amount;仅影响下单时成交价,需写入订单快照", - "allOf": [ - { - "$ref": "#/definitions/consts.DiscountType" - } - ] - }, - "discount_value": { - "description": "折扣值:percent=0-100(按业务校验);amount=分;none 时忽略", - "type": "integer" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "price_amount": { - "description": "基础价格:分;0 表示免费(可直接访问正片资源)", - "type": "integer" - }, - "tenant_id": { - "description": "租户ID:多租户隔离;与内容归属一致", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now();更新价格/折扣时写入", - "type": "string" - }, - "user_id": { - "description": "用户ID:设置/更新价格的操作人(通常为 tenant_admin);用于审计", - "type": "integer" - } - } - }, - "models.MediaAsset": { - "type": "object", - "properties": { - "bucket": { - "description": "存储桶:对象所在 bucket;与 provider 组合确定存储定位", - "type": "string" - }, - "created_at": { - "description": "创建时间:默认 now();用于审计与排序", - "type": "string" - }, - "deleted_at": { - "description": "软删除时间:非空表示已删除;对外接口需过滤", - "allOf": [ - { - "$ref": "#/definitions/gorm.DeletedAt" - } - ] - }, - "id": { - "description": "主键ID:自增;仅用于内部关联", - "type": "integer" - }, - "meta": { - "description": "元数据:JSON;包含 hash、duration、width、height、bitrate、codec 等;用于展示与计费/风控", - "type": "array", - "items": { - "type": "integer" - } - }, - "object_key": { - "description": "对象键:对象在 bucket 内的 key;不得暴露可长期复用的直链(通过签名URL/token下发)", - "type": "string" - }, - "provider": { - "description": "存储提供方:例如 s3/minio/oss;便于多存储扩展", - "type": "string" - }, - "source_asset_id": { - "description": "派生来源资源ID:preview 产物可指向对应 main 资源;用于建立 preview/main 的 1:1 追溯关系", - "type": "integer" - }, - "status": { - "description": "处理状态:uploaded/processing/ready/failed/deleted;ready 才可被内容引用对外提供", - "allOf": [ - { - "$ref": "#/definitions/consts.MediaAssetStatus" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id", - "type": "integer" - }, - "type": { - "description": "资源类型:video/audio/image;决定后续处理流程(转码/缩略图/封面等)", - "allOf": [ - { - "$ref": "#/definitions/consts.MediaAssetType" - } - ] - }, - "updated_at": { - "description": "更新时间:默认 now();更新状态/元数据时写入", - "type": "string" - }, - "user_id": { - "description": "用户ID:资源上传者;用于审计与权限控制", - "type": "integer" - }, - "variant": { - "description": "产物类型:main/preview;用于强制试看资源必须绑定独立产物,避免用正片绕过", - "allOf": [ - { - "$ref": "#/definitions/consts.MediaAssetVariant" - } - ] - } - } - }, - "models.Order": { - "type": "object", - "properties": { - "amount_discount": { - "description": "优惠金额:分;amount_paid = amount_original - amount_discount(下单时快照)", - "type": "integer" - }, - "amount_original": { - "description": "原价金额:分;未折扣前金额(用于展示与对账)", - "type": "integer" - }, - "amount_paid": { - "description": "实付金额:分;从租户内余额扣款的金额(下单时快照)", - "type": "integer" - }, - "created_at": { - "description": "创建时间:默认 now();用于审计与排序", - "type": "string" - }, - "currency": { - "description": "币种:当前固定 CNY;金额单位为分", - "allOf": [ - { - "$ref": "#/definitions/consts.Currency" - } - ] - }, - "id": { - "description": "主键ID:自增;用于关联订单明细、账本流水、权益等", - "type": "integer" - }, - "idempotency_key": { - "description": "幂等键:同一租户同一用户同一业务请求可用;用于防重复下单/重复扣款(建议由客户端生成)", - "type": "string" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/models.OrderItem" - } - }, - "paid_at": { - "description": "支付/扣款完成时间:余额支付在 debit_purchase 成功后写入", - "type": "string" - }, - "refund_forced": { - "description": "是否强制退款:true 表示租户管理侧绕过时间窗执行退款(需审计)", - "type": "boolean" - }, - "refund_operator_user_id": { - "description": "退款操作人用户ID:租户管理员/系统;用于审计与追责", - "type": "integer" - }, - "refund_reason": { - "description": "退款原因:后台/用户发起退款的原因说明;用于审计", - "type": "string" - }, - "refunded_at": { - "description": "退款完成时间:退款落账成功后写入", - "type": "string" - }, - "snapshot": { - "description": "订单快照:JSON;建议包含 content 标题/定价/折扣、请求来源等,避免改价影响历史展示", - "allOf": [ - { - "$ref": "#/definitions/types.JSONType-fields_OrdersSnapshot" - } - ] - }, - "status": { - "description": "订单状态:created/paid/refunding/refunded/canceled/failed;状态变更需与账本/权益保持一致", - "allOf": [ - { - "$ref": "#/definitions/consts.OrderStatus" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id", - "type": "integer" - }, - "type": { - "description": "订单类型:content_purchase(购买内容)等;当前默认 content_purchase", - "allOf": [ - { - "$ref": "#/definitions/consts.OrderType" - } - ] - }, - "updated_at": { - "description": "更新时间:默认 now();状态变更/退款写入时更新", - "type": "string" - }, - "user_id": { - "description": "用户ID:下单用户(buyer);余额扣款与权益归属以该 user_id 为准", - "type": "integer" - } - } - }, - "models.OrderItem": { - "type": "object", - "properties": { - "amount_paid": { - "description": "该行实付金额:分;通常等于订单 amount_paid(单内容场景)", - "type": "integer" - }, - "content": { - "$ref": "#/definitions/models.Content" - }, - "content_id": { - "description": "内容ID:关联 contents.id;用于生成/撤销 content_access", - "type": "integer" - }, - "content_user_id": { - "description": "内容作者用户ID:用于后续分成/对账扩展;当前可为 0 或写入内容创建者", - "type": "integer" - }, - "created_at": { - "description": "创建时间:默认 now()", - "type": "string" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "order": { - "$ref": "#/definitions/models.Order" - }, - "order_id": { - "description": "订单ID:关联 orders.id;用于聚合订单明细", - "type": "integer" - }, - "snapshot": { - "description": "内容快照:JSON;建议包含 title/price/discount 等,用于历史展示与审计", - "allOf": [ - { - "$ref": "#/definitions/types.JSONType-fields_OrderItemsSnapshot" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;必须与 orders.tenant_id 一致", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now()", - "type": "string" - }, - "user_id": { - "description": "用户ID:下单用户(buyer);冗余字段用于查询加速与审计", - "type": "integer" - } - } - }, - "models.Tenant": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "config": { - "type": "array", - "items": { - "type": "integer" - } - }, - "created_at": { - "type": "string" - }, - "expired_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "status": { - "$ref": "#/definitions/consts.TenantStatus" - }, - "updated_at": { - "type": "string" - }, - "user_id": { - "type": "integer" - }, - "users": { - "type": "array", - "items": { - "$ref": "#/definitions/models.User" - } - }, - "uuid": { + "nickname": { + "description": "Nickname 昵称。", "type": "string" } } }, - "models.TenantInvite": { - "type": "object", - "properties": { - "code": { - "description": "邀请码:用户加入租户时提交;同一租户内唯一", - "type": "string" - }, - "created_at": { - "description": "创建时间:默认 now()", - "type": "string" - }, - "disabled_at": { - "description": "禁用时间:租户管理员禁用该邀请的时间(UTC)", - "type": "string" - }, - "disabled_operator_user_id": { - "description": "禁用操作人用户ID:租户管理员(审计用)", - "type": "integer" - }, - "expires_at": { - "description": "过期时间:到期后不可再使用(UTC);为空表示不过期", - "type": "string" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "max_uses": { - "description": "最大可使用次数:0 表示不限制;\u003e0 时 used_count 达到该值后视为失效", - "type": "integer" - }, - "remark": { - "description": "备注:生成/禁用原因等(审计用)", - "type": "string" - }, - "status": { - "description": "邀请状态:active/disabled/expired;expired 也可由 expires_at 推导,业务侧需保持一致", - "allOf": [ - { - "$ref": "#/definitions/consts.TenantInviteStatus" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now()", - "type": "string" - }, - "used_count": { - "description": "已使用次数:每次成功加入时 +1;需事务保证并发下不超发", - "type": "integer" - }, - "user_id": { - "description": "创建人用户ID:生成邀请码的租户管理员(审计用)", - "type": "integer" - } - } - }, - "models.TenantJoinRequest": { - "type": "object", - "properties": { - "created_at": { - "description": "创建时间:默认 now()", - "type": "string" - }, - "decided_at": { - "description": "处理时间:审核通过/拒绝时记录(UTC)", - "type": "string" - }, - "decided_operator_user_id": { - "description": "处理人用户ID:租户管理员(审计用)", - "type": "integer" - }, - "decided_reason": { - "description": "处理说明:管理员通过/拒绝的原因(可选,审计用)", - "type": "string" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "reason": { - "description": "申请原因:用户填写的加入说明(可选)", - "type": "string" - }, - "status": { - "description": "申请状态:pending/approved/rejected;状态变更需记录 decided_at 与 decided_operator_user_id", - "allOf": [ - { - "$ref": "#/definitions/consts.TenantJoinRequestStatus" - } - ] - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id", - "type": "integer" - }, - "updated_at": { - "description": "更新时间:默认 now()", - "type": "string" - }, - "user_id": { - "description": "申请人用户ID:发起加入申请的用户", - "type": "integer" - } - } - }, - "models.TenantLedger": { - "type": "object", - "properties": { - "amount": { - "description": "流水金额:分/最小货币单位;通常为正数,方向由 type 决定(由业务层约束)", - "type": "integer" - }, - "balance_after": { - "description": "变更后可用余额:用于审计与对账回放", - "type": "integer" - }, - "balance_before": { - "description": "变更前可用余额:用于审计与对账回放", - "type": "integer" - }, - "biz_ref_id": { - "description": "业务引用ID:与 biz_ref_type 配合使用(例如 orders.id);用于对账与审计", - "type": "integer" - }, - "biz_ref_type": { - "description": "业务引用类型:order/refund/etc;与 biz_ref_id 组成可选的结构化幂等/追溯键", - "type": "string" - }, - "created_at": { - "description": "创建时间:默认 now()", - "type": "string" - }, - "frozen_after": { - "description": "变更后冻结余额:用于审计与对账回放", - "type": "integer" - }, - "frozen_before": { - "description": "变更前冻结余额:用于审计与对账回放", - "type": "integer" - }, - "id": { - "description": "主键ID:自增", - "type": "integer" - }, - "idempotency_key": { - "description": "幂等键:同一租户同一用户同一业务操作固定;用于防止重复落账(建议由业务层生成)", - "type": "string" - }, - "operator_user_id": { - "description": "操作者用户ID:谁触发该流水(admin/buyer/system);用于审计与追责;可为空(历史数据或无法识别时)", - "type": "integer" - }, - "order": { - "$ref": "#/definitions/models.Order" - }, - "order_id": { - "description": "关联订单ID:购买/退款类流水应关联 orders.id;非订单类可为空", - "type": "integer" - }, - "remark": { - "description": "备注:业务说明/后台操作原因等;用于审计", - "type": "string" - }, - "tenant_id": { - "description": "租户ID:多租户隔离关键字段;必须与 tenant_users.tenant_id 一致", - "type": "integer" - }, - "type": { - "description": "流水类型:debit_purchase/credit_refund/freeze/unfreeze/adjustment;不同类型决定余额/冻结余额的变更方向", - "allOf": [ - { - "$ref": "#/definitions/consts.TenantLedgerType" - } - ] - }, - "updated_at": { - "description": "更新时间:默认 now()", - "type": "string" - }, - "user_id": { - "description": "用户ID:余额账户归属用户;对应 tenant_users.user_id", - "type": "integer" - } - } - }, - "models.TenantUser": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "role": { - "type": "array", - "items": { - "$ref": "#/definitions/consts.TenantUserRole" - } - }, - "status": { - "$ref": "#/definitions/consts.UserStatus" - }, - "tenant_id": { - "type": "integer" - }, - "updated_at": { - "type": "string" - }, - "user_id": { - "type": "integer" - } - } - }, - "models.User": { + "dto.WalletResponse": { "type": "object", "properties": { "balance": { - "description": "全局可用余额:分/最小货币单位;用户在所有已加入租户内共享该余额;默认 0", - "type": "integer" + "description": "Balance 账户余额(单位元)。", + "type": "number" }, - "balance_frozen": { - "description": "全局冻结余额:分/最小货币单位;用于下单冻结等;默认 0", - "type": "integer" - }, - "created_at": { - "type": "string" - }, - "deleted_at": { - "$ref": "#/definitions/gorm.DeletedAt" - }, - "id": { - "type": "integer" - }, - "metas": { + "transactions": { + "description": "Transactions 交易流水列表。", "type": "array", "items": { - "type": "integer" + "$ref": "#/definitions/dto.Transaction" } + } + } + }, + "dto.WithdrawForm": { + "type": "object", + "properties": { + "account_id": { + "description": "AccountID 收款账户ID。", + "type": "integer" }, - "owned": { - "$ref": "#/definitions/models.Tenant" + "amount": { + "description": "Amount 提现金额(单位元)。", + "type": "number" }, - "password": { - "type": "string" - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/consts.Role" - } - }, - "status": { - "$ref": "#/definitions/consts.UserStatus" - }, - "tenants": { - "type": "array", - "items": { - "$ref": "#/definitions/models.Tenant" - } - }, - "updated_at": { - "type": "string" - }, - "username": { - "type": "string" - }, - "verified_at": { + "method": { + "description": "Method 提现方式(wallet/external)。", "type": "string" } } }, - "quyun_v2_app_http_super_dto.LoginForm": { + "quyun_v2_app_http_super_v1_dto.Location": { + "type": "object", + "properties": { + "city": { + "type": "string" + }, + "province": { + "type": "string" + } + } + }, + "quyun_v2_app_http_super_v1_dto.LoginForm": { "type": "object", "properties": { "password": { @@ -6681,102 +5044,162 @@ } } }, - "quyun_v2_app_http_super_dto.LoginResponse": { + "quyun_v2_app_http_super_v1_dto.LoginResponse": { "type": "object", "properties": { "token": { "type": "string" - } - } - }, - "quyun_v2_app_http_tenant_dto.MeResponse": { - "type": "object", - "properties": { - "tenant": { - "description": "Tenant is the resolved tenant by `tenantCode`.", - "allOf": [ - { - "$ref": "#/definitions/models.Tenant" - } - ] - }, - "tenant_user": { - "description": "TenantUser is the membership record of the authenticated user within the tenant.", - "allOf": [ - { - "$ref": "#/definitions/models.TenantUser" - } - ] }, "user": { - "description": "User is the authenticated user derived from JWT `user_id`.", - "allOf": [ - { - "$ref": "#/definitions/models.User" - } - ] + "$ref": "#/definitions/quyun_v2_app_http_super_v1_dto.User" } } }, - "quyun_v2_app_http_web_dto.LoginForm": { + "quyun_v2_app_http_super_v1_dto.User": { "type": "object", "properties": { - "password": { - "description": "Password 明文密码;后端会与 users.password 的 bcrypt hash 做比对。", + "avatar": { "type": "string" }, - "username": { - "description": "Username 用户名;必须与数据库 users.username 精确匹配。", + "balance": { + "type": "number" + }, + "bio": { + "type": "string" + }, + "birthday": { + "description": "YYYY-MM-DD", + "type": "string" + }, + "gender": { + "$ref": "#/definitions/consts.Gender" + }, + "id": { + "type": "integer" + }, + "is_real_name_verified": { + "type": "boolean" + }, + "location": { + "$ref": "#/definitions/quyun_v2_app_http_super_v1_dto.Location" + }, + "nickname": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "points": { + "type": "integer" + } + } + }, + "quyun_v2_app_http_v1_dto.Location": { + "type": "object", + "properties": { + "city": { + "description": "City 城市名称。", + "type": "string" + }, + "province": { + "description": "Province 省份名称。", "type": "string" } } }, - "quyun_v2_app_http_web_dto.LoginResponse": { + "quyun_v2_app_http_v1_dto.LoginForm": { + "type": "object", + "properties": { + "otp": { + "description": "OTP 短信验证码。", + "type": "string" + }, + "phone": { + "description": "Phone 手机号(登录账号)。", + "type": "string" + } + } + }, + "quyun_v2_app_http_v1_dto.LoginResponse": { "type": "object", "properties": { "token": { - "description": "Token JWT 访问令牌;前端应以 `Authorization: Bearer \u003ctoken\u003e` 方式携带。", + "description": "Token 登录成功后的 JWT。", + "type": "string" + }, + "user": { + "description": "User 当前登录用户信息。", + "allOf": [ + { + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.User" + } + ] + } + } + }, + "quyun_v2_app_http_v1_dto.SendOTPForm": { + "type": "object", + "properties": { + "phone": { + "description": "Phone 手机号(用于发送验证码)。", "type": "string" } } }, - "quyun_v2_app_http_web_dto.MeResponse": { + "quyun_v2_app_http_v1_dto.User": { "type": "object", "properties": { - "created_at": { - "description": "CreatedAt 用户创建时间。", + "avatar": { + "description": "Avatar 头像URL。", "type": "string" }, - "id": { - "description": "ID 用户ID(全局唯一)。", - "type": "integer" + "balance": { + "description": "Balance 余额(单位元)。", + "type": "number" }, - "roles": { - "description": "Roles 用户全局角色数组(如 user/super_admin 等)。", - "type": "array", - "items": { - "$ref": "#/definitions/consts.Role" - } + "bio": { + "description": "Bio 个人简介。", + "type": "string" }, - "status": { - "description": "Status 用户状态(active/verified/banned 等)。", + "birthday": { + "description": "Birthday 生日(YYYY-MM-DD)。", + "type": "string" + }, + "gender": { + "description": "Gender 性别(枚举)。", "allOf": [ { - "$ref": "#/definitions/consts.UserStatus" + "$ref": "#/definitions/consts.Gender" } ] }, - "status_description": { - "description": "StatusDescription 用户状态描述(便于前端展示)。", + "id": { + "description": "ID 用户ID。", + "type": "integer" + }, + "is_real_name_verified": { + "description": "IsRealNameVerified 是否完成实名认证。", + "type": "boolean" + }, + "location": { + "description": "Location 地区信息(省/市)。", + "allOf": [ + { + "$ref": "#/definitions/quyun_v2_app_http_v1_dto.Location" + } + ] + }, + "nickname": { + "description": "Nickname 昵称。", "type": "string" }, - "updated_at": { - "description": "UpdatedAt 用户更新时间。", + "phone": { + "description": "Phone 绑定手机号。", "type": "string" }, - "username": { - "description": "Username 用户名。", - "type": "string" + "points": { + "description": "Points 积分余额。", + "type": "integer" } } }, @@ -6812,11 +5235,16 @@ } } }, - "types.JSONType-fields_OrderItemsSnapshot": { - "type": "object" - }, - "types.JSONType-fields_OrdersSnapshot": { - "type": "object" + "v1.WebhookForm": { + "type": "object", + "properties": { + "external_id": { + "type": "string" + }, + "order_id": { + "type": "integer" + } + } } }, "securityDefinitions": { diff --git a/backend/docs/swagger.yaml b/backend/docs/swagger.yaml index 3a96783..60d4d18 100644 --- a/backend/docs/swagger.yaml +++ b/backend/docs/swagger.yaml @@ -1,25 +1,5 @@ basePath: / definitions: - consts.ContentAccessStatus: - enum: - - active - - revoked - - expired - type: string - x-enum-varnames: - - ContentAccessStatusActive - - ContentAccessStatusRevoked - - ContentAccessStatusExpired - consts.ContentAssetRole: - enum: - - main - - cover - - preview - type: string - x-enum-varnames: - - ContentAssetRoleMain - - ContentAssetRoleCover - - ContentAssetRolePreview consts.ContentStatus: enum: - draft @@ -34,64 +14,22 @@ definitions: - ContentStatusPublished - ContentStatusUnpublished - ContentStatusBlocked - consts.ContentVisibility: - enum: - - public - - tenant_only - - private - type: string - x-enum-varnames: - - ContentVisibilityPublic - - ContentVisibilityTenantOnly - - ContentVisibilityPrivate consts.Currency: enum: - CNY type: string x-enum-varnames: - CurrencyCNY - consts.DiscountType: + consts.Gender: enum: - - none - - percent - - amount + - male + - female + - secret type: string x-enum-varnames: - - DiscountTypeNone - - DiscountTypePercent - - DiscountTypeAmount - consts.MediaAssetStatus: - enum: - - uploaded - - processing - - ready - - failed - - deleted - type: string - x-enum-varnames: - - MediaAssetStatusUploaded - - MediaAssetStatusProcessing - - MediaAssetStatusReady - - MediaAssetStatusFailed - - MediaAssetStatusDeleted - consts.MediaAssetType: - enum: - - video - - audio - - image - type: string - x-enum-varnames: - - MediaAssetTypeVideo - - MediaAssetTypeAudio - - MediaAssetTypeImage - consts.MediaAssetVariant: - enum: - - main - - preview - type: string - x-enum-varnames: - - MediaAssetVariantMain - - MediaAssetVariantPreview + - GenderMale + - GenderFemale + - GenderSecret consts.OrderStatus: enum: - created @@ -111,51 +49,23 @@ definitions: consts.OrderType: enum: - content_purchase + - recharge + - withdrawal type: string x-enum-varnames: - OrderTypeContentPurchase + - OrderTypeRecharge + - OrderTypeWithdrawal consts.Role: enum: - user - super_admin + - creator type: string x-enum-varnames: - RoleUser - RoleSuperAdmin - consts.TenantInviteStatus: - enum: - - active - - disabled - - expired - type: string - x-enum-varnames: - - TenantInviteStatusActive - - TenantInviteStatusDisabled - - TenantInviteStatusExpired - consts.TenantJoinRequestStatus: - enum: - - pending - - approved - - rejected - type: string - x-enum-varnames: - - TenantJoinRequestStatusPending - - TenantJoinRequestStatusApproved - - TenantJoinRequestStatusRejected - consts.TenantLedgerType: - enum: - - debit_purchase - - credit_refund - - freeze - - unfreeze - - adjustment - type: string - x-enum-varnames: - - TenantLedgerTypeDebitPurchase - - TenantLedgerTypeCreditRefund - - TenantLedgerTypeFreeze - - TenantLedgerTypeUnfreeze - - TenantLedgerTypeAdjustment + - RoleCreator consts.TenantStatus: enum: - pending_verify @@ -176,24 +86,32 @@ definitions: - TenantUserRoleTenantAdmin consts.UserStatus: enum: + - active + - inactive - pending_verify - verified - banned type: string x-enum-varnames: + - UserStatusActive + - UserStatusInactive - UserStatusPendingVerify - UserStatusVerified - UserStatusBanned dto.AdminContentItem: properties: content: - $ref: '#/definitions/models.Content' + $ref: '#/definitions/dto.ContentItem' owner: $ref: '#/definitions/dto.AdminContentOwnerLite' price: - $ref: '#/definitions/models.ContentPrice' + $ref: '#/definitions/dto.ContentPrice' status_description: type: string + tenant: + allOf: + - $ref: '#/definitions/dto.SuperContentTenantLite' + description: Tenant 内容所属租户信息,用于超管列表展示与跳转。 visibility_description: type: string type: object @@ -210,491 +128,484 @@ definitions: username: type: string type: object - dto.AdminLedgerItem: + dto.ApplyForm: properties: - ledger: - allOf: - - $ref: '#/definitions/models.TenantLedger' - description: Ledger 流水记录(租户内隔离)。 - type_description: - description: TypeDescription 流水类型中文说明(用于前端展示)。 + avatar: + description: Avatar 头像URL。 + type: string + bio: + description: Bio 频道简介。 + type: string + name: + description: Name 频道/创作者名称。 type: string type: object - dto.AdminMediaAssetUploadCompleteForm: + dto.AssetDTO: properties: - content_type: - description: |- - ContentType is the MIME type observed during upload; optional. - Server may record it for audit and later processing decisions. - type: string - etag: - description: |- - ETag is the storage returned ETag (or similar checksum); optional. - Used for audit/debugging and later integrity verification. - type: string - file_size: - description: |- - FileSize is the uploaded object size in bytes; optional. - Server records it for quota/audit and later validation. + id: + description: ID 资源ID。 type: integer - sha256: - description: |- - SHA256 is the hex-encoded sha256 of the uploaded object; optional. - Server records it for integrity checks/deduplication. + name: + description: Name 文件名。 type: string - type: object - dto.AdminMediaAssetUploadInitForm: - properties: - content_type: - description: |- - ContentType is the MIME type reported by the client (e.g. video/mp4); optional. - Server should not fully trust it, but can use it as a hint for validation/logging. + role: + description: Role 资源角色(cover/media/preview)。 type: string - file_size: - description: |- - FileSize is the expected file size in bytes; optional. - Used for quota/limit checks and audit; client may omit when unknown. - type: integer - sha256: - description: |- - SHA256 is the hex-encoded sha256 of the file; optional. - Used for deduplication/audit; server may validate it later during upload-complete. + size: + description: Size 文件大小描述。 type: string - source_asset_id: - description: SourceAssetID links a preview product to its main asset; only - meaningful when variant=preview. + sort: + description: Sort 排序权重。 type: integer type: - description: |- - Type is the media asset type (video/audio/image). - Used to decide processing pipeline and validation rules; required. + description: Type 资源类型(image/audio/video)。 type: string - variant: - allOf: - - $ref: '#/definitions/consts.MediaAssetVariant' - description: |- - Variant indicates whether this asset is a main or preview product. - Allowed: main/preview; default is main. - type: object - dto.AdminMediaAssetUploadInitResponse: - properties: - asset_id: - description: AssetID is the created media asset id. - type: integer - bucket: - description: Bucket is the target bucket/container; for debugging/audit (may - be empty in stub mode). - type: string - expires_at: - description: ExpiresAt indicates when UploadURL/FormFields expire; optional. - type: string - form_fields: - additionalProperties: - type: string - description: FormFields are form fields required for multipart form upload - (S3 POST policy); optional. - type: object - headers: - additionalProperties: - type: string - description: Headers are additional headers required for upload (e.g. signed - headers); optional. - type: object - object_key: - description: ObjectKey is the server-generated object key/path; client must - NOT choose it. - type: string - provider: - description: Provider is the storage provider identifier (e.g. s3/minio/oss/local); - for debugging/audit. - type: string - upload_url: - description: UploadURL is the URL the client should upload to (signed URL - or service endpoint). + url: + description: URL 资源访问地址。 type: string type: object - dto.AdminOrderDetail: + dto.Comment: properties: - order: - allOf: - - $ref: '#/definitions/models.Order' - description: Order is the order with items preloaded. - type: object - dto.AdminOrderExportResponse: - properties: - content_type: - description: ContentType 内容类型:当前固定为 text/csv。 - type: string - csv: - description: CSV CSV 文本内容:UTF-8 编码,包含表头与数据行;前端可直接下载为文件。 - type: string - filename: - description: Filename 建议文件名:前端可用于下载时的默认文件名。 - type: string - type: object - dto.AdminOrderRefundForm: - properties: - force: - description: |- - Force indicates bypassing the default refund window check (paid_at + 24h). - 强制退款:true 表示绕过默认退款时间窗限制(需审计)。 - type: boolean - idempotency_key: - description: |- - IdempotencyKey ensures refund request is processed at most once. - 幂等键:同一笔退款重复请求时返回一致结果,避免重复退款/重复回滚。 - type: string - reason: - description: |- - Reason is the human-readable refund reason used for audit. - 退款原因:建议必填(由业务侧校验);用于审计与追责。 - type: string - type: object - dto.AdminTenantInviteCreateForm: - properties: - code: - description: Code 邀请码(可选):为空时由后端生成;建议只包含数字/字母,便于人工输入。 - type: string - expires_at: - description: ExpiresAt 过期时间(可选):为空表示不过期;到期后不可再使用。 - type: string - max_uses: - description: MaxUses 最大可使用次数(可选):0 表示不限次数;大于 0 时用尽后自动失效。 - type: integer - remark: - description: Remark 备注(可选):用于审计记录生成目的/投放渠道等。 - type: string - type: object - dto.AdminTenantInviteDisableForm: - properties: - reason: - description: Reason 禁用原因(可选):用于审计与追溯。 - type: string - type: object - dto.AdminTenantJoinRequestDecideForm: - properties: - reason: - description: Reason 审核说明(可选):用于审计记录通过/拒绝原因。 - type: string - type: object - dto.AdminTenantUserItem: - properties: - tenant_user: - allOf: - - $ref: '#/definitions/models.TenantUser' - description: TenantUser 租户成员关系记录。 - user: - allOf: - - $ref: '#/definitions/models.User' - description: User 用户基础信息(用于展示 username 等)。 - type: object - dto.AdminTenantUserJoinResponse: - properties: - tenant_user: - allOf: - - $ref: '#/definitions/models.TenantUser' - description: TenantUser 租户成员关系记录。 - type: object - dto.AdminTenantUserRoleUpdateForm: - properties: - role: - description: Role 角色:member/tenant_admin。 - type: string - type: object - dto.ContentAssetAttachForm: - properties: - asset_id: - description: AssetID is the media asset id to attach. - type: integer - role: - allOf: - - $ref: '#/definitions/consts.ContentAssetRole' - description: Role indicates how this asset is used (main/cover/preview). - sort: - description: Sort controls ordering under the same role. - type: integer - type: object - dto.ContentAssetsResponse: - properties: - assets: - description: Assets is the list of playable assets for the requested role - (preview/main). - items: - $ref: '#/definitions/dto.ContentPlayableAsset' - type: array content: - allOf: - - $ref: '#/definitions/models.Content' - description: Content is the content entity. - preview_seconds: - description: PreviewSeconds indicates the max preview duration (only meaningful - for preview response). + description: Content 评论内容。 + type: string + create_time: + description: CreateTime 评论创建时间(RFC3339)。 + type: string + id: + description: ID 评论ID。 + type: integer + is_liked: + description: IsLiked 当前用户是否点赞该评论。 + type: boolean + likes: + description: Likes 评论点赞数。 + type: integer + reply_to: + description: ReplyTo 回复的评论ID(0 表示一级评论)。 + type: integer + user_avatar: + description: UserAvatar 评论用户头像。 + type: string + user_id: + description: UserID 评论用户ID。 + type: integer + user_nickname: + description: UserNickname 评论用户昵称。 + type: string + type: object + dto.CommentCreateForm: + properties: + content: + description: Content 评论正文,不能为空。 + type: string + reply_to: + description: ReplyTo 被回复评论ID(0 表示一级评论)。 type: integer type: object dto.ContentCreateForm: properties: - description: - description: Description is the content description. + cover_ids: + description: CoverIDs 封面资源ID集合。 + items: + type: integer + type: array + genre: + description: Genre 内容分类/风格。 + type: string + key: + description: Key 音乐调性或主音。 + type: string + media_ids: + description: MediaIDs 媒体资源ID集合(音频/视频/图片)。 + items: + type: integer + type: array + price: + description: Price 价格(单位元)。 + type: number + status: + description: Status 内容状态(draft/published)。 type: string - preview_seconds: - description: PreviewSeconds controls preview duration (defaults to 60 when - omitted). - type: integer title: - description: Title is the content title. + description: Title 内容标题。 type: string - visibility: - allOf: - - $ref: '#/definitions/consts.ContentVisibility' - description: Visibility controls who can view the content detail (main assets - still require free/purchase). type: object dto.ContentDetail: properties: - content: - allOf: - - $ref: '#/definitions/models.Content' - description: Content is the content entity. - has_access: - description: HasAccess indicates whether current user can access main assets - (free/owner/purchased). + author_avatar: + description: AuthorAvatar 作者头像URL。 + type: string + author_id: + description: AuthorID 作者用户ID。 + type: integer + author_is_following: + description: AuthorIsFollowing 当前用户是否关注作者(未登录默认 false)。 type: boolean - price: + author_name: + description: AuthorName 作者展示名(优先昵称)。 + type: string + body: + description: Body 详细正文/图文内容(文章类可为空)。 + type: string + cover: + description: Cover 封面URL(无封面时为空)。 + type: string + created_at: + description: CreatedAt 创建时间(RFC3339 格式)。 + type: string + description: + description: Description 内容描述(用于详情页摘要)。 + type: string + genre: + description: Genre 内容分类/风格标签。 + type: string + id: + description: ID 内容唯一ID。 + type: integer + is_favorited: + description: IsFavorited 当前用户是否收藏。 + type: boolean + is_liked: + description: IsLiked 当前用户是否点赞。 + type: boolean + is_purchased: + description: IsPurchased 是否已购买(用于内容列表快速判断)。 + type: boolean + likes: + description: Likes 点赞数统计。 + type: integer + media_urls: + description: MediaUrls 关联媒体资源(音频/视频/预览)。 + items: + $ref: '#/definitions/dto.MediaURL' + type: array + meta: allOf: - - $ref: '#/definitions/models.ContentPrice' - description: Price is the current price settings for the content (may be nil - if not set). + - $ref: '#/definitions/dto.Meta' + description: Meta 内容元信息(曲风/调性/节拍等)。 + price: + description: Price 价格(单位元,免费为 0)。 + type: number + published_at: + description: PublishedAt 发布时间,未发布为空。 + type: string + status: + description: Status 内容状态(如 published/unpublished)。 + type: string + tenant_id: + description: TenantID 内容所属租户ID。 + type: integer + title: + description: Title 内容标题。 + type: string + type: + description: Type 内容媒体类型(video/audio/article)。 + type: string + user_id: + description: UserID 内容作者用户ID(与 author_id 同义,便于后台展示)。 + type: integer + views: + description: Views 浏览量统计。 + type: integer + visibility: + description: Visibility 内容可见性(如 public/tenant_only/private)。 + type: string + type: object + dto.ContentEditDTO: + properties: + assets: + description: Assets 资源列表(封面/媒体)。 + items: + $ref: '#/definitions/dto.AssetDTO' + type: array + description: + description: Description 内容简介。 + type: string + enable_trial: + description: EnableTrial 是否开启试读/试听。 + type: boolean + genre: + description: Genre 内容分类。 + type: string + id: + description: ID 内容ID。 + type: integer + key: + description: Key 音乐调性或主音。 + type: string + preview_seconds: + description: PreviewSeconds 试看/试听秒数。 + type: integer + price: + description: Price 价格(单位元)。 + type: number + status: + description: Status 内容状态。 + type: string + title: + description: Title 内容标题。 + type: string type: object dto.ContentItem: properties: - content: - allOf: - - $ref: '#/definitions/models.Content' - description: Content is the content entity. - has_access: - description: HasAccess indicates whether current user can access main assets - (free/owner/purchased). - type: boolean - price: - allOf: - - $ref: '#/definitions/models.ContentPrice' - description: Price is the current price settings for the content (may be nil - if not set). - type: object - dto.ContentPlayableAsset: - properties: - asset_id: - type: integer - expires_at: - description: ExpiresAt indicates when PlayURL/token expires; optional. + author_avatar: + description: AuthorAvatar 作者头像URL。 type: string - meta: - description: Meta is a display-safe whitelist (currently passthrough JSON); - optional. - items: - type: integer - type: array - play_url: - description: PlayURL is a short-lived URL; do NOT expose bucket/object_key - directly. + author_id: + description: AuthorID 作者用户ID。 + type: integer + author_is_following: + description: AuthorIsFollowing 当前用户是否关注作者(未登录默认 false)。 + type: boolean + author_name: + description: AuthorName 作者展示名(优先昵称)。 + type: string + cover: + description: Cover 封面URL(无封面时为空)。 + type: string + created_at: + description: CreatedAt 创建时间(RFC3339 格式)。 + type: string + genre: + description: Genre 内容分类/风格标签。 + type: string + id: + description: ID 内容唯一ID。 + type: integer + is_purchased: + description: IsPurchased 是否已购买(用于内容列表快速判断)。 + type: boolean + likes: + description: Likes 点赞数统计。 + type: integer + price: + description: Price 价格(单位元,免费为 0)。 + type: number + published_at: + description: PublishedAt 发布时间,未发布为空。 + type: string + status: + description: Status 内容状态(如 published/unpublished)。 + type: string + tenant_id: + description: TenantID 内容所属租户ID。 + type: integer + title: + description: Title 内容标题。 type: string type: - $ref: '#/definitions/consts.MediaAssetType' + description: Type 内容媒体类型(video/audio/article)。 + type: string + user_id: + description: UserID 内容作者用户ID(与 author_id 同义,便于后台展示)。 + type: integer + views: + description: Views 浏览量统计。 + type: integer + visibility: + description: Visibility 内容可见性(如 public/tenant_only/private)。 + type: string type: object - dto.ContentPriceUpsertForm: + dto.ContentPrice: properties: currency: - allOf: - - $ref: '#/definitions/consts.Currency' - description: Currency is fixed to CNY for now. + description: Currency 币种(CNY 等)。 + type: string discount_end_at: - description: DiscountEndAt disables discount after this time (optional). + description: DiscountEndAt 折扣结束时间(RFC3339)。 type: string discount_start_at: - description: DiscountStartAt enables discount from this time (optional). + description: DiscountStartAt 折扣开始时间(RFC3339)。 type: string discount_type: - allOf: - - $ref: '#/definitions/consts.DiscountType' - description: DiscountType defines the discount algorithm (none/percent/amount). + description: DiscountType 折扣类型(amount/percent)。 + type: string discount_value: - description: DiscountValue is interpreted based on DiscountType. - type: integer + description: DiscountValue 折扣值(amount=元,percent=百分比)。 + type: number price_amount: - description: PriceAmount is the base price in cents (CNY 分). - type: integer - type: object - dto.ContentPublishForm: - properties: - audio_asset_ids: - description: AudioAssetIDs 音频资源 ID 列表:可为空;每个资源必须为 audio/main/ready。 - items: - type: integer - type: array - cover_asset_ids: - description: CoverAssetIDs 展示图(封面图)资源 ID 列表:1-3 张;每个资源必须为 image/main/ready。 - items: - type: integer - type: array - currency: - allOf: - - $ref: '#/definitions/consts.Currency' - description: Currency 币种:当前固定为 CNY;可不传(后端默认 CNY)。 - detail: - description: Detail 详细:用于详情页的长文本;可选;当非空时视为“文字内容”类型存在。 - type: string - image_asset_ids: - description: ImageAssetIDs 多图内容资源 ID 列表:可为空;每个资源必须为 image/main/ready;数量 >= - 2 时视为“多图内容”类型存在。 - items: - type: integer - type: array - preview_seconds: - description: PreviewSeconds 试看秒数:仅对 preview 资源生效;默认 60;必须为正整数。 - type: integer - price_amount: - description: PriceAmount 价格:单位为分;0 表示免费;必填(前端可默认填 0)。 - type: integer - summary: - description: Summary 简介:用于列表/卡片展示的短文本;可选,建议 <= 256 字符。 - type: string - tags: - description: Tags 标签:用于分类/检索;字符串数组;会做 trim/去重;可为空。 - items: - type: string - type: array - title: - description: Title 标题:用于列表展示与搜索;必填。 - type: string - video_asset_ids: - description: VideoAssetIDs 视频资源 ID 列表:可为空;每个资源必须为 video/main/ready。 - items: - type: integer - type: array - visibility: - allOf: - - $ref: '#/definitions/consts.ContentVisibility' - description: Visibility 可见性:控制“详情页”可见范围;默认 tenant_only。 - type: object - dto.ContentPublishResponse: - properties: - content: - allOf: - - $ref: '#/definitions/models.Content' - description: Content 内容主体(包含标题/简介/详细/状态等)。 - content_types: - description: ContentTypes 内容类型列表:text/audio/video/image/multi_image(用于前端展示)。 - items: - type: string - type: array - cover_assets: - description: CoverAssets 封面图绑定结果(role=cover)。 - items: - $ref: '#/definitions/models.ContentAsset' - type: array - main_assets: - description: MainAssets 主资源绑定结果(role=main;可能包含音频/视频/图片)。 - items: - $ref: '#/definitions/models.ContentAsset' - type: array - price: - allOf: - - $ref: '#/definitions/models.ContentPrice' - description: Price 定价信息(单位分)。 + description: PriceAmount 原价金额(单位元)。 + type: number type: object dto.ContentUpdateForm: properties: - description: - description: Description updates the description when provided. + cover_ids: + description: CoverIDs 封面资源ID集合。 + items: + type: integer + type: array + genre: + description: Genre 内容分类/风格。 type: string - preview_seconds: - description: PreviewSeconds updates preview duration when provided (must be - > 0). + is_pinned: + description: IsPinned 是否置顶。 + type: boolean + key: + description: Key 音乐调性或主音。 + type: string + media_ids: + description: MediaIDs 媒体资源ID集合。 + items: + type: integer + type: array + price: + description: Price 价格(单位元,nil 表示不修改)。 + type: number + status: + description: Status 内容状态(draft/published)。 + type: string + title: + description: Title 内容标题(为空表示不修改)。 + type: string + type: object + dto.DashboardStats: + properties: + new_messages: + description: NewMessages 新消息数量。 + type: integer + pending_refunds: + description: PendingRefunds 待处理退款数量。 + type: integer + total_followers: + allOf: + - $ref: '#/definitions/dto.IntStatItem' + description: TotalFollowers 粉丝总数统计。 + total_revenue: + allOf: + - $ref: '#/definitions/dto.FloatStatItem' + description: TotalRevenue 累计收入统计(单位元)。 + type: object + dto.FloatStatItem: + properties: + trend: + description: Trend 环比/同比变化比例。 + type: number + value: + description: Value 统计数值(浮点)。 + type: number + type: object + dto.IntStatItem: + properties: + trend: + description: Trend 环比/同比变化比例。 + type: number + value: + description: Value 统计数值。 + type: integer + type: object + dto.MediaURL: + properties: + duration: + description: Duration 媒体时长(秒),无时长则为 0。 + type: integer + type: + description: Type 媒体类型(audio/video/image/preview)。 + type: string + url: + description: URL 媒体资源地址。 + type: string + type: object + dto.Meta: + properties: + beat: + description: Beat 节拍信息(如 4/4)。 + type: string + key: + description: Key 音乐调性或主音。 + type: string + role: + description: Role 内容角色/定位(如 demo/主稿)。 + type: string + type: object + dto.Notification: + properties: + content: + description: Content 通知内容。 + type: string + id: + description: ID 通知ID。 + type: integer + read: + description: Read 是否已读。 + type: boolean + time: + description: Time 发送时间(RFC3339)。 + type: string + title: + description: Title 通知标题。 + type: string + type: + description: Type 通知类型(system/order/interaction)。 + type: string + type: object + dto.OptionsResponse: + properties: + content_genre: + description: ContentGenre 内容类型/分类选项。 + items: + $ref: '#/definitions/requests.KV' + type: array + content_status: + description: ContentStatus 内容状态选项。 + items: + $ref: '#/definitions/requests.KV' + type: array + type: object + dto.Order: + properties: + amount: + description: Amount 实付金额(单位元)。 + type: number + buyer_avatar: + description: BuyerAvatar 买家头像URL。 + type: string + buyer_name: + description: BuyerName 买家昵称。 + type: string + cover: + description: Cover 订单封面图。 + type: string + create_time: + description: CreateTime 创建时间(RFC3339)。 + type: string + id: + description: ID 订单ID。 + type: integer + is_virtual: + description: IsVirtual 是否虚拟订单。 + type: boolean + items: + description: Items 订单内容明细。 + items: + $ref: '#/definitions/dto.ContentItem' + type: array + pay_time: + description: PayTime 支付时间(RFC3339)。 + type: string + quantity: + description: Quantity 内容数量。 type: integer status: - allOf: - - $ref: '#/definitions/consts.ContentStatus' - description: Status updates the content status when provided (e.g. publish/unpublish). - title: - description: Title updates the title when provided. + description: Status 订单状态。 type: string - visibility: - allOf: - - $ref: '#/definitions/consts.ContentVisibility' - description: Visibility updates the visibility when provided. - type: object - dto.JoinByInviteForm: - properties: - invite_code: - description: InviteCode 邀请码:由租户管理员生成;用户提交后加入对应租户。 - type: string - type: object - dto.JoinRequestCreateForm: - properties: - reason: - description: Reason 申请原因(可选):用于向租户管理员说明申请加入的目的。 - type: string - type: object - dto.MeBalanceResponse: - properties: - balance: - description: Balance 可用余额:可用于购买/消费。 - type: integer - balance_frozen: - description: BalanceFrozen 冻结余额:用于下单冻结/争议期等。 - type: integer - currency: - allOf: - - $ref: '#/definitions/consts.Currency' - description: Currency 币种:当前固定 CNY(金额单位为分)。 - updated_at: - description: UpdatedAt 更新时间:余额变更时更新。 - type: string - type: object - dto.MyLedgerItem: - properties: - ledger: - allOf: - - $ref: '#/definitions/models.TenantLedger' - description: Ledger 流水记录(租户内隔离)。 - type_description: - description: TypeDescription 流水类型中文说明(用于前端展示)。 - type: string - type: object - dto.MyTenantItem: - properties: - is_owner: - description: |- - IsOwner 是否为租户Owner(tenants.user_id == 当前用户)。 - 说明:Owner 通常也在 tenant_users 里具备 tenant_admin 角色,但此字段更直观。 - type: boolean - joined_at: - description: JoinedAt 加入租户时间(tenant_users.created_at)。 - type: string - member_roles: - description: MemberRoles 当前用户在该租户下的角色(tenant_admin/member 等)。 - items: - $ref: '#/definitions/consts.TenantUserRole' - type: array - member_status: - allOf: - - $ref: '#/definitions/consts.UserStatus' - description: MemberStatus 当前用户在该租户下的成员状态。 - tenant_code: - description: TenantCode 租户Code(路由使用:/t/:tenantCode/...)。 + status_description: + description: StatusDescription 订单状态描述。 type: string tenant_id: - description: TenantID 租户ID(数值型主键)。 + description: TenantID 内容所属租户ID。 type: integer tenant_name: description: TenantName 租户名称。 type: string - tenant_status: - allOf: - - $ref: '#/definitions/consts.TenantStatus' - description: TenantStatus 租户状态(pending/verified/expired 等)。 - tenant_status_description: - description: TenantStatusDescription 租户状态描述(便于前端展示)。 + title: + description: Title 订单标题(用于列表展示)。 + type: string + type: + description: Type 订单类型(内容购买/充值等)。 + type: string + type_description: + description: TypeDescription 订单类型描述。 type: string type: object dto.OrderBuyerLite: @@ -704,6 +615,42 @@ definitions: username: type: string type: object + dto.OrderCreateForm: + properties: + content_id: + description: ContentID 内容ID。 + type: integer + idempotency_key: + description: IdempotencyKey 幂等键(同一业务请求需保持一致)。 + type: string + quantity: + description: Quantity 购买数量(默认 1)。 + type: integer + sku: + description: Sku 规格标识(可选)。 + type: string + user_coupon_id: + description: UserCouponID 用户券ID(可选)。 + type: integer + type: object + dto.OrderCreateResponse: + properties: + order_id: + description: OrderID 创建成功的订单ID。 + type: integer + type: object + dto.OrderPayForm: + properties: + method: + description: Method 支付方式(wechat/alipay/balance)。 + type: string + type: object + dto.OrderPayResponse: + properties: + pay_params: + description: PayParams 支付参数(透传给前端)。 + type: string + type: object dto.OrderStatisticsResponse: properties: by_status: @@ -726,6 +673,12 @@ definitions: status_description: type: string type: object + dto.OrderStatusResponse: + properties: + status: + description: Status 订单状态(unpaid/paid/completed 等)。 + type: string + type: object dto.OrderTenantLite: properties: code: @@ -735,112 +688,93 @@ definitions: name: type: string type: object - dto.PasswordResetForm: + dto.PayoutAccount: properties: - confirmPassword: - description: ConfirmPassword 确认新密码;必须与 Password 一致。 + account: + description: Account 收款账号。 type: string - password: - description: Password 新密码(明文)。 - type: string - resetToken: - description: ResetToken 重置令牌;由验证码校验接口返回。 - type: string - type: object - dto.PasswordResetResponse: - properties: - ok: - description: Ok 是否成功。 - type: boolean - type: object - dto.PasswordResetSendSMSForm: - properties: - phone: - description: Phone 手机号;当前版本将其作为用户名使用(users.username)。 - type: string - type: object - dto.PasswordResetSendSMSResponse: - properties: - code: - description: Code 验证码(预留:当前用于前端弹窗展示;正式接入短信后应移除/仅在开发环境返回)。 - type: string - nextSendSeconds: - description: NextSendSeconds 下次可发送剩余秒数(用于前端 60s 倒计时)。 + id: + description: ID 收款账户ID。 type: integer - type: object - dto.PasswordResetVerifyForm: - properties: - code: - description: Code 短信验证码。 + name: + description: Name 账户名称/开户行。 type: string - phone: - description: Phone 手机号。 + realname: + description: Realname 收款人姓名。 + type: string + type: + description: Type 账户类型(bank/alipay)。 type: string type: object - dto.PasswordResetVerifyResponse: + dto.RealNameForm: properties: - resetToken: - description: ResetToken 重置令牌;验证码校验通过后,用该令牌提交新密码。 + id_card: + description: IDCard 身份证号。 + type: string + realname: + description: Realname 真实姓名。 type: string type: object - dto.PurchaseContentForm: + dto.RechargeForm: properties: - idempotency_key: - description: |- - IdempotencyKey is used to ensure the purchase request is processed at most once. - 建议由客户端生成并保持稳定:同一笔购买重复请求时返回相同结果,避免重复扣款/重复下单。 + amount: + description: Amount 充值金额(单位元)。 + type: number + method: + description: Method 充值方式(wechat/alipay)。 type: string type: object - dto.PurchaseContentResponse: + dto.RechargeResponse: properties: - access: - allOf: - - $ref: '#/definitions/models.ContentAccess' - description: Access is the content access record after purchase grant. - amount_paid: - description: AmountPaid is the final paid amount in cents (CNY 分). + order_id: + description: OrderID 充值订单ID。 type: integer - item: - allOf: - - $ref: '#/definitions/models.OrderItem' - description: Item is the single order item of this purchase (current implementation - is 1 order -> 1 content). - order: - allOf: - - $ref: '#/definitions/models.Order' - description: Order is the created or existing order record (may be nil for - owner/free-path without order). - type: object - dto.RegisterForm: - properties: - confirmPassword: - description: ConfirmPassword 确认密码;必须与 Password 一致,避免误输入导致无法登录。 - type: string - password: - description: Password 明文密码;后端会在创建用户时自动加密(bcrypt)。 - type: string - username: - description: Username 用户名;需全局唯一(users.username);建议仅允许字母/数字/下划线,且长度在合理范围内。 - type: string - verifyCode: - description: VerifyCode 验证码(预留字段);当前版本仅透传/占位,不做后端校验。 + pay_params: + description: PayParams 支付参数(透传给前端)。 type: string type: object - dto.SuperContentItem: + dto.RefundForm: properties: - content: - $ref: '#/definitions/models.Content' - owner: - $ref: '#/definitions/dto.SuperUserLite' - price: - $ref: '#/definitions/models.ContentPrice' - status_description: + action: + description: Action 处理动作(accept/reject)。 type: string - tenant: - $ref: '#/definitions/dto.SuperContentTenantLite' - visibility_description: + reason: + description: Reason 退款原因/备注。 type: string type: object + dto.Settings: + properties: + avatar: + description: Avatar 头像URL。 + type: string + bio: + description: Bio 频道简介。 + type: string + cover: + description: Cover 封面图URL。 + type: string + description: + description: Description 详细描述。 + type: string + id: + description: ID 租户/频道ID。 + type: integer + name: + description: Name 频道名称。 + type: string + type: object + dto.Stats: + properties: + contents: + description: Contents 内容数。 + type: integer + followers: + description: Followers 粉丝数。 + type: integer + likes: + description: Likes 累计点赞数。 + type: integer + type: object dto.SuperContentTenantLite: properties: code: @@ -855,7 +789,9 @@ definitions: buyer: $ref: '#/definitions/dto.OrderBuyerLite' order: - $ref: '#/definitions/models.Order' + allOf: + - $ref: '#/definitions/dto.SuperOrderItem' + description: Using SuperOrderItem as base, extend if needed tenant: $ref: '#/definitions/dto.OrderTenantLite' type: object @@ -875,10 +811,17 @@ definitions: $ref: '#/definitions/consts.Currency' id: type: integer + items: + description: Items 订单明细行,用于展示具体内容与金额拆分。 + items: + $ref: '#/definitions/dto.SuperOrderItemLine' + type: array paid_at: type: string refunded_at: type: string + snapshot: + description: Snapshot 订单快照,包含下单时的关键参数与定价信息,便于审计回溯。 status: $ref: '#/definitions/consts.OrderStatus' status_description: @@ -890,30 +833,27 @@ definitions: updated_at: type: string type: object + dto.SuperOrderItemLine: + properties: + amount_paid: + description: AmountPaid 该明细实付金额(分)。 + type: integer + content_id: + description: ContentID 购买的内容ID。 + type: integer + id: + description: ID 订单明细ID。 + type: integer + snapshot: + description: Snapshot 明细快照,用于展示内容标题等历史信息。 + type: object dto.SuperOrderRefundForm: properties: force: - description: Force indicates bypassing the default refund window check (paid_at - + 24h). type: boolean idempotency_key: - description: IdempotencyKey ensures refund request is processed at most once. type: string reason: - description: Reason is the human-readable refund reason used for audit. - type: string - type: object - dto.SuperTenantContentItem: - properties: - content: - $ref: '#/definitions/models.Content' - owner: - $ref: '#/definitions/dto.SuperUserLite' - price: - $ref: '#/definitions/models.ContentPrice' - status_description: - type: string - visibility_description: type: string type: object dto.SuperTenantContentStatusUpdateForm: @@ -921,7 +861,6 @@ definitions: status: allOf: - $ref: '#/definitions/consts.ContentStatus' - description: 'Status supports: unpublished (下架) / blocked (封禁)' enum: - unpublished - blocked @@ -931,7 +870,7 @@ definitions: dto.SuperTenantUserItem: properties: tenant_user: - $ref: '#/definitions/models.TenantUser' + $ref: '#/definitions/dto.TenantUser' user: $ref: '#/definitions/dto.SuperUserLite' type: object @@ -963,40 +902,6 @@ definitions: username: type: string type: object - dto.TenantApplicationResponse: - properties: - createdAt: - description: CreatedAt 申请创建时间(租户记录创建时间)。 - type: string - hasApplication: - description: HasApplication 是否已提交过申请(或已成为创作者)。 - type: boolean - status: - allOf: - - $ref: '#/definitions/consts.TenantStatus' - description: Status 租户状态(pending_verify/verified/banned)。 - statusDescription: - description: StatusDescription 状态描述(便于前端展示)。 - type: string - tenantCode: - description: TenantCode 租户 Code。 - type: string - tenantId: - description: TenantID 租户ID。 - type: integer - tenantName: - description: TenantName 租户名称。 - type: string - type: object - dto.TenantApplyForm: - properties: - code: - description: Code 租户 ID(用于 URL/系统标识);全局唯一(tenants.code,忽略大小写)。 - type: string - name: - description: Name 租户名称(展示用)。 - type: string - type: object dto.TenantCreateForm: properties: admin_user_id: @@ -1005,7 +910,6 @@ definitions: maxLength: 64 type: string duration: - description: Duration 租户有效期(天),从“创建时刻”起算;与续期接口保持一致。 enum: - 7 - 30 @@ -1044,6 +948,7 @@ definitions: code: type: string config: + description: Replace with actual config struct if needed items: type: integer type: array @@ -1054,7 +959,6 @@ definitions: id: type: integer income_amount_paid_sum: - description: IncomeAmountPaidSum 累计收入金额(单位:分,CNY):按 orders 聚合得到的已支付净收入(不含退款中/已退款订单)。 type: integer name: type: string @@ -1072,7 +976,7 @@ definitions: type: integer users: items: - $ref: '#/definitions/models.User' + $ref: '#/definitions/dto.SuperUserLite' type: array uuid: type: string @@ -1084,17 +988,186 @@ definitions: username: type: string type: object + dto.TenantProfile: + properties: + avatar: + description: Avatar 头像URL。 + type: string + bio: + description: Bio 简短简介。 + type: string + cert_type: + description: CertType 认证类型(personal/enterprise)。 + type: string + cover: + description: Cover 封面图URL。 + type: string + description: + description: Description 详细描述。 + type: string + id: + description: ID 租户ID。 + type: integer + is_following: + description: IsFollowing 当前用户是否关注。 + type: boolean + name: + description: Name 租户名称。 + type: string + stats: + allOf: + - $ref: '#/definitions/dto.Stats' + description: Stats 统计信息。 + type: object dto.TenantStatusUpdateForm: properties: status: - allOf: - - $ref: '#/definitions/consts.TenantStatus' - enum: - - normal - - disabled + $ref: '#/definitions/consts.TenantStatus' required: - status type: object + dto.TenantUser: + properties: + created_at: + type: string + id: + type: integer + role: + items: + $ref: '#/definitions/consts.TenantUserRole' + type: array + status: + $ref: '#/definitions/consts.UserStatus' + tenant_id: + type: integer + updated_at: + type: string + user_id: + type: integer + type: object + dto.Topic: + properties: + count: + description: Count 专题内内容数量。 + type: integer + cover: + description: Cover 专题封面图。 + type: string + id: + description: ID 专题ID。 + type: integer + tag: + description: Tag 专题标签(用于筛选/展示)。 + type: string + title: + description: Title 专题标题。 + type: string + type: object + dto.Transaction: + properties: + amount: + description: Amount 发生金额(单位元)。 + type: number + date: + description: Date 发生时间(RFC3339)。 + type: string + id: + description: ID 流水ID。 + type: integer + title: + description: Title 流水标题/描述。 + type: string + type: + description: Type 流水类型(income/expense)。 + type: string + type: object + dto.UploadCompleteForm: + properties: + upload_id: + description: UploadID 分片上传ID。 + type: string + type: object + dto.UploadInitForm: + properties: + filename: + description: Filename 原始文件名。 + type: string + hash: + description: Hash 文件 MD5 哈希(用于秒传校验)。 + type: string + mime_type: + description: MimeType 文件类型(如 image/png)。 + type: string + size: + description: Size 文件大小(字节)。 + type: integer + type: + description: Type 业务类型(如 cover/media/avatar)。 + type: string + type: object + dto.UploadInitResponse: + properties: + chunk_size: + description: ChunkSize 分片大小(字节)。 + type: integer + key: + description: Key 对象存储Key(S3 直传使用)。 + type: string + upload_id: + description: UploadID 分片上传ID。 + type: string + type: object + dto.UploadResult: + properties: + filename: + description: Filename 原始文件名。 + type: string + id: + description: ID 媒体资源ID。 + type: integer + mime_type: + description: MimeType 文件类型(如 image/png)。 + type: string + size: + description: Size 文件大小(字节)。 + type: integer + url: + description: URL 访问地址(包含签名或公共URL)。 + type: string + type: object + dto.UserCouponItem: + properties: + coupon_id: + description: CouponID 券模板ID。 + type: integer + description: + description: Description 券描述。 + type: string + end_at: + description: EndAt 过期时间(RFC3339)。 + type: string + id: + description: ID 用户券ID。 + type: integer + min_order_amount: + description: MinOrderAmount 使用门槛金额(分)。 + type: integer + start_at: + description: StartAt 生效时间(RFC3339)。 + type: string + status: + description: Status 当前状态(可用/已用/过期)。 + type: string + title: + description: Title 券标题。 + type: string + type: + description: Type 券类型(满减/折扣)。 + type: string + value: + description: Value 券面值(分/百分比)。 + type: integer + type: object dto.UserItem: properties: balance: @@ -1146,11 +1219,7 @@ definitions: dto.UserStatusUpdateForm: properties: status: - allOf: - - $ref: '#/definitions/consts.UserStatus' - enum: - - normal - - disabled + $ref: '#/definitions/consts.UserStatus' required: - status type: object @@ -1181,614 +1250,170 @@ definitions: tenant_status_description: type: string type: object - gorm.DeletedAt: + dto.UserUpdate: properties: - time: + avatar: + description: Avatar 头像URL。 type: string - valid: - description: Valid is true if Time is not NULL - type: boolean - type: object - models.Content: - properties: - created_at: - description: 创建时间:默认 now();用于审计与排序 + bio: + description: Bio 个人简介。 type: string - deleted_at: + birthday: + description: Birthday 生日(YYYY-MM-DD)。 + type: string + gender: allOf: - - $ref: '#/definitions/gorm.DeletedAt' - description: 软删除时间:非空表示已删除;对外接口需过滤 - description: - description: 描述:用于详情页展示;可为空字符串 - type: string - id: - description: 主键ID:自增;用于内容引用 - type: integer - preview_downloadable: - description: 试看是否允许下载:默认 false;当前策略固定为不允许下载(仅 streaming) - type: boolean - preview_seconds: - description: 试看秒数:默认 60;只对 preview 资源生效;必须为正整数 - type: integer - published_at: - description: 发布时间:首次发布时写入;用于时间窗与排序 - type: string - status: + - $ref: '#/definitions/consts.Gender' + description: Gender 性别(枚举)。 + location: allOf: - - $ref: '#/definitions/consts.ContentStatus' - description: 状态:draft/reviewing/published/unpublished/blocked;published 才对外展示 - summary: - description: 简介:用于列表/卡片展示的短文本;建议 <= 256 字符(由业务校验) - type: string - tags: - description: 标签:JSON 数组(字符串列表);用于分类/检索与聚合展示 - items: - type: integer - type: array - tenant_id: - description: 租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id - type: integer - title: - description: 标题:用于列表展示与搜索;建议限制长度(由业务校验) - type: string - updated_at: - description: 更新时间:默认 now();编辑内容时写入 - type: string - user_id: - description: 用户ID:内容创建者/发布者;用于权限与审计(例如私有内容仅作者可见) - type: integer - visibility: - allOf: - - $ref: '#/definitions/consts.ContentVisibility' - description: 可见性:public/tenant_only/private;仅控制详情可见,正片资源仍需按价格/权益校验 - type: object - models.ContentAccess: - properties: - content_id: - description: 内容ID:权益对应内容;唯一约束 (tenant_id, user_id, content_id) - type: integer - created_at: - description: 创建时间:默认 now();用于审计 - type: string - id: - description: 主键ID:自增 - type: integer - order_id: - description: 订单ID:产生该权益的订单;可为空(例如后台补发/迁移) - type: integer - revoked_at: - description: 撤销时间:当 status=revoked 时写入;用于审计与追责 - type: string - status: - allOf: - - $ref: '#/definitions/consts.ContentAccessStatus' - description: 权益状态:active/revoked/expired;revoked 表示立即失效(例如退款/违规) - tenant_id: - description: 租户ID:多租户隔离;与内容、用户归属一致 - type: integer - updated_at: - description: 更新时间:默认 now();更新 status 时写入 - type: string - user_id: - description: 用户ID:权益所属用户;用于访问校验 - type: integer - type: object - models.ContentAsset: - properties: - asset_id: - description: 资源ID:关联 media_assets.id;用于查询资源归属内容 - type: integer - content_id: - description: 内容ID:关联 contents.id;用于查询内容下资源列表 - type: integer - created_at: - description: 创建时间:默认 now();用于审计 - type: string - id: - description: 主键ID:自增 - type: integer - role: - allOf: - - $ref: '#/definitions/consts.ContentAssetRole' - description: 资源角色:main/cover/preview;preview 必须为独立资源以满足禁下载与防绕过 - sort: - description: 排序:同一 role 下的展示顺序,数值越小越靠前 - type: integer - tenant_id: - description: 租户ID:多租户隔离;必须与 content_id、asset_id 所属租户一致 - type: integer - updated_at: - description: 更新时间:默认 now();更新 sort/role 时写入 - type: string - user_id: - description: 用户ID:操作人/绑定人;用于审计(通常为租户管理员或作者) - type: integer - type: object - models.ContentPrice: - properties: - content_id: - description: 内容ID:唯一约束 (tenant_id, content_id);一个内容在一个租户内仅一份定价 - type: integer - created_at: - description: 创建时间:默认 now();用于审计 - type: string - currency: - allOf: - - $ref: '#/definitions/consts.Currency' - description: 币种:当前固定 CNY;金额单位为分 - discount_end_at: - description: 折扣结束时间:可为空;为空表示长期有效(由业务逻辑解释) - type: string - discount_start_at: - description: 折扣开始时间:可为空;为空表示立即生效(由业务逻辑解释) - type: string - discount_type: - allOf: - - $ref: '#/definitions/consts.DiscountType' - description: 折扣类型:none/percent/amount;仅影响下单时成交价,需写入订单快照 - discount_value: - description: 折扣值:percent=0-100(按业务校验);amount=分;none 时忽略 - type: integer - id: - description: 主键ID:自增 - type: integer - price_amount: - description: 基础价格:分;0 表示免费(可直接访问正片资源) - type: integer - tenant_id: - description: 租户ID:多租户隔离;与内容归属一致 - type: integer - updated_at: - description: 更新时间:默认 now();更新价格/折扣时写入 - type: string - user_id: - description: 用户ID:设置/更新价格的操作人(通常为 tenant_admin);用于审计 - type: integer - type: object - models.MediaAsset: - properties: - bucket: - description: 存储桶:对象所在 bucket;与 provider 组合确定存储定位 - type: string - created_at: - description: 创建时间:默认 now();用于审计与排序 - type: string - deleted_at: - allOf: - - $ref: '#/definitions/gorm.DeletedAt' - description: 软删除时间:非空表示已删除;对外接口需过滤 - id: - description: 主键ID:自增;仅用于内部关联 - type: integer - meta: - description: 元数据:JSON;包含 hash、duration、width、height、bitrate、codec 等;用于展示与计费/风控 - items: - type: integer - type: array - object_key: - description: 对象键:对象在 bucket 内的 key;不得暴露可长期复用的直链(通过签名URL/token下发) - type: string - provider: - description: 存储提供方:例如 s3/minio/oss;便于多存储扩展 - type: string - source_asset_id: - description: 派生来源资源ID:preview 产物可指向对应 main 资源;用于建立 preview/main 的 1:1 追溯关系 - type: integer - status: - allOf: - - $ref: '#/definitions/consts.MediaAssetStatus' - description: 处理状态:uploaded/processing/ready/failed/deleted;ready 才可被内容引用对外提供 - tenant_id: - description: 租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id - type: integer - type: - allOf: - - $ref: '#/definitions/consts.MediaAssetType' - description: 资源类型:video/audio/image;决定后续处理流程(转码/缩略图/封面等) - updated_at: - description: 更新时间:默认 now();更新状态/元数据时写入 - type: string - user_id: - description: 用户ID:资源上传者;用于审计与权限控制 - type: integer - variant: - allOf: - - $ref: '#/definitions/consts.MediaAssetVariant' - description: 产物类型:main/preview;用于强制试看资源必须绑定独立产物,避免用正片绕过 - type: object - models.Order: - properties: - amount_discount: - description: 优惠金额:分;amount_paid = amount_original - amount_discount(下单时快照) - type: integer - amount_original: - description: 原价金额:分;未折扣前金额(用于展示与对账) - type: integer - amount_paid: - description: 实付金额:分;从租户内余额扣款的金额(下单时快照) - type: integer - created_at: - description: 创建时间:默认 now();用于审计与排序 - type: string - currency: - allOf: - - $ref: '#/definitions/consts.Currency' - description: 币种:当前固定 CNY;金额单位为分 - id: - description: 主键ID:自增;用于关联订单明细、账本流水、权益等 - type: integer - idempotency_key: - description: 幂等键:同一租户同一用户同一业务请求可用;用于防重复下单/重复扣款(建议由客户端生成) - type: string - items: - items: - $ref: '#/definitions/models.OrderItem' - type: array - paid_at: - description: 支付/扣款完成时间:余额支付在 debit_purchase 成功后写入 - type: string - refund_forced: - description: 是否强制退款:true 表示租户管理侧绕过时间窗执行退款(需审计) - type: boolean - refund_operator_user_id: - description: 退款操作人用户ID:租户管理员/系统;用于审计与追责 - type: integer - refund_reason: - description: 退款原因:后台/用户发起退款的原因说明;用于审计 - type: string - refunded_at: - description: 退款完成时间:退款落账成功后写入 - type: string - snapshot: - allOf: - - $ref: '#/definitions/types.JSONType-fields_OrdersSnapshot' - description: 订单快照:JSON;建议包含 content 标题/定价/折扣、请求来源等,避免改价影响历史展示 - status: - allOf: - - $ref: '#/definitions/consts.OrderStatus' - description: 订单状态:created/paid/refunding/refunded/canceled/failed;状态变更需与账本/权益保持一致 - tenant_id: - description: 租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id - type: integer - type: - allOf: - - $ref: '#/definitions/consts.OrderType' - description: 订单类型:content_purchase(购买内容)等;当前默认 content_purchase - updated_at: - description: 更新时间:默认 now();状态变更/退款写入时更新 - type: string - user_id: - description: 用户ID:下单用户(buyer);余额扣款与权益归属以该 user_id 为准 - type: integer - type: object - models.OrderItem: - properties: - amount_paid: - description: 该行实付金额:分;通常等于订单 amount_paid(单内容场景) - type: integer - content: - $ref: '#/definitions/models.Content' - content_id: - description: 内容ID:关联 contents.id;用于生成/撤销 content_access - type: integer - content_user_id: - description: 内容作者用户ID:用于后续分成/对账扩展;当前可为 0 或写入内容创建者 - type: integer - created_at: - description: 创建时间:默认 now() - type: string - id: - description: 主键ID:自增 - type: integer - order: - $ref: '#/definitions/models.Order' - order_id: - description: 订单ID:关联 orders.id;用于聚合订单明细 - type: integer - snapshot: - allOf: - - $ref: '#/definitions/types.JSONType-fields_OrderItemsSnapshot' - description: 内容快照:JSON;建议包含 title/price/discount 等,用于历史展示与审计 - tenant_id: - description: 租户ID:多租户隔离关键字段;必须与 orders.tenant_id 一致 - type: integer - updated_at: - description: 更新时间:默认 now() - type: string - user_id: - description: 用户ID:下单用户(buyer);冗余字段用于查询加速与审计 - type: integer - type: object - models.Tenant: - properties: - code: - type: string - config: - items: - type: integer - type: array - created_at: - type: string - expired_at: - type: string - id: - type: integer - name: - type: string - status: - $ref: '#/definitions/consts.TenantStatus' - updated_at: - type: string - user_id: - type: integer - users: - items: - $ref: '#/definitions/models.User' - type: array - uuid: + - $ref: '#/definitions/quyun_v2_app_http_v1_dto.Location' + description: Location 地区信息(省/市)。 + nickname: + description: Nickname 昵称。 type: string type: object - models.TenantInvite: - properties: - code: - description: 邀请码:用户加入租户时提交;同一租户内唯一 - type: string - created_at: - description: 创建时间:默认 now() - type: string - disabled_at: - description: 禁用时间:租户管理员禁用该邀请的时间(UTC) - type: string - disabled_operator_user_id: - description: 禁用操作人用户ID:租户管理员(审计用) - type: integer - expires_at: - description: 过期时间:到期后不可再使用(UTC);为空表示不过期 - type: string - id: - description: 主键ID:自增 - type: integer - max_uses: - description: 最大可使用次数:0 表示不限制;>0 时 used_count 达到该值后视为失效 - type: integer - remark: - description: 备注:生成/禁用原因等(审计用) - type: string - status: - allOf: - - $ref: '#/definitions/consts.TenantInviteStatus' - description: 邀请状态:active/disabled/expired;expired 也可由 expires_at 推导,业务侧需保持一致 - tenant_id: - description: 租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id - type: integer - updated_at: - description: 更新时间:默认 now() - type: string - used_count: - description: 已使用次数:每次成功加入时 +1;需事务保证并发下不超发 - type: integer - user_id: - description: 创建人用户ID:生成邀请码的租户管理员(审计用) - type: integer - type: object - models.TenantJoinRequest: - properties: - created_at: - description: 创建时间:默认 now() - type: string - decided_at: - description: 处理时间:审核通过/拒绝时记录(UTC) - type: string - decided_operator_user_id: - description: 处理人用户ID:租户管理员(审计用) - type: integer - decided_reason: - description: 处理说明:管理员通过/拒绝的原因(可选,审计用) - type: string - id: - description: 主键ID:自增 - type: integer - reason: - description: 申请原因:用户填写的加入说明(可选) - type: string - status: - allOf: - - $ref: '#/definitions/consts.TenantJoinRequestStatus' - description: 申请状态:pending/approved/rejected;状态变更需记录 decided_at 与 decided_operator_user_id - tenant_id: - description: 租户ID:多租户隔离关键字段;所有查询/写入必须限定 tenant_id - type: integer - updated_at: - description: 更新时间:默认 now() - type: string - user_id: - description: 申请人用户ID:发起加入申请的用户 - type: integer - type: object - models.TenantLedger: - properties: - amount: - description: 流水金额:分/最小货币单位;通常为正数,方向由 type 决定(由业务层约束) - type: integer - balance_after: - description: 变更后可用余额:用于审计与对账回放 - type: integer - balance_before: - description: 变更前可用余额:用于审计与对账回放 - type: integer - biz_ref_id: - description: 业务引用ID:与 biz_ref_type 配合使用(例如 orders.id);用于对账与审计 - type: integer - biz_ref_type: - description: 业务引用类型:order/refund/etc;与 biz_ref_id 组成可选的结构化幂等/追溯键 - type: string - created_at: - description: 创建时间:默认 now() - type: string - frozen_after: - description: 变更后冻结余额:用于审计与对账回放 - type: integer - frozen_before: - description: 变更前冻结余额:用于审计与对账回放 - type: integer - id: - description: 主键ID:自增 - type: integer - idempotency_key: - description: 幂等键:同一租户同一用户同一业务操作固定;用于防止重复落账(建议由业务层生成) - type: string - operator_user_id: - description: 操作者用户ID:谁触发该流水(admin/buyer/system);用于审计与追责;可为空(历史数据或无法识别时) - type: integer - order: - $ref: '#/definitions/models.Order' - order_id: - description: 关联订单ID:购买/退款类流水应关联 orders.id;非订单类可为空 - type: integer - remark: - description: 备注:业务说明/后台操作原因等;用于审计 - type: string - tenant_id: - description: 租户ID:多租户隔离关键字段;必须与 tenant_users.tenant_id 一致 - type: integer - type: - allOf: - - $ref: '#/definitions/consts.TenantLedgerType' - description: 流水类型:debit_purchase/credit_refund/freeze/unfreeze/adjustment;不同类型决定余额/冻结余额的变更方向 - updated_at: - description: 更新时间:默认 now() - type: string - user_id: - description: 用户ID:余额账户归属用户;对应 tenant_users.user_id - type: integer - type: object - models.TenantUser: - properties: - created_at: - type: string - id: - type: integer - role: - items: - $ref: '#/definitions/consts.TenantUserRole' - type: array - status: - $ref: '#/definitions/consts.UserStatus' - tenant_id: - type: integer - updated_at: - type: string - user_id: - type: integer - type: object - models.User: + dto.WalletResponse: properties: balance: - description: 全局可用余额:分/最小货币单位;用户在所有已加入租户内共享该余额;默认 0 - type: integer - balance_frozen: - description: 全局冻结余额:分/最小货币单位;用于下单冻结等;默认 0 - type: integer - created_at: - type: string - deleted_at: - $ref: '#/definitions/gorm.DeletedAt' - id: - type: integer - metas: + description: Balance 账户余额(单位元)。 + type: number + transactions: + description: Transactions 交易流水列表。 items: - type: integer + $ref: '#/definitions/dto.Transaction' type: array - owned: - $ref: '#/definitions/models.Tenant' - password: - type: string - roles: - items: - $ref: '#/definitions/consts.Role' - type: array - status: - $ref: '#/definitions/consts.UserStatus' - tenants: - items: - $ref: '#/definitions/models.Tenant' - type: array - updated_at: - type: string - username: - type: string - verified_at: + type: object + dto.WithdrawForm: + properties: + account_id: + description: AccountID 收款账户ID。 + type: integer + amount: + description: Amount 提现金额(单位元)。 + type: number + method: + description: Method 提现方式(wallet/external)。 type: string type: object - quyun_v2_app_http_super_dto.LoginForm: + quyun_v2_app_http_super_v1_dto.Location: + properties: + city: + type: string + province: + type: string + type: object + quyun_v2_app_http_super_v1_dto.LoginForm: properties: password: type: string username: type: string type: object - quyun_v2_app_http_super_dto.LoginResponse: + quyun_v2_app_http_super_v1_dto.LoginResponse: properties: token: type: string + user: + $ref: '#/definitions/quyun_v2_app_http_super_v1_dto.User' type: object - quyun_v2_app_http_tenant_dto.MeResponse: + quyun_v2_app_http_super_v1_dto.User: properties: - tenant: - allOf: - - $ref: '#/definitions/models.Tenant' - description: Tenant is the resolved tenant by `tenantCode`. - tenant_user: - allOf: - - $ref: '#/definitions/models.TenantUser' - description: TenantUser is the membership record of the authenticated user - within the tenant. + avatar: + type: string + balance: + type: number + bio: + type: string + birthday: + description: YYYY-MM-DD + type: string + gender: + $ref: '#/definitions/consts.Gender' + id: + type: integer + is_real_name_verified: + type: boolean + location: + $ref: '#/definitions/quyun_v2_app_http_super_v1_dto.Location' + nickname: + type: string + phone: + type: string + points: + type: integer + type: object + quyun_v2_app_http_v1_dto.Location: + properties: + city: + description: City 城市名称。 + type: string + province: + description: Province 省份名称。 + type: string + type: object + quyun_v2_app_http_v1_dto.LoginForm: + properties: + otp: + description: OTP 短信验证码。 + type: string + phone: + description: Phone 手机号(登录账号)。 + type: string + type: object + quyun_v2_app_http_v1_dto.LoginResponse: + properties: + token: + description: Token 登录成功后的 JWT。 + type: string user: allOf: - - $ref: '#/definitions/models.User' - description: User is the authenticated user derived from JWT `user_id`. + - $ref: '#/definitions/quyun_v2_app_http_v1_dto.User' + description: User 当前登录用户信息。 type: object - quyun_v2_app_http_web_dto.LoginForm: + quyun_v2_app_http_v1_dto.SendOTPForm: properties: - password: - description: Password 明文密码;后端会与 users.password 的 bcrypt hash 做比对。 - type: string - username: - description: Username 用户名;必须与数据库 users.username 精确匹配。 + phone: + description: Phone 手机号(用于发送验证码)。 type: string type: object - quyun_v2_app_http_web_dto.LoginResponse: + quyun_v2_app_http_v1_dto.User: properties: - token: - description: 'Token JWT 访问令牌;前端应以 `Authorization: Bearer ` 方式携带。' + avatar: + description: Avatar 头像URL。 type: string - type: object - quyun_v2_app_http_web_dto.MeResponse: - properties: - created_at: - description: CreatedAt 用户创建时间。 + balance: + description: Balance 余额(单位元)。 + type: number + bio: + description: Bio 个人简介。 type: string - id: - description: ID 用户ID(全局唯一)。 - type: integer - roles: - description: Roles 用户全局角色数组(如 user/super_admin 等)。 - items: - $ref: '#/definitions/consts.Role' - type: array - status: + birthday: + description: Birthday 生日(YYYY-MM-DD)。 + type: string + gender: allOf: - - $ref: '#/definitions/consts.UserStatus' - description: Status 用户状态(active/verified/banned 等)。 - status_description: - description: StatusDescription 用户状态描述(便于前端展示)。 + - $ref: '#/definitions/consts.Gender' + description: Gender 性别(枚举)。 + id: + description: ID 用户ID。 + type: integer + is_real_name_verified: + description: IsRealNameVerified 是否完成实名认证。 + type: boolean + location: + allOf: + - $ref: '#/definitions/quyun_v2_app_http_v1_dto.Location' + description: Location 地区信息(省/市)。 + nickname: + description: Nickname 昵称。 type: string - updated_at: - description: UpdatedAt 用户更新时间。 - type: string - username: - description: Username 用户名。 + phone: + description: Phone 绑定手机号。 type: string + points: + description: Points 积分余额。 + type: integer type: object requests.KV: properties: @@ -1814,9 +1439,12 @@ definitions: paging). type: integer type: object - types.JSONType-fields_OrderItemsSnapshot: - type: object - types.JSONType-fields_OrdersSnapshot: + v1.WebhookForm: + properties: + external_id: + type: string + order_id: + type: integer type: object externalDocs: description: OpenAPI @@ -1839,123 +1467,53 @@ paths: post: consumes: - application/json + description: Login parameters: - - description: form + - description: Login form in: body name: form required: true schema: - $ref: '#/definitions/quyun_v2_app_http_super_dto.LoginForm' + $ref: '#/definitions/quyun_v2_app_http_super_v1_dto.LoginForm' produces: - application/json responses: "200": - description: 成功 + description: OK schema: - $ref: '#/definitions/quyun_v2_app_http_super_dto.LoginResponse' + $ref: '#/definitions/quyun_v2_app_http_super_v1_dto.LoginResponse' + summary: Login tags: - - Super + - Auth /super/v1/auth/token: get: consumes: - application/json + description: Check token produces: - application/json responses: "200": - description: 成功 + description: OK schema: - $ref: '#/definitions/quyun_v2_app_http_super_dto.LoginResponse' + $ref: '#/definitions/quyun_v2_app_http_super_v1_dto.LoginResponse' + summary: Check token tags: - - Super + - Auth /super/v1/contents: get: consumes: - application/json + description: List contents parameters: - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - in: query - name: created_at_from - type: string - - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - in: query - name: id - type: integer - - in: query - name: keyword - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. + - description: Page number in: query name: page type: integer - - in: query - name: price_amount_max - type: integer - - in: query - name: price_amount_min - type: integer - - in: query - name: published_at_from - type: string - - in: query - name: published_at_to - type: string - - enum: - - draft - - reviewing - - published - - unpublished - - blocked + - description: Page size in: query - name: status - type: string - x-enum-varnames: - - ContentStatusDraft - - ContentStatusReviewing - - ContentStatusPublished - - ContentStatusUnpublished - - ContentStatusBlocked - - in: query - name: tenant_code - type: string - - in: query - name: tenant_id + name: limit type: integer - - in: query - name: tenant_name - type: string - - in: query - name: user_id - type: integer - - in: query - name: username - type: string - - enum: - - public - - tenant_only - - private - in: query - name: visibility - type: string - x-enum-varnames: - - ContentVisibilityPublic - - ContentVisibilityTenantOnly - - ContentVisibilityPrivate produces: - application/json responses: @@ -1966,100 +1524,27 @@ paths: - $ref: '#/definitions/requests.Pager' - properties: items: - $ref: '#/definitions/dto.SuperContentItem' + items: + $ref: '#/definitions/dto.AdminContentItem' + type: array type: object - summary: 内容列表(平台侧汇总) + summary: List contents tags: - - Super + - Content /super/v1/orders: get: consumes: - application/json + description: List orders parameters: - - in: query - name: amount_paid_max - type: integer - - in: query - name: amount_paid_min - type: integer - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - in: query - name: content_id - type: integer - - in: query - name: content_title - type: string - - in: query - name: created_at_from - type: string - - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - in: query - name: id - type: integer - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. + - description: Page number in: query name: page type: integer - - in: query - name: paid_at_from - type: string - - in: query - name: paid_at_to - type: string - - enum: - - created - - paid - - refunding - - refunded - - canceled - - failed + - description: Page size in: query - name: status - type: string - x-enum-varnames: - - OrderStatusCreated - - OrderStatusPaid - - OrderStatusRefunding - - OrderStatusRefunded - - OrderStatusCanceled - - OrderStatusFailed - - in: query - name: tenant_code - type: string - - in: query - name: tenant_id + name: limit type: integer - - in: query - name: tenant_name - type: string - - enum: - - content_purchase - in: query - name: type - type: string - x-enum-varnames: - - OrderTypeContentPurchase - - in: query - name: user_id - type: integer - - in: query - name: username - type: string produces: - application/json responses: @@ -2070,20 +1555,23 @@ paths: - $ref: '#/definitions/requests.Pager' - properties: items: - $ref: '#/definitions/dto.SuperOrderItem' + items: + $ref: '#/definitions/dto.SuperOrderItem' + type: array type: object - summary: 订单列表 + summary: List orders tags: - - Super - /super/v1/orders/{orderID}: + - Order + /super/v1/orders/{id}: get: consumes: - application/json + description: Get order parameters: - - description: OrderID + - description: Order ID format: int64 in: path - name: orderID + name: id required: true type: integer produces: @@ -2093,22 +1581,22 @@ paths: description: OK schema: $ref: '#/definitions/dto.SuperOrderDetail' - summary: 订单详情 + summary: Get order tags: - - Super - /super/v1/orders/{orderID}/refund: + - Order + /super/v1/orders/{id}/refund: post: consumes: - application/json - description: 该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。 + description: Refund order parameters: - - description: OrderID + - description: Order ID format: int64 in: path - name: orderID + name: id required: true type: integer - - description: Form + - description: Refund form in: body name: form required: true @@ -2118,16 +1606,17 @@ paths: - application/json responses: "200": - description: OK + description: Refunded schema: - $ref: '#/definitions/models.Order' - summary: 订单退款(平台) + type: string + summary: Refund order tags: - - Super + - Order /super/v1/orders/statistics: get: consumes: - application/json + description: Order statistics produces: - application/json responses: @@ -2135,67 +1624,27 @@ paths: description: OK schema: $ref: '#/definitions/dto.OrderStatisticsResponse' - summary: 订单统计信息 + summary: Order statistics tags: - - Super + - Order /super/v1/tenants: get: consumes: - application/json + description: List tenants parameters: - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - in: query - name: code - type: string - - in: query - name: created_at_from - type: string - - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - in: query - name: expired_at_from - type: string - - in: query - name: expired_at_to - type: string - - in: query - name: id - type: integer - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - in: query - name: name - type: string - - description: Page is 1-based page index; values <= 0 are normalized to 1. + - description: Page number in: query name: page type: integer - - enum: - - pending_verify - - verified - - banned + - description: Page size in: query - name: status - type: string - x-enum-varnames: - - TenantStatusPendingVerify - - TenantStatusVerified - - TenantStatusBanned - - in: query - name: user_id + name: limit type: integer + - description: Name + in: query + name: name + type: string produces: - application/json responses: @@ -2206,16 +1655,19 @@ paths: - $ref: '#/definitions/requests.Pager' - properties: items: - $ref: '#/definitions/dto.TenantItem' + items: + $ref: '#/definitions/dto.TenantItem' + type: array type: object - summary: 租户列表 + summary: List tenants tags: - - Super + - Tenant post: consumes: - application/json + description: Create tenant parameters: - - description: Form + - description: Create form in: body name: form required: true @@ -2225,21 +1677,22 @@ paths: - application/json responses: "200": - description: OK + description: Created schema: - $ref: '#/definitions/models.Tenant' - summary: 创建租户并设置租户管理员 + type: string + summary: Create tenant tags: - - Super - /super/v1/tenants/{tenantID}: + - Tenant + /super/v1/tenants/{id}: get: consumes: - application/json + description: Get tenant parameters: - - description: TenantID + - description: Tenant ID format: int64 in: path - name: tenantID + name: id required: true type: integer produces: @@ -2249,20 +1702,21 @@ paths: description: OK schema: $ref: '#/definitions/dto.TenantItem' - summary: 租户详情 + summary: Get tenant tags: - - Super + - Tenant patch: consumes: - application/json + description: Update tenant expire parameters: - - description: TenantID + - description: Tenant ID format: int64 in: path - name: tenantID + name: id required: true type: integer - - description: Form + - description: Update form in: body name: form required: true @@ -2270,83 +1724,62 @@ paths: $ref: '#/definitions/dto.TenantExpireUpdateForm' produces: - application/json - responses: {} - summary: 更新过期时间 + responses: + "200": + description: Updated + schema: + type: string + summary: Update tenant expire tags: - - Super + - Tenant + /super/v1/tenants/{id}/status: + patch: + consumes: + - application/json + description: Update tenant status + parameters: + - description: Tenant ID + format: int64 + in: path + name: id + required: true + type: integer + - description: Update form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.TenantStatusUpdateForm' + produces: + - application/json + responses: + "200": + description: Updated + schema: + type: string + summary: Update tenant status + tags: + - Tenant /super/v1/tenants/{tenantID}/contents: get: consumes: - application/json + description: List contents by tenant parameters: - - description: TenantID + - description: Tenant ID format: int64 in: path name: tenantID required: true type: integer - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - in: query - name: created_at_from - type: string - - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - in: query - name: keyword - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. + - description: Page number in: query name: page type: integer - - in: query - name: published_at_from - type: string - - in: query - name: published_at_to - type: string - - enum: - - draft - - reviewing - - published - - unpublished - - blocked + - description: Page size in: query - name: status - type: string - x-enum-varnames: - - ContentStatusDraft - - ContentStatusReviewing - - ContentStatusPublished - - ContentStatusUnpublished - - ContentStatusBlocked - - in: query - name: user_id + name: limit type: integer - - enum: - - public - - tenant_only - - private - in: query - name: visibility - type: string - x-enum-varnames: - - ContentVisibilityPublic - - ContentVisibilityTenantOnly - - ContentVisibilityPrivate produces: - application/json responses: @@ -2357,29 +1790,32 @@ paths: - $ref: '#/definitions/requests.Pager' - properties: items: - $ref: '#/definitions/dto.SuperTenantContentItem' + items: + $ref: '#/definitions/dto.AdminContentItem' + type: array type: object - summary: 租户内容列表(平台侧) + summary: List tenant contents tags: - - Super + - Content /super/v1/tenants/{tenantID}/contents/{contentID}/status: patch: consumes: - application/json + description: Update content status parameters: - - description: TenantID + - description: Tenant ID format: int64 in: path name: tenantID required: true type: integer - - description: ContentID + - description: Content ID format: int64 in: path name: contentID required: true type: integer - - description: Form + - description: Update form in: body name: form required: true @@ -2389,85 +1825,32 @@ paths: - application/json responses: "200": - description: OK + description: Updated schema: - $ref: '#/definitions/models.Content' - summary: 更新租户内容状态(平台侧:下架/封禁) + type: string + summary: Update content status tags: - - Super - /super/v1/tenants/{tenantID}/status: - patch: - consumes: - - application/json - parameters: - - description: TenantID - format: int64 - in: path - name: tenantID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.TenantStatusUpdateForm' - produces: - - application/json - responses: {} - summary: 更新租户状态 - tags: - - Super + - Content /super/v1/tenants/{tenantID}/users: get: consumes: - application/json + description: List tenant users parameters: - - description: TenantID + - description: Tenant ID format: int64 in: path name: tenantID required: true type: integer - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. + - description: Page number in: query name: page type: integer - - description: Role 按角色过滤(可选):member/tenant_admin。 - enum: - - member - - tenant_admin + - description: Page size in: query - name: role - type: string - x-enum-varnames: - - TenantUserRoleMember - - TenantUserRoleTenantAdmin - - description: Status 按成员状态过滤(可选):pending_verify/verified/banned。 - enum: - - pending_verify - - verified - - banned - in: query - name: status - type: string - x-enum-varnames: - - UserStatusPendingVerify - - UserStatusVerified - - UserStatusBanned - - description: UserID 按用户ID过滤(可选)。 - in: query - name: user_id + name: limit type: integer - - description: Username 按用户名模糊查询(可选,支持包含匹配)。 - in: query - name: username - type: string produces: - application/json responses: @@ -2478,15 +1861,18 @@ paths: - $ref: '#/definitions/requests.Pager' - properties: items: - $ref: '#/definitions/dto.SuperTenantUserItem' + items: + $ref: '#/definitions/dto.SuperTenantUserItem' + type: array type: object - summary: 租户成员列表(平台侧) + summary: List tenant users tags: - - Super + - Tenant /super/v1/tenants/statuses: get: consumes: - application/json + description: Tenant statuses produces: - application/json responses: @@ -2496,75 +1882,27 @@ paths: items: $ref: '#/definitions/requests.KV' type: array - summary: 租户状态列表 + summary: Tenant statuses tags: - - Super + - Tenant /super/v1/users: get: consumes: - application/json + description: List users parameters: - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - in: query - name: created_at_from - type: string - - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - in: query - name: id - type: integer - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. + - description: Page number in: query name: page type: integer - - description: Role filters users containing a role (user/super_admin). - enum: - - user - - super_admin + - description: Page size in: query - name: role - type: string - x-enum-varnames: - - RoleUser - - RoleSuperAdmin - - enum: - - pending_verify - - verified - - banned - in: query - name: status - type: string - x-enum-varnames: - - UserStatusPendingVerify - - UserStatusVerified - - UserStatusBanned - - description: TenantID filters users by membership in the given tenant. - in: query - name: tenant_id + name: limit type: integer - - in: query + - description: Username + in: query name: username type: string - - in: query - name: verified_at_from - type: string - - in: query - name: verified_at_to - type: string produces: - application/json responses: @@ -2575,20 +1913,23 @@ paths: - $ref: '#/definitions/requests.Pager' - properties: items: - $ref: '#/definitions/dto.UserItem' + items: + $ref: '#/definitions/dto.UserItem' + type: array type: object - summary: 用户列表 + summary: List users tags: - - Super - /super/v1/users/{userID}: + - User + /super/v1/users/{id}: get: consumes: - application/json + description: Get user parameters: - - description: UserID + - description: User ID format: int64 in: path - name: userID + name: id required: true type: integer produces: @@ -2598,21 +1939,22 @@ paths: description: OK schema: $ref: '#/definitions/dto.UserItem' - summary: 用户详情 + summary: Get user tags: - - Super - /super/v1/users/{userID}/roles: + - User + /super/v1/users/{id}/roles: patch: consumes: - application/json + description: Update user roles parameters: - - description: UserID + - description: User ID format: int64 in: path - name: userID + name: id required: true type: integer - - description: Form + - description: Update form in: body name: form required: true @@ -2620,22 +1962,27 @@ paths: $ref: '#/definitions/dto.UserRolesUpdateForm' produces: - application/json - responses: {} - summary: 更新用户角色 + responses: + "200": + description: Updated + schema: + type: string + summary: Update user roles tags: - - Super - /super/v1/users/{userID}/status: + - User + /super/v1/users/{id}/status: patch: consumes: - application/json + description: Update user status parameters: - - description: UserID + - description: User ID format: int64 in: path - name: userID + name: id required: true type: integer - - description: Form + - description: Update form in: body name: form required: true @@ -2643,66 +1990,33 @@ paths: $ref: '#/definitions/dto.UserStatusUpdateForm' produces: - application/json - responses: {} - summary: 更新用户状态 + responses: + "200": + description: Updated + schema: + type: string + summary: Update user status tags: - - Super - /super/v1/users/{userID}/tenants: + - User + /super/v1/users/{id}/tenants: get: consumes: - application/json + description: List tenants joined by user parameters: - - description: UserID + - description: User ID format: int64 in: path - name: userID + name: id required: true type: integer - - in: query - name: code - type: string - - in: query - name: created_at_from - type: string - - in: query - name: created_at_to - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - in: query - name: name - type: string - - description: Page is 1-based page index; values <= 0 are normalized to 1. + - description: Page number in: query name: page type: integer - - description: Role filters tenant_users.role containing a role (tenant_admin/member). - enum: - - member - - tenant_admin + - description: Page size in: query - name: role - type: string - x-enum-varnames: - - TenantUserRoleMember - - TenantUserRoleTenantAdmin - - description: Status filters tenant_users.status. - enum: - - pending_verify - - verified - - banned - in: query - name: status - type: string - x-enum-varnames: - - UserStatusPendingVerify - - UserStatusVerified - - UserStatusBanned - - in: query - name: tenant_id + name: limit type: integer produces: - application/json @@ -2714,15 +2028,18 @@ paths: - $ref: '#/definitions/requests.Pager' - properties: items: - $ref: '#/definitions/dto.UserTenantItem' + items: + $ref: '#/definitions/dto.UserTenantItem' + type: array type: object - summary: 用户加入的租户列表 + summary: List user tenants tags: - - Super + - User /super/v1/users/statistics: get: consumes: - application/json + description: User statistics produces: - application/json responses: @@ -2732,13 +2049,14 @@ paths: items: $ref: '#/definitions/dto.UserStatistics' type: array - summary: 用户统计信息 + summary: User statistics tags: - - Super + - User /super/v1/users/statuses: get: consumes: - application/json + description: User statuses produces: - application/json responses: @@ -2748,29 +2066,118 @@ paths: items: $ref: '#/definitions/requests.KV' type: array - summary: 用户状态列表 + summary: User statuses tags: - - Super + - User + /t/{tenantCode}/v1/auth/login: + post: + consumes: + - application/json + description: Login or register user using phone number and OTP + parameters: + - description: Login form + in: body + name: form + required: true + schema: + $ref: '#/definitions/quyun_v2_app_http_v1_dto.LoginForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/quyun_v2_app_http_v1_dto.LoginResponse' + summary: Login or Register with OTP + tags: + - Auth + /t/{tenantCode}/v1/auth/otp: + post: + consumes: + - application/json + description: Send OTP to phone number + parameters: + - description: Phone number + in: body + name: form + required: true + schema: + $ref: '#/definitions/quyun_v2_app_http_v1_dto.SendOTPForm' + produces: + - application/json + responses: + "200": + description: OTP sent + schema: + type: string + summary: Send OTP + tags: + - Auth + /t/{tenantCode}/v1/comments/{id}/like: + post: + consumes: + - application/json + description: Like a comment + parameters: + - description: Comment ID + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: Liked + schema: + type: string + summary: Like comment + tags: + - Content + /t/{tenantCode}/v1/common/options: + get: + consumes: + - application/json + description: Get global options (enums) + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.OptionsResponse' + summary: Get options + tags: + - Common /t/{tenantCode}/v1/contents: get: consumes: - application/json + description: List contents with filtering and pagination parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Keyword filters by title keyword (LIKE). + - description: Search keyword in: query name: keyword type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). + - description: Genre in: query - name: limit + name: genre + type: string + - description: Filter by creator + format: int64 + in: query + name: tenant_id type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. + - description: Sort order + enum: + - latest + - hot + - price_asc + in: query + name: sort + type: string + - description: Page number in: query name: page type: integer @@ -2784,25 +2191,23 @@ paths: - $ref: '#/definitions/requests.Pager' - properties: items: - $ref: '#/definitions/dto.ContentItem' + items: + $ref: '#/definitions/dto.ContentItem' + type: array type: object - summary: 内容列表(已发布) + summary: List contents tags: - - Tenant - /t/{tenantCode}/v1/contents/{contentID}: + - Content + /t/{tenantCode}/v1/contents/{id}: get: consumes: - application/json + description: Get content detail by ID parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID + - description: Content ID format: int64 in: path - name: contentID + name: id required: true type: integer produces: @@ -2812,220 +2217,25 @@ paths: description: OK schema: $ref: '#/definitions/dto.ContentDetail' - summary: 内容详情(可见性+权益校验) + summary: Get content detail tags: - - Tenant - /t/{tenantCode}/v1/contents/{contentID}/assets: + - Content + /t/{tenantCode}/v1/contents/{id}/comments: get: consumes: - application/json + description: Get comments for a content parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID + - description: Content ID format: int64 in: path - name: contentID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.ContentAssetsResponse' - summary: 获取正片资源(main role,需要已购或免费) - tags: - - Tenant - /t/{tenantCode}/v1/contents/{contentID}/preview: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID - format: int64 - in: path - name: contentID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.ContentAssetsResponse' - summary: 获取试看资源(preview role) - tags: - - Tenant - /t/{tenantCode}/v1/contents/{contentID}/purchase: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID - format: int64 - in: path - name: contentID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.PurchaseContentForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.PurchaseContentResponse' - summary: 购买内容(余额支付) - tags: - - Tenant - /t/{tenantCode}/v1/join/invite: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.JoinByInviteForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.TenantUser' - summary: 通过邀请码加入租户 - tags: - - TenantJoin - /t/{tenantCode}/v1/join/request: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.JoinRequestCreateForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.TenantJoinRequest' - summary: 提交加入租户申请 - tags: - - TenantJoin - /t/{tenantCode}/v1/management/contents: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - in: query - name: created_at_from - type: string - - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - in: query name: id + required: true type: integer - - in: query - name: keyword - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. + - description: Page number in: query name: page type: integer - - in: query - name: published_at_from - type: string - - in: query - name: published_at_to - type: string - - enum: - - draft - - reviewing - - published - - unpublished - - blocked - in: query - name: status - type: string - x-enum-varnames: - - ContentStatusDraft - - ContentStatusReviewing - - ContentStatusPublished - - ContentStatusUnpublished - - ContentStatusBlocked - - in: query - name: user_id - type: integer - - enum: - - public - - tenant_only - - private - in: query - name: visibility - type: string - x-enum-varnames: - - ContentVisibilityPublic - - ContentVisibilityTenantOnly - - ContentVisibilityPrivate produces: - application/json responses: @@ -3036,21 +2246,164 @@ paths: - $ref: '#/definitions/requests.Pager' - properties: items: - $ref: '#/definitions/dto.AdminContentItem' + items: + $ref: '#/definitions/dto.Comment' + type: array type: object - summary: 内容列表(租户管理) + summary: Get comments tags: - - Tenant + - Content post: consumes: - application/json + description: Post a comment to a content parameters: - - description: Tenant Code + - description: Content ID + format: int64 in: path - name: tenantCode + name: id required: true + type: integer + - description: Comment form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.CommentCreateForm' + produces: + - application/json + responses: + "200": + description: Comment created + schema: + type: string + summary: Post comment + tags: + - Content + /t/{tenantCode}/v1/contents/{id}/favorite: + delete: + parameters: + - description: Content ID + format: int64 + in: path + name: id + required: true + type: integer + responses: + "200": + description: Unfavorited + schema: + type: string + summary: Remove favorite + tags: + - Content + post: + parameters: + - description: Content ID + format: int64 + in: path + name: id + required: true + type: integer + responses: + "200": + description: Favorited + schema: + type: string + summary: Add favorite + tags: + - Content + /t/{tenantCode}/v1/contents/{id}/like: + delete: + parameters: + - description: Content ID + format: int64 + in: path + name: id + required: true + type: integer + responses: + "200": + description: Unliked + schema: + type: string + summary: Remove like + tags: + - Content + post: + parameters: + - description: Content ID + format: int64 + in: path + name: id + required: true + type: integer + responses: + "200": + description: Liked + schema: + type: string + summary: Add like + tags: + - Content + /t/{tenantCode}/v1/creator/apply: + post: + consumes: + - application/json + description: Apply to become a creator + parameters: + - description: Apply form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.ApplyForm' + produces: + - application/json + responses: + "200": + description: Application submitted + schema: + type: string + summary: Apply creator + tags: + - CreatorCenter + /t/{tenantCode}/v1/creator/contents: + get: + consumes: + - application/json + description: List creator contents + parameters: + - description: Status + in: query + name: status type: string - - description: Form + - description: Genre + in: query + name: genre + type: string + - description: Keyword + in: query + name: keyword + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.ContentItem' + type: array + summary: List contents + tags: + - CreatorCenter + post: + consumes: + - application/json + description: Create/Publish content + parameters: + - description: Content form in: body name: form required: true @@ -3060,29 +2413,67 @@ paths: - application/json responses: "200": - description: OK + description: Created schema: - $ref: '#/definitions/models.Content' - summary: 创建内容(草稿) + type: string + summary: Create content tags: - - Tenant - /t/{tenantCode}/v1/management/contents/{contentID}: - patch: + - CreatorCenter + /t/{tenantCode}/v1/creator/contents/{id}: + delete: consumes: - application/json + description: Delete content parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID + - description: Content ID format: int64 in: path - name: contentID + name: id required: true type: integer - - description: Form + produces: + - application/json + responses: + "200": + description: Deleted + schema: + type: string + summary: Delete content + tags: + - CreatorCenter + get: + consumes: + - application/json + description: Get content details for edit + parameters: + - description: Content ID + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.ContentEditDTO' + summary: Get content + tags: + - CreatorCenter + put: + consumes: + - application/json + description: Update content + parameters: + - description: Content ID + format: int64 + in: path + name: id + required: true + type: integer + - description: Update form in: body name: form required: true @@ -3092,949 +2483,218 @@ paths: - application/json responses: "200": - description: OK + description: Updated schema: - $ref: '#/definitions/models.Content' - summary: 更新内容(标题/描述/状态等) + type: string + summary: Update content tags: - - Tenant - /t/{tenantCode}/v1/management/contents/{contentID}/assets: - post: + - CreatorCenter + /t/{tenantCode}/v1/creator/dashboard: + get: consumes: - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID - format: int64 - in: path - name: contentID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.ContentAssetAttachForm' + description: Get creator dashboard stats produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/models.ContentAsset' - summary: 绑定媒体资源到内容(main/cover/preview) + $ref: '#/definitions/dto.DashboardStats' + summary: Dashboard stats tags: - - Tenant - /t/{tenantCode}/v1/management/contents/{contentID}/price: + - CreatorCenter + /t/{tenantCode}/v1/creator/orders: + get: + consumes: + - application/json + description: List sales orders + parameters: + - description: Status + in: query + name: status + type: string + - description: Keyword + in: query + name: keyword + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.Order' + type: array + summary: List sales orders + tags: + - CreatorCenter + /t/{tenantCode}/v1/creator/orders/{id}/refund: + post: + consumes: + - application/json + description: Process refund + parameters: + - description: Order ID + format: int64 + in: path + name: id + required: true + type: integer + - description: Refund form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.RefundForm' + produces: + - application/json + responses: + "200": + description: Processed + schema: + type: string + summary: Process refund + tags: + - CreatorCenter + /t/{tenantCode}/v1/creator/payout-accounts: + delete: + consumes: + - application/json + description: Remove payout account + parameters: + - description: Account ID + format: int64 + in: query + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: Removed + schema: + type: string + summary: Remove payout account + tags: + - CreatorCenter + get: + consumes: + - application/json + description: List payout accounts + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.PayoutAccount' + type: array + summary: List payout accounts + tags: + - CreatorCenter + post: + consumes: + - application/json + description: Add payout account + parameters: + - description: Account form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.PayoutAccount' + produces: + - application/json + responses: + "200": + description: Added + schema: + type: string + summary: Add payout account + tags: + - CreatorCenter + /t/{tenantCode}/v1/creator/settings: + get: + consumes: + - application/json + description: Get channel settings + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.Settings' + summary: Get settings + tags: + - CreatorCenter put: consumes: - application/json + description: Update channel settings parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID - format: int64 - in: path - name: contentID - required: true - type: integer - - description: Form + - description: Settings form in: body name: form required: true schema: - $ref: '#/definitions/dto.ContentPriceUpsertForm' + $ref: '#/definitions/dto.Settings' produces: - application/json responses: "200": - description: OK + description: Updated schema: - $ref: '#/definitions/models.ContentPrice' - summary: 设置内容价格与折扣 + type: string + summary: Update settings tags: - - Tenant - /t/{tenantCode}/v1/management/contents/publish: + - CreatorCenter + /t/{tenantCode}/v1/creator/withdraw: post: consumes: - application/json + description: Request withdrawal parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Form + - description: Withdraw form in: body name: form required: true schema: - $ref: '#/definitions/dto.ContentPublishForm' + $ref: '#/definitions/dto.WithdrawForm' produces: - application/json responses: "200": - description: OK + description: Withdrawal requested schema: - $ref: '#/definitions/dto.ContentPublishResponse' - summary: 内容发布(创建+绑定资源+定价) + type: string + summary: Request withdrawal tags: - - Tenant - /t/{tenantCode}/v1/management/invites: + - CreatorCenter + /t/{tenantCode}/v1/creators/{id}/contents: get: consumes: - application/json + description: List contents of a specific creator parameters: - - description: Tenant Code + - description: Tenant ID + format: int64 in: path - name: tenantCode + name: id required: true - type: string - - description: Code 按邀请码模糊过滤(可选):支持部分匹配(like)。 - in: query - name: code - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. + - description: Page in: query name: page type: integer - - description: Status 按状态过滤(可选):active/disabled/expired。 - enum: - - active - - disabled - - expired - in: query - name: status - type: string - x-enum-varnames: - - TenantInviteStatusActive - - TenantInviteStatusDisabled - - TenantInviteStatusExpired - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/models.TenantInvite' - type: object - summary: 邀请码列表(租户管理) - tags: - - Tenant - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminTenantInviteCreateForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.TenantInvite' - summary: 创建邀请码(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/invites/{inviteID}/disable: - patch: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: InviteID - format: int64 - in: path - name: inviteID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminTenantInviteDisableForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.TenantInvite' - summary: 禁用邀请码(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/join-requests: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). + - description: Limit in: query name: limit type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: Status 按申请状态过滤(可选):pending/approved/rejected。 - enum: - - pending - - approved - - rejected - in: query - name: status - type: string - x-enum-varnames: - - TenantJoinRequestStatusPending - - TenantJoinRequestStatusApproved - - TenantJoinRequestStatusRejected - - description: UserID 按申请人用户ID过滤(可选)。 - in: query - name: user_id - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/models.TenantJoinRequest' - type: object - summary: 加入申请列表(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/join-requests/{requestID}/approve: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: RequestID - format: int64 - in: path - name: requestID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminTenantJoinRequestDecideForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.TenantJoinRequest' - summary: 通过加入申请(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/join-requests/{requestID}/reject: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: RequestID - format: int64 - in: path - name: requestID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminTenantJoinRequestDecideForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.TenantJoinRequest' - summary: 拒绝加入申请(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/ledgers: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: BizRefID 按业务引用ID过滤(可选)。 - in: query - name: biz_ref_id - type: integer - - description: |- - BizRefType 按业务引用类型过滤(可选)。 - 约定:当前业务写入为 "order";未来可扩展为 refund 等。 - in: query - name: biz_ref_type - type: string - - description: CreatedAtFrom 创建时间起(可选)。 - in: query - name: created_at_from - type: string - - description: CreatedAtTo 创建时间止(可选)。 - in: query - name: created_at_to - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: |- - OperatorUserID 按操作者用户ID过滤(可选)。 - 典型场景:后台检索“某个管理员发起的退款/调账”等敏感操作流水。 - in: query - name: operator_user_id - type: integer - - description: OrderID 按关联订单过滤(可选)。 - in: query - name: order_id - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: Type 按流水类型过滤(可选)。 - enum: - - debit_purchase - - credit_refund - - freeze - - unfreeze - - adjustment - in: query - name: type - type: string - x-enum-varnames: - - TenantLedgerTypeDebitPurchase - - TenantLedgerTypeCreditRefund - - TenantLedgerTypeFreeze - - TenantLedgerTypeUnfreeze - - TenantLedgerTypeAdjustment - - description: |- - UserID 按余额账户归属用户ID过滤(可选)。 - 典型场景:查看某个租户成员的资金变化全链路。 - in: query - name: user_id - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/dto.AdminLedgerItem' - type: object - summary: 余额流水列表(租户管理/审计) - tags: - - Tenant - /t/{tenantCode}/v1/management/media_assets: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - description: CreatedAtFrom filters assets by created_at >= this time; optional. - in: query - name: created_at_from - type: string - - description: CreatedAtTo filters assets by created_at <= this time; optional. - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: Status filters by processing status (uploaded/processing/ready/failed/deleted); - optional. - enum: - - uploaded - - processing - - ready - - failed - - deleted - in: query - name: status - type: string - x-enum-varnames: - - MediaAssetStatusUploaded - - MediaAssetStatusProcessing - - MediaAssetStatusReady - - MediaAssetStatusFailed - - MediaAssetStatusDeleted - - description: Type filters by media type (video/audio/image); optional. - enum: - - video - - audio - - image - in: query - name: type - type: string - x-enum-varnames: - - MediaAssetTypeVideo - - MediaAssetTypeAudio - - MediaAssetTypeImage - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/models.MediaAsset' - type: object - summary: 媒体资源列表(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/media_assets/{assetID}: - delete: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: AssetID - format: int64 - in: path - name: assetID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.MediaAsset' - summary: 删除媒体资源(租户管理,软删) - tags: - - Tenant - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: AssetID - format: int64 - in: path - name: assetID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.MediaAsset' - summary: 媒体资源详情(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/media_assets/{assetID}/upload_complete: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: AssetID - format: int64 - in: path - name: assetID - required: true - type: integer - - description: Form - in: body - name: form - schema: - $ref: '#/definitions/dto.AdminMediaAssetUploadCompleteForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.MediaAsset' - summary: 确认上传完成并进入处理(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/media_assets/upload_init: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminMediaAssetUploadInitForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.AdminMediaAssetUploadInitResponse' - summary: 初始化媒体资源上传(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/orders: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: AmountPaidMax 实付金额上限(可选):amount_paid <= 该值(单位分)。 - in: query - name: amount_paid_max - type: integer - - description: AmountPaidMin 实付金额下限(可选):amount_paid >= 该值(单位分)。 - in: query - name: amount_paid_min - type: integer - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - description: ContentID 内容ID(可选):通过 order_items 关联过滤。 - in: query - name: content_id - type: integer - - description: ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。 - in: query - name: content_title - type: string - - description: CreatedAtFrom 创建时间起(可选):created_at >= 该时间(用于按创建时间筛选)。 - in: query - name: created_at_from - type: string - - description: CreatedAtTo 创建时间止(可选):created_at <= 该时间(用于按创建时间筛选)。 - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: PaidAtFrom 支付时间起(可选):paid_at >= 该时间(用于按支付时间筛选)。 - in: query - name: paid_at_from - type: string - - description: PaidAtTo 支付时间止(可选):paid_at <= 该时间(用于按支付时间筛选)。 - in: query - name: paid_at_to - type: string - - description: Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。 - enum: - - created - - paid - - refunding - - refunded - - canceled - - failed - in: query - name: status - type: string - x-enum-varnames: - - OrderStatusCreated - - OrderStatusPaid - - OrderStatusRefunding - - OrderStatusRefunded - - OrderStatusCanceled - - OrderStatusFailed - - description: Type 订单类型(可选):content_purchase 等。 - enum: - - content_purchase - in: query - name: type - type: string - x-enum-varnames: - - OrderTypeContentPurchase - - description: UserID 下单用户ID(可选):按买家用户ID精确过滤。 - in: query - name: user_id - type: integer - - description: Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。 - in: query - name: username - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/models.Order' - type: object - summary: 订单列表(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/orders/{orderID}: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: OrderID - format: int64 - in: path - name: orderID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.AdminOrderDetail' - summary: 订单详情(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/orders/{orderID}/refund: - post: - consumes: - - application/json - description: |- - 该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。 - 重复请求幂等:订单处于 refunding/refunded 时会返回当前订单状态,不会重复入账/重复回收权益。 - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: OrderID - format: int64 - in: path - name: orderID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminOrderRefundForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.Order' - summary: 订单退款(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/orders/export: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: AmountPaidMax 实付金额上限(可选):amount_paid <= 该值(单位分)。 - in: query - name: amount_paid_max - type: integer - - description: AmountPaidMin 实付金额下限(可选):amount_paid >= 该值(单位分)。 - in: query - name: amount_paid_min - type: integer - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - description: ContentID 内容ID(可选):通过 order_items 关联过滤。 - in: query - name: content_id - type: integer - - description: ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。 - in: query - name: content_title - type: string - - description: CreatedAtFrom 创建时间起(可选):created_at >= 该时间(用于按创建时间筛选)。 - in: query - name: created_at_from - type: string - - description: CreatedAtTo 创建时间止(可选):created_at <= 该时间(用于按创建时间筛选)。 - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: PaidAtFrom 支付时间起(可选):paid_at >= 该时间(用于按支付时间筛选)。 - in: query - name: paid_at_from - type: string - - description: PaidAtTo 支付时间止(可选):paid_at <= 该时间(用于按支付时间筛选)。 - in: query - name: paid_at_to - type: string - - description: Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。 - enum: - - created - - paid - - refunding - - refunded - - canceled - - failed - in: query - name: status - type: string - x-enum-varnames: - - OrderStatusCreated - - OrderStatusPaid - - OrderStatusRefunding - - OrderStatusRefunded - - OrderStatusCanceled - - OrderStatusFailed - - description: Type 订单类型(可选):content_purchase 等。 - enum: - - content_purchase - in: query - name: type - type: string - x-enum-varnames: - - OrderTypeContentPurchase - - description: UserID 下单用户ID(可选):按买家用户ID精确过滤。 - in: query - name: user_id - type: integer - - description: Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。 - in: query - name: username - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.AdminOrderExportResponse' - summary: 订单导出(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/users: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: Role 按角色过滤(可选):member/tenant_admin。 - enum: - - member - - tenant_admin - in: query - name: role - type: string - x-enum-varnames: - - TenantUserRoleMember - - TenantUserRoleTenantAdmin - - description: Status 按成员状态过滤(可选):pending_verify/verified/banned。 - enum: - - pending_verify - - verified - - banned - in: query - name: status - type: string - x-enum-varnames: - - UserStatusPendingVerify - - UserStatusVerified - - UserStatusBanned - - description: UserID 按用户ID过滤(可选)。 - in: query - name: user_id - type: integer - - description: Username 按用户名模糊查询(可选,支持包含匹配)。 - in: query - name: username - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/dto.AdminTenantUserItem' - type: object - summary: 成员列表(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/users/{userID}: - delete: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: UserID - format: int64 - in: path - name: userID - required: true - type: integer produces: - application/json responses: @@ -4042,264 +2702,232 @@ paths: description: OK schema: $ref: '#/definitions/requests.Pager' - summary: 移除租户成员(租户管理) + summary: List creator contents tags: - - Tenant - /t/{tenantCode}/v1/management/users/{userID}/join: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: UserID - format: int64 - in: path - name: userID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.AdminTenantUserJoinResponse' - summary: 添加租户成员(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/management/users/{userID}/role: - patch: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: UserID - format: int64 - in: path - name: userID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminTenantUserRoleUpdateForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.AdminTenantUserJoinResponse' - summary: 设置成员角色(租户管理) - tags: - - Tenant + - TenantPublic /t/{tenantCode}/v1/me: get: consumes: - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string + description: Get current user profile produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/quyun_v2_app_http_tenant_dto.MeResponse' - summary: 当前租户上下文信息 + $ref: '#/definitions/quyun_v2_app_http_v1_dto.User' + summary: Get user profile tags: - - Tenant - /t/{tenantCode}/v1/me/balance: - get: + - UserCenter + put: consumes: - application/json + description: Update user profile parameters: - - description: Tenant Code - in: path - name: tenantCode + - description: Update form + in: body + name: form required: true - type: string + schema: + $ref: '#/definitions/dto.UserUpdate' produces: - application/json responses: "200": - description: OK + description: Updated schema: - $ref: '#/definitions/dto.MeBalanceResponse' - summary: 当前租户余额信息 + type: string + summary: Update user profile tags: - - Tenant - /t/{tenantCode}/v1/me/ledgers: + - UserCenter + /t/{tenantCode}/v1/me/coupons: get: consumes: - application/json + description: List my coupons parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/dto.MyLedgerItem' - type: object - summary: 当前租户余额流水(分页) - tags: - - Tenant - /t/{tenantCode}/v1/media/play: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Play token - in: query - name: token - required: true - type: string - produces: - - application/json - responses: {} - summary: 媒体播放入口(短时效 token) - tags: - - TenantMedia - /t/{tenantCode}/v1/orders: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID filters orders by purchased content id (via order_items - join). - in: query - name: content_id - type: integer - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: PaidAtFrom filters orders by paid_at >= this time. - in: query - name: paid_at_from - type: string - - description: PaidAtTo filters orders by paid_at <= this time. - in: query - name: paid_at_to - type: string - - description: Status filters orders by order status. - enum: - - created - - paid - - refunding - - refunded - - canceled - - failed + - description: Status (unused, used, expired) in: query name: status type: string - x-enum-varnames: - - OrderStatusCreated - - OrderStatusPaid - - OrderStatusRefunding - - OrderStatusRefunded - - OrderStatusCanceled - - OrderStatusFailed produces: - application/json responses: "200": description: OK schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/models.Order' - type: object - summary: 我的订单列表(当前租户) + items: + $ref: '#/definitions/dto.UserCouponItem' + type: array + summary: List coupons tags: - - Tenant - /t/{tenantCode}/v1/orders/{orderID}: + - UserCenter + /t/{tenantCode}/v1/me/favorites: get: consumes: - application/json + description: Get favorites + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.ContentItem' + type: array + summary: Get favorites + tags: + - UserCenter + post: + consumes: + - application/json + description: Add to favorites parameters: - - description: Tenant Code - in: path - name: tenantCode + - description: Content ID + format: int64 + in: query + name: contentId required: true - type: string - - description: OrderID + type: integer + produces: + - application/json + responses: + "200": + description: Added + schema: + type: string + summary: Add favorite + tags: + - UserCenter + /t/{tenantCode}/v1/me/favorites/{contentId}: + delete: + consumes: + - application/json + description: Remove from favorites + parameters: + - description: Content ID format: int64 in: path - name: orderID + name: contentId required: true type: integer produces: - application/json responses: "200": - description: OK + description: Removed schema: - $ref: '#/definitions/models.Order' - summary: 我的订单详情(当前租户) + type: string + summary: Remove favorite tags: - - Tenant - /t/{tenantCode}/v1/public/contents: + - UserCenter + /t/{tenantCode}/v1/me/following: get: consumes: - application/json + description: Get following tenants + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.TenantProfile' + type: array + summary: Get following + tags: + - UserCenter + /t/{tenantCode}/v1/me/library: + get: + consumes: + - application/json + description: Get purchased content + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.ContentItem' + type: array + summary: Get library + tags: + - UserCenter + /t/{tenantCode}/v1/me/likes: + get: + consumes: + - application/json + description: Get liked contents + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.ContentItem' + type: array + summary: Get likes + tags: + - UserCenter + post: + consumes: + - application/json + description: Like content parameters: - - description: Tenant Code - in: path - name: tenantCode + - description: Content ID + format: int64 + in: query + name: contentId required: true - type: string - - description: Keyword filters by title keyword (LIKE). - in: query - name: keyword - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. + produces: + - application/json + responses: + "200": + description: Liked + schema: + type: string + summary: Like content + tags: + - UserCenter + /t/{tenantCode}/v1/me/likes/{contentId}: + delete: + consumes: + - application/json + description: Unlike content + parameters: + - description: Content ID + format: int64 + in: path + name: contentId + required: true + type: integer + produces: + - application/json + responses: + "200": + description: Unliked + schema: + type: string + summary: Unlike content + tags: + - UserCenter + /t/{tenantCode}/v1/me/notifications: + get: + consumes: + - application/json + description: Get notifications + parameters: + - description: Type enum(all, system, order, audit, interaction) + in: query + name: type + type: string + - description: Page number in: query name: page type: integer @@ -4313,25 +2941,22 @@ paths: - $ref: '#/definitions/requests.Pager' - properties: items: - $ref: '#/definitions/dto.ContentItem' + items: + $ref: '#/definitions/dto.Notification' + type: array type: object - summary: 公开内容列表(已发布 + public) + summary: Get notifications tags: - - TenantPublic - /t/{tenantCode}/v1/public/contents/{contentID}: - get: + - UserCenter + /t/{tenantCode}/v1/me/notifications/{id}/read: + post: consumes: - application/json parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID + - description: Notification ID format: int64 in: path - name: contentID + name: id required: true type: integer produces: @@ -4340,246 +2965,550 @@ paths: "200": description: OK schema: - $ref: '#/definitions/dto.ContentDetail' - summary: 公开内容详情(已发布 + public) + type: string + summary: Mark as read tags: - - TenantPublic - /t/{tenantCode}/v1/public/contents/{contentID}/assets: - get: + - UserCenter + /t/{tenantCode}/v1/me/notifications/read-all: + post: consumes: - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID - format: int64 - in: path - name: contentID - required: true - type: integer produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/dto.ContentAssetsResponse' - summary: 获取公开正片资源(main role;免费/作者/已购) + type: string + summary: Mark all as read tags: - - TenantPublic - /t/{tenantCode}/v1/public/contents/{contentID}/preview: + - UserCenter + /t/{tenantCode}/v1/me/orders: get: consumes: - application/json + description: List user orders parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true + - description: Status enum(all, unpaid, completed, refund) + in: query + name: status type: string - - description: ContentID - format: int64 - in: path - name: contentID - required: true - type: integer produces: - application/json responses: "200": description: OK - schema: - $ref: '#/definitions/dto.ContentAssetsResponse' - summary: 获取公开试看资源(preview role) - tags: - - TenantPublic - /v1/auth/login: - post: - consumes: - - application/json - parameters: - - description: form - in: body - name: form - required: true - schema: - $ref: '#/definitions/quyun_v2_app_http_web_dto.LoginForm' - produces: - - application/json - responses: - "200": - description: 成功 - schema: - $ref: '#/definitions/quyun_v2_app_http_web_dto.LoginResponse' - summary: 用户登录 - tags: - - Web - /v1/auth/password/reset: - post: - consumes: - - application/json - parameters: - - description: form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.PasswordResetForm' - produces: - - application/json - responses: - "200": - description: 成功 - schema: - $ref: '#/definitions/dto.PasswordResetResponse' - summary: 找回密码-重置密码 - tags: - - Web - /v1/auth/password/reset/sms: - post: - consumes: - - application/json - parameters: - - description: form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.PasswordResetSendSMSForm' - produces: - - application/json - responses: - "200": - description: 成功 - schema: - $ref: '#/definitions/dto.PasswordResetSendSMSResponse' - summary: 找回密码-发送短信验证码 - tags: - - Web - /v1/auth/password/reset/verify: - post: - consumes: - - application/json - parameters: - - description: form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.PasswordResetVerifyForm' - produces: - - application/json - responses: - "200": - description: 成功 - schema: - $ref: '#/definitions/dto.PasswordResetVerifyResponse' - summary: 找回密码-校验验证码 - tags: - - Web - /v1/auth/register: - post: - consumes: - - application/json - parameters: - - description: form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.RegisterForm' - produces: - - application/json - responses: - "200": - description: 成功 - schema: - $ref: '#/definitions/quyun_v2_app_http_web_dto.LoginResponse' - summary: 用户注册 - tags: - - Web - /v1/auth/token: - get: - consumes: - - application/json - produces: - - application/json - responses: - "200": - description: 成功 - schema: - $ref: '#/definitions/quyun_v2_app_http_web_dto.LoginResponse' - summary: 刷新 Token - tags: - - Web - /v1/me: - get: - consumes: - - application/json - produces: - - application/json - responses: - "200": - description: 成功 - schema: - $ref: '#/definitions/quyun_v2_app_http_web_dto.MeResponse' - summary: 当前用户信息 - tags: - - Web - /v1/me/tenants: - get: - consumes: - - application/json - produces: - - application/json - responses: - "200": - description: 成功 schema: items: - $ref: '#/definitions/dto.MyTenantItem' + $ref: '#/definitions/dto.Order' type: array - summary: 我的租户列表 + summary: List orders tags: - - Web - /v1/tenant/application: + - UserCenter + /t/{tenantCode}/v1/me/orders/{id}: get: consumes: - application/json + description: Get user order detail + parameters: + - description: Order ID + format: int64 + in: path + name: id + required: true + type: integer produces: - application/json responses: "200": - description: 成功 + description: OK schema: - $ref: '#/definitions/dto.TenantApplicationResponse' - summary: 获取租户申请信息(申请创作者) + $ref: '#/definitions/dto.Order' + summary: Get order detail tags: - - Web - /v1/tenant/apply: + - UserCenter + /t/{tenantCode}/v1/me/realname: post: consumes: - application/json + description: Submit real-name authentication parameters: - - description: form + - description: Realname form in: body name: form required: true schema: - $ref: '#/definitions/dto.TenantApplyForm' + $ref: '#/definitions/dto.RealNameForm' produces: - application/json responses: "200": - description: 成功 + description: Submitted schema: - $ref: '#/definitions/dto.TenantApplicationResponse' - summary: 提交租户申请(申请创作者) + type: string + summary: Realname auth tags: - - Web + - UserCenter + /t/{tenantCode}/v1/me/wallet: + get: + consumes: + - application/json + description: Get wallet balance and transactions + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.WalletResponse' + summary: Get wallet + tags: + - UserCenter + /t/{tenantCode}/v1/me/wallet/recharge: + post: + consumes: + - application/json + description: Recharge wallet + parameters: + - description: Recharge form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.RechargeForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.RechargeResponse' + summary: Recharge wallet + tags: + - UserCenter + /t/{tenantCode}/v1/media-assets/{id}: + delete: + consumes: + - application/json + description: Delete media asset + parameters: + - description: Asset ID + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + summary: Delete media asset + tags: + - Common + /t/{tenantCode}/v1/orders: + post: + consumes: + - application/json + description: Create Order + parameters: + - description: Create form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.OrderCreateForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.OrderCreateResponse' + summary: Create Order + tags: + - Transaction + /t/{tenantCode}/v1/orders/{id}/pay: + post: + consumes: + - application/json + description: Pay for order + parameters: + - description: Order ID + format: int64 + in: path + name: id + required: true + type: integer + - description: Pay form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.OrderPayForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.OrderPayResponse' + summary: Pay for order + tags: + - Transaction + /t/{tenantCode}/v1/orders/{id}/status: + get: + consumes: + - application/json + description: Check order payment status + parameters: + - description: Order ID + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.OrderStatusResponse' + summary: Check order status + tags: + - Transaction + /t/{tenantCode}/v1/storage/{any}: + get: + consumes: + - application/json + parameters: + - description: any path + in: path + name: any + type: string + - description: Expiry + in: query + name: expires + required: true + type: string + - description: Signature + in: query + name: sign + required: true + type: string + produces: + - application/octet-stream + responses: + "200": + description: OK + schema: + type: file + summary: Download file + tags: + - Storage + put: + consumes: + - application/octet-stream + parameters: + - description: any path + in: path + name: any + type: string + - description: Expiry + in: query + name: expires + required: true + type: string + - description: Signature + in: query + name: sign + required: true + type: string + produces: + - application/json + responses: + "200": + description: success + schema: + type: string + summary: Upload file + tags: + - Storage + /t/{tenantCode}/v1/tenants: + get: + consumes: + - application/json + description: Search tenants + parameters: + - description: Keyword + in: query + name: keyword + type: string + - description: Page + in: query + name: page + type: integer + - description: Limit + in: query + name: limit + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/requests.Pager' + summary: List tenants + tags: + - TenantPublic + /t/{tenantCode}/v1/tenants/{id}: + get: + consumes: + - application/json + description: Get tenant public profile + parameters: + - description: Tenant ID + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.TenantProfile' + summary: Get tenant profile + tags: + - TenantPublic + /t/{tenantCode}/v1/tenants/{id}/follow: + delete: + consumes: + - application/json + description: Unfollow a tenant + parameters: + - description: Tenant ID + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: Unfollowed + schema: + type: string + summary: Unfollow tenant + tags: + - TenantPublic + post: + consumes: + - application/json + description: Follow a tenant + parameters: + - description: Tenant ID + format: int64 + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: Followed + schema: + type: string + summary: Follow tenant + tags: + - TenantPublic + /t/{tenantCode}/v1/topics: + get: + consumes: + - application/json + description: List curated topics + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.Topic' + type: array + summary: List topics + tags: + - Content + /t/{tenantCode}/v1/upload: + post: + consumes: + - multipart/form-data + description: Upload file + parameters: + - description: File + in: formData + name: file + required: true + type: file + - description: Type 上传资源类型(如 cover/media/avatar)。 + in: formData + name: type + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.UploadResult' + summary: Upload file + tags: + - Common + /t/{tenantCode}/v1/upload/{uploadId}: + delete: + consumes: + - application/json + description: Abort multipart upload + parameters: + - description: Upload ID + in: path + name: uploadId + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + summary: Abort upload + tags: + - Common + /t/{tenantCode}/v1/upload/check: + get: + consumes: + - application/json + description: Check if file hash exists + parameters: + - description: File MD5 Hash + in: query + name: hash + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.UploadResult' + summary: Check hash + tags: + - Common + /t/{tenantCode}/v1/upload/complete: + post: + consumes: + - application/json + description: Complete multipart upload + parameters: + - description: Complete form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.UploadCompleteForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.UploadResult' + summary: Complete upload + tags: + - Common + /t/{tenantCode}/v1/upload/init: + post: + consumes: + - application/json + description: Initialize multipart upload + parameters: + - description: Init form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.UploadInitForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.UploadInitResponse' + summary: Init multipart upload + tags: + - Common + /t/{tenantCode}/v1/upload/part: + post: + consumes: + - multipart/form-data + description: Upload a part + parameters: + - description: Part File + in: formData + name: file + required: true + type: file + - description: PartNumber 分片序号(从 1 开始)。 + in: formData + name: part_number + type: integer + - description: UploadID 分片上传ID。 + in: formData + name: upload_id + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + summary: Upload part + tags: + - Common + /t/{tenantCode}/v1/webhook/payment/notify: + post: + consumes: + - application/json + description: Payment Webhook + parameters: + - description: Webhook Data + in: body + name: form + required: true + schema: + $ref: '#/definitions/v1.WebhookForm' + produces: + - application/json + responses: + "200": + description: success + schema: + type: string + summary: Payment Webhook + tags: + - Transaction securityDefinitions: BasicAuth: type: basic