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

@@ -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