feat: add tenant admin invite management, ledger overview, order details, and order management features

- Implemented Invite management with creation, searching, and disabling functionalities.
- Added Ledger overview for financial transactions with filtering options.
- Developed Order Detail view for individual order insights and refund capabilities.
- Created Orders management page with search, reset, and pagination features.
- Enhanced user experience with toast notifications for actions and error handling.
This commit is contained in:
2025-12-24 19:41:44 +08:00
parent 1d0b38bbb7
commit 87f569cc6a
27 changed files with 3652 additions and 151 deletions

View File

@@ -42,7 +42,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.LoginForm"
"$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginForm"
}
}
],
@@ -50,7 +50,7 @@ const docTemplate = `{
"200": {
"description": "成功",
"schema": {
"$ref": "#/definitions/dto.LoginResponse"
"$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginResponse"
}
}
}
@@ -71,7 +71,7 @@ const docTemplate = `{
"200": {
"description": "成功",
"schema": {
"$ref": "#/definitions/dto.LoginResponse"
"$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginResponse"
}
}
}
@@ -1429,6 +1429,140 @@ const docTemplate = `{
}
},
"/t/{tenantCode}/v1/admin/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",
"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.",
"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": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/requests.Pager"
},
{
"type": "object",
"properties": {
"items": {
"$ref": "#/definitions/dto.AdminContentItem"
}
}
}
]
}
}
}
},
"post": {
"consumes": [
"application/json"
@@ -3295,7 +3429,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.MeResponse"
"$ref": "#/definitions/quyun_v2_app_http_tenant_dto.MeResponse"
}
}
}
@@ -3717,6 +3851,108 @@ const docTemplate = `{
}
}
}
},
"/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/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"
}
}
}
}
}
}
},
"definitions": {
@@ -3958,6 +4194,46 @@ const docTemplate = `{
"UserStatusBanned"
]
},
"dto.AdminContentItem": {
"type": "object",
"properties": {
"content": {
"$ref": "#/definitions/models.Content"
},
"owner": {
"$ref": "#/definitions/dto.AdminContentOwnerLite"
},
"price": {
"$ref": "#/definitions/models.ContentPrice"
},
"status_description": {
"type": "string"
},
"visibility_description": {
"type": "string"
}
}
},
"dto.AdminContentOwnerLite": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"roles": {
"type": "array",
"items": {
"$ref": "#/definitions/consts.Role"
}
},
"status": {
"$ref": "#/definitions/consts.UserStatus"
},
"username": {
"type": "string"
}
}
},
"dto.AdminLedgerItem": {
"type": "object",
"properties": {
@@ -4435,25 +4711,6 @@ const docTemplate = `{
}
}
},
"dto.LoginForm": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"dto.LoginResponse": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
},
"dto.MeBalanceResponse": {
"type": "object",
"properties": {
@@ -4479,35 +4736,6 @@ const docTemplate = `{
}
}
},
"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"
}
]
}
}
},
"dto.MyLedgerItem": {
"type": "object",
"properties": {
@@ -4525,6 +4753,58 @@ const docTemplate = `{
}
}
},
"dto.MyTenantItem": {
"type": "object",
"properties": {
"is_owner": {
"description": "IsOwner 是否为租户Ownertenants.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/...)。",
"type": "string"
},
"tenant_id": {
"description": "TenantID 租户ID数值型主键。",
"type": "integer"
},
"tenant_name": {
"description": "TenantName 租户名称。",
"type": "string"
},
"tenant_status": {
"description": "TenantStatus 租户状态pending/verified/expired 等)。",
"allOf": [
{
"$ref": "#/definitions/consts.TenantStatus"
}
]
},
"tenant_status_description": {
"description": "TenantStatusDescription 租户状态描述(便于前端展示)。",
"type": "string"
}
}
},
"dto.OrderBuyerLite": {
"type": "object",
"properties": {
@@ -5899,6 +6179,116 @@ const docTemplate = `{
}
}
},
"quyun_v2_app_http_super_dto.LoginForm": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"quyun_v2_app_http_super_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"
}
]
}
}
},
"quyun_v2_app_http_web_dto.LoginForm": {
"type": "object",
"properties": {
"password": {
"description": "Password 明文密码;后端会与 users.password 的 bcrypt hash 做比对。",
"type": "string"
},
"username": {
"description": "Username 用户名;必须与数据库 users.username 精确匹配。",
"type": "string"
}
}
},
"quyun_v2_app_http_web_dto.LoginResponse": {
"type": "object",
"properties": {
"token": {
"description": "Token JWT 访问令牌;前端应以 ` + "`" + `Authorization: Bearer \u003ctoken\u003e` + "`" + ` 方式携带。",
"type": "string"
}
}
},
"quyun_v2_app_http_web_dto.MeResponse": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt 用户创建时间。",
"type": "string"
},
"id": {
"description": "ID 用户ID全局唯一。",
"type": "integer"
},
"roles": {
"description": "Roles 用户全局角色数组(如 user/super_admin 等)。",
"type": "array",
"items": {
"$ref": "#/definitions/consts.Role"
}
},
"status": {
"description": "Status 用户状态active/verified/banned 等)。",
"allOf": [
{
"$ref": "#/definitions/consts.UserStatus"
}
]
},
"status_description": {
"description": "StatusDescription 用户状态描述(便于前端展示)。",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt 用户更新时间。",
"type": "string"
},
"username": {
"description": "Username 用户名。",
"type": "string"
}
}
},
"requests.KV": {
"type": "object",
"properties": {

View File

@@ -36,7 +36,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.LoginForm"
"$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginForm"
}
}
],
@@ -44,7 +44,7 @@
"200": {
"description": "成功",
"schema": {
"$ref": "#/definitions/dto.LoginResponse"
"$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginResponse"
}
}
}
@@ -65,7 +65,7 @@
"200": {
"description": "成功",
"schema": {
"$ref": "#/definitions/dto.LoginResponse"
"$ref": "#/definitions/quyun_v2_app_http_super_dto.LoginResponse"
}
}
}
@@ -1423,6 +1423,140 @@
}
},
"/t/{tenantCode}/v1/admin/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",
"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.",
"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": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/requests.Pager"
},
{
"type": "object",
"properties": {
"items": {
"$ref": "#/definitions/dto.AdminContentItem"
}
}
}
]
}
}
}
},
"post": {
"consumes": [
"application/json"
@@ -3289,7 +3423,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.MeResponse"
"$ref": "#/definitions/quyun_v2_app_http_tenant_dto.MeResponse"
}
}
}
@@ -3711,6 +3845,108 @@
}
}
}
},
"/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/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"
}
}
}
}
}
}
},
"definitions": {
@@ -3952,6 +4188,46 @@
"UserStatusBanned"
]
},
"dto.AdminContentItem": {
"type": "object",
"properties": {
"content": {
"$ref": "#/definitions/models.Content"
},
"owner": {
"$ref": "#/definitions/dto.AdminContentOwnerLite"
},
"price": {
"$ref": "#/definitions/models.ContentPrice"
},
"status_description": {
"type": "string"
},
"visibility_description": {
"type": "string"
}
}
},
"dto.AdminContentOwnerLite": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"roles": {
"type": "array",
"items": {
"$ref": "#/definitions/consts.Role"
}
},
"status": {
"$ref": "#/definitions/consts.UserStatus"
},
"username": {
"type": "string"
}
}
},
"dto.AdminLedgerItem": {
"type": "object",
"properties": {
@@ -4429,25 +4705,6 @@
}
}
},
"dto.LoginForm": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"dto.LoginResponse": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
},
"dto.MeBalanceResponse": {
"type": "object",
"properties": {
@@ -4473,35 +4730,6 @@
}
}
},
"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"
}
]
}
}
},
"dto.MyLedgerItem": {
"type": "object",
"properties": {
@@ -4519,6 +4747,58 @@
}
}
},
"dto.MyTenantItem": {
"type": "object",
"properties": {
"is_owner": {
"description": "IsOwner 是否为租户Ownertenants.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/...)。",
"type": "string"
},
"tenant_id": {
"description": "TenantID 租户ID数值型主键。",
"type": "integer"
},
"tenant_name": {
"description": "TenantName 租户名称。",
"type": "string"
},
"tenant_status": {
"description": "TenantStatus 租户状态pending/verified/expired 等)。",
"allOf": [
{
"$ref": "#/definitions/consts.TenantStatus"
}
]
},
"tenant_status_description": {
"description": "TenantStatusDescription 租户状态描述(便于前端展示)。",
"type": "string"
}
}
},
"dto.OrderBuyerLite": {
"type": "object",
"properties": {
@@ -5893,6 +6173,116 @@
}
}
},
"quyun_v2_app_http_super_dto.LoginForm": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"quyun_v2_app_http_super_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"
}
]
}
}
},
"quyun_v2_app_http_web_dto.LoginForm": {
"type": "object",
"properties": {
"password": {
"description": "Password 明文密码;后端会与 users.password 的 bcrypt hash 做比对。",
"type": "string"
},
"username": {
"description": "Username 用户名;必须与数据库 users.username 精确匹配。",
"type": "string"
}
}
},
"quyun_v2_app_http_web_dto.LoginResponse": {
"type": "object",
"properties": {
"token": {
"description": "Token JWT 访问令牌;前端应以 `Authorization: Bearer \u003ctoken\u003e` 方式携带。",
"type": "string"
}
}
},
"quyun_v2_app_http_web_dto.MeResponse": {
"type": "object",
"properties": {
"created_at": {
"description": "CreatedAt 用户创建时间。",
"type": "string"
},
"id": {
"description": "ID 用户ID全局唯一。",
"type": "integer"
},
"roles": {
"description": "Roles 用户全局角色数组(如 user/super_admin 等)。",
"type": "array",
"items": {
"$ref": "#/definitions/consts.Role"
}
},
"status": {
"description": "Status 用户状态active/verified/banned 等)。",
"allOf": [
{
"$ref": "#/definitions/consts.UserStatus"
}
]
},
"status_description": {
"description": "StatusDescription 用户状态描述(便于前端展示)。",
"type": "string"
},
"updated_at": {
"description": "UpdatedAt 用户更新时间。",
"type": "string"
},
"username": {
"description": "Username 用户名。",
"type": "string"
}
}
},
"requests.KV": {
"type": "object",
"properties": {

View File

@@ -184,6 +184,32 @@ definitions:
- UserStatusPendingVerify
- UserStatusVerified
- UserStatusBanned
dto.AdminContentItem:
properties:
content:
$ref: '#/definitions/models.Content'
owner:
$ref: '#/definitions/dto.AdminContentOwnerLite'
price:
$ref: '#/definitions/models.ContentPrice'
status_description:
type: string
visibility_description:
type: string
type: object
dto.AdminContentOwnerLite:
properties:
id:
type: integer
roles:
items:
$ref: '#/definitions/consts.Role'
type: array
status:
$ref: '#/definitions/consts.UserStatus'
username:
type: string
type: object
dto.AdminLedgerItem:
properties:
ledger:
@@ -531,18 +557,6 @@ definitions:
description: Reason 申请原因(可选):用于向租户管理员说明申请加入的目的。
type: string
type: object
dto.LoginForm:
properties:
password:
type: string
username:
type: string
type: object
dto.LoginResponse:
properties:
token:
type: string
type: object
dto.MeBalanceResponse:
properties:
balance:
@@ -559,22 +573,6 @@ definitions:
description: UpdatedAt 更新时间:余额变更时更新。
type: string
type: object
dto.MeResponse:
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.
user:
allOf:
- $ref: '#/definitions/models.User'
description: User is the authenticated user derived from JWT `user_id`.
type: object
dto.MyLedgerItem:
properties:
ledger:
@@ -585,6 +583,42 @@ definitions:
description: TypeDescription 流水类型中文说明(用于前端展示)。
type: string
type: object
dto.MyTenantItem:
properties:
is_owner:
description: |-
IsOwner 是否为租户Ownertenants.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/...)。
type: string
tenant_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 租户状态描述(便于前端展示)。
type: string
type: object
dto.OrderBuyerLite:
properties:
id:
@@ -1503,6 +1537,76 @@ definitions:
verified_at:
type: string
type: object
quyun_v2_app_http_super_dto.LoginForm:
properties:
password:
type: string
username:
type: string
type: object
quyun_v2_app_http_super_dto.LoginResponse:
properties:
token:
type: string
type: object
quyun_v2_app_http_tenant_dto.MeResponse:
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.
user:
allOf:
- $ref: '#/definitions/models.User'
description: User is the authenticated user derived from JWT `user_id`.
type: object
quyun_v2_app_http_web_dto.LoginForm:
properties:
password:
description: Password 明文密码;后端会与 users.password 的 bcrypt hash 做比对。
type: string
username:
description: Username 用户名;必须与数据库 users.username 精确匹配。
type: string
type: object
quyun_v2_app_http_web_dto.LoginResponse:
properties:
token:
description: 'Token JWT 访问令牌;前端应以 `Authorization: Bearer <token>` 方式携带。'
type: string
type: object
quyun_v2_app_http_web_dto.MeResponse:
properties:
created_at:
description: CreatedAt 用户创建时间。
type: string
id:
description: ID 用户ID全局唯一
type: integer
roles:
description: Roles 用户全局角色数组(如 user/super_admin 等)。
items:
$ref: '#/definitions/consts.Role'
type: array
status:
allOf:
- $ref: '#/definitions/consts.UserStatus'
description: Status 用户状态active/verified/banned 等)。
status_description:
description: StatusDescription 用户状态描述(便于前端展示)。
type: string
updated_at:
description: UpdatedAt 用户更新时间。
type: string
username:
description: Username 用户名。
type: string
type: object
requests.KV:
properties:
key:
@@ -1558,14 +1662,14 @@ paths:
name: form
required: true
schema:
$ref: '#/definitions/dto.LoginForm'
$ref: '#/definitions/quyun_v2_app_http_super_dto.LoginForm'
produces:
- application/json
responses:
"200":
description: 成功
schema:
$ref: '#/definitions/dto.LoginResponse'
$ref: '#/definitions/quyun_v2_app_http_super_dto.LoginResponse'
tags:
- Super
/super/v1/auth/token:
@@ -1578,7 +1682,7 @@ paths:
"200":
description: 成功
schema:
$ref: '#/definitions/dto.LoginResponse'
$ref: '#/definitions/quyun_v2_app_http_super_dto.LoginResponse'
tags:
- Super
/super/v1/contents:
@@ -2465,6 +2569,95 @@ paths:
tags:
- Super
/t/{tenantCode}/v1/admin/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
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.
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:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
$ref: '#/definitions/dto.AdminContentItem'
type: object
summary: 内容列表(租户管理)
tags:
- Tenant
post:
consumes:
- application/json
@@ -3717,7 +3910,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/dto.MeResponse'
$ref: '#/definitions/quyun_v2_app_http_tenant_dto.MeResponse'
summary: 当前租户上下文信息
tags:
- Tenant
@@ -3994,6 +4187,71 @@ paths:
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/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'
type: array
summary: 我的租户列表
tags:
- Web
securityDefinitions:
BasicAuth:
type: basic