feat: expand superadmin user detail views

This commit is contained in:
2026-01-15 12:29:52 +08:00
parent 8419ddede7
commit bec984b959
10 changed files with 2874 additions and 12 deletions

View File

@@ -92,6 +92,16 @@ definitions:
x-enum-varnames:
- TenantUserRoleMember
- TenantUserRoleTenantAdmin
consts.UserCouponStatus:
enum:
- unused
- used
- expired
type: string
x-enum-varnames:
- UserCouponStatusUnused
- UserCouponStatusUsed
- UserCouponStatusExpired
consts.UserStatus:
enum:
- active
@@ -1050,6 +1060,12 @@ definitions:
description: Name 租户名称。
type: string
type: object
dto.SuperCouponGrantResponse:
properties:
granted:
description: Granted 实际发放数量。
type: integer
type: object
dto.SuperCouponItem:
properties:
created_at:
@@ -1239,6 +1255,51 @@ definitions:
required:
- status
type: object
dto.SuperTenantJoinRequestItem:
properties:
created_at:
description: CreatedAt 申请时间RFC3339
type: string
decided_at:
description: DecidedAt 审核时间RFC3339
type: string
decided_operator_user_id:
description: DecidedOperatorUserID 审核操作者ID。
type: integer
decided_reason:
description: DecidedReason 审核备注/原因。
type: string
id:
description: ID 申请记录ID。
type: integer
reason:
description: Reason 申请说明。
type: string
status:
description: Status 申请状态。
type: string
status_description:
description: StatusDescription 状态描述(用于展示)。
type: string
tenant_code:
description: TenantCode 租户编码。
type: string
tenant_id:
description: TenantID 租户ID。
type: integer
tenant_name:
description: TenantName 租户名称。
type: string
updated_at:
description: UpdatedAt 更新时间RFC3339
type: string
user_id:
description: UserID 申请用户ID。
type: integer
username:
description: Username 申请用户名称。
type: string
type: object
dto.SuperTenantUserItem:
properties:
tenant_user:
@@ -1250,6 +1311,68 @@ definitions:
- $ref: '#/definitions/dto.SuperUserLite'
description: User 用户信息。
type: object
dto.SuperUserCouponItem:
properties:
coupon_id:
description: CouponID 券模板ID。
type: integer
created_at:
description: CreatedAt 领取时间RFC3339
type: string
description:
description: Description 券描述。
type: string
end_at:
description: EndAt 过期时间RFC3339
type: string
id:
description: ID 用户券ID。
type: integer
max_discount:
description: MaxDiscount 折扣券最高抵扣金额(分)。
type: integer
min_order_amount:
description: MinOrderAmount 使用门槛金额(分)。
type: integer
order_id:
description: OrderID 使用订单ID未使用为0
type: integer
start_at:
description: StartAt 生效时间RFC3339
type: string
status:
allOf:
- $ref: '#/definitions/consts.UserCouponStatus'
description: Status 用户券状态。
status_description:
description: StatusDescription 用户券状态描述(用于展示)。
type: string
tenant_code:
description: TenantCode 券所属租户编码。
type: string
tenant_id:
description: TenantID 券所属租户ID。
type: integer
tenant_name:
description: TenantName 券所属租户名称。
type: string
title:
description: Title 券标题。
type: string
type:
allOf:
- $ref: '#/definitions/consts.CouponType'
description: Type 券类型。
type_description:
description: TypeDescription 券类型描述(用于展示)。
type: string
used_at:
description: UsedAt 使用时间RFC3339
type: string
value:
description: Value 券面值/折扣值。
type: integer
type: object
dto.SuperUserLite:
properties:
created_at:
@@ -1280,6 +1403,51 @@ definitions:
description: VerifiedAt 实名认证时间RFC3339
type: string
type: object
dto.SuperUserNotificationItem:
properties:
content:
description: Content 通知内容。
type: string
created_at:
description: CreatedAt 发送时间RFC3339
type: string
id:
description: ID 通知ID。
type: integer
read:
description: Read 是否已读。
type: boolean
tenant_code:
description: TenantCode 通知所属租户编码。
type: string
tenant_id:
description: TenantID 通知所属租户ID。
type: integer
tenant_name:
description: TenantName 通知所属租户名称。
type: string
title:
description: Title 通知标题。
type: string
type:
description: Type 通知类型。
type: string
type: object
dto.SuperUserRealNameResponse:
properties:
id_card_masked:
description: IDCardMasked 身份证号脱敏展示。
type: string
is_real_name_verified:
description: IsRealNameVerified 是否已实名认证。
type: boolean
real_name:
description: RealName 真实姓名(来自用户元数据)。
type: string
verified_at:
description: VerifiedAt 实名认证时间RFC3339
type: string
type: object
dto.SuperWalletResponse:
properties:
balance:
@@ -2421,6 +2589,65 @@ paths:
summary: Report overview
tags:
- Report
/super/v1/tenant-join-requests:
get:
consumes:
- application/json
description: List tenant join requests across tenants
parameters:
- description: Page number
in: query
name: page
type: integer
- description: Page size
in: query
name: limit
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
items:
$ref: '#/definitions/dto.SuperTenantJoinRequestItem'
type: array
type: object
summary: List tenant join requests
tags:
- Tenant
/super/v1/tenant-join-requests/{id}/review:
post:
consumes:
- application/json
description: Approve or reject a tenant join request
parameters:
- description: Join request ID
format: int64
in: path
name: id
required: true
type: integer
- description: Review form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.TenantJoinReviewForm'
produces:
- application/json
responses:
"200":
description: Reviewed
schema:
type: string
summary: Review tenant join request
tags:
- Tenant
/super/v1/tenants:
get:
consumes:
@@ -2625,6 +2852,157 @@ paths:
summary: Update content status
tags:
- Content
/super/v1/tenants/{tenantID}/coupons:
post:
consumes:
- application/json
description: Create coupon for tenant
parameters:
- description: Tenant ID
format: int64
in: path
name: tenantID
required: true
type: integer
- description: Create form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.CouponCreateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.CouponItem'
summary: Create coupon
tags:
- Coupon
/super/v1/tenants/{tenantID}/coupons/{id}:
get:
consumes:
- application/json
description: Get coupon detail
parameters:
- description: Tenant ID
format: int64
in: path
name: tenantID
required: true
type: integer
- description: Coupon ID
format: int64
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.CouponItem'
summary: Get coupon
tags:
- Coupon
put:
consumes:
- application/json
description: Update coupon for tenant
parameters:
- description: Tenant ID
format: int64
in: path
name: tenantID
required: true
type: integer
- description: Coupon ID
format: int64
in: path
name: id
required: true
type: integer
- description: Update form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.CouponUpdateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.CouponItem'
summary: Update coupon
tags:
- Coupon
/super/v1/tenants/{tenantID}/coupons/{id}/grant:
post:
consumes:
- application/json
description: Grant coupon to users
parameters:
- description: Tenant ID
format: int64
in: path
name: tenantID
required: true
type: integer
- description: Coupon ID
format: int64
in: path
name: id
required: true
type: integer
- description: Grant form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.CouponGrantForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.SuperCouponGrantResponse'
summary: Grant coupon
tags:
- Coupon
/super/v1/tenants/{tenantID}/invites:
post:
consumes:
- application/json
description: Create tenant invite code
parameters:
- description: Tenant ID
format: int64
in: path
name: tenantID
required: true
type: integer
- description: Invite form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.TenantInviteCreateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.TenantInviteItem'
summary: Create tenant invite
tags:
- Tenant
/super/v1/tenants/{tenantID}/users:
get:
consumes:
@@ -2767,6 +3145,102 @@ paths:
summary: Get user
tags:
- User
/super/v1/users/{id}/coupons:
get:
consumes:
- application/json
description: List coupons of a user
parameters:
- description: User ID
format: int64
in: path
name: id
required: true
type: integer
- description: Page number
in: query
name: page
type: integer
- description: Page size
in: query
name: limit
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
items:
$ref: '#/definitions/dto.SuperUserCouponItem'
type: array
type: object
summary: List user coupons
tags:
- User
/super/v1/users/{id}/notifications:
get:
consumes:
- application/json
description: List notifications of a user
parameters:
- description: User ID
format: int64
in: path
name: id
required: true
type: integer
- description: Page number
in: query
name: page
type: integer
- description: Page size
in: query
name: limit
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
items:
$ref: '#/definitions/dto.SuperUserNotificationItem'
type: array
type: object
summary: List user notifications
tags:
- User
/super/v1/users/{id}/realname:
get:
consumes:
- application/json
description: Get real-name verification detail of a user
parameters:
- description: User ID
format: int64
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.SuperUserRealNameResponse'
summary: Get user real-name verification detail
tags:
- User
/super/v1/users/{id}/roles:
patch:
consumes: