feat: add creator member management

This commit is contained in:
2026-01-17 20:42:43 +08:00
parent 984a404b5f
commit 7fca7a40e7
14 changed files with 2915 additions and 81 deletions

View File

@@ -138,6 +138,26 @@ definitions:
- RoleUser
- RoleSuperAdmin
- RoleCreator
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
@@ -2929,6 +2949,40 @@ definitions:
description: UsedCount 已使用次数。
type: integer
type: object
dto.TenantInviteListItem:
properties:
code:
description: Code 邀请码。
type: string
created_at:
description: CreatedAt 创建时间RFC3339
type: string
creator:
allOf:
- $ref: '#/definitions/dto.TenantMemberUserLite'
description: Creator 创建者信息(可选)。
expires_at:
description: ExpiresAt 过期时间RFC3339空字符串表示不限制
type: string
id:
description: ID 邀请记录ID。
type: integer
max_uses:
description: MaxUses 最大可使用次数。
type: integer
remark:
description: Remark 备注说明。
type: string
status:
description: Status 邀请状态active/disabled/expired
type: string
status_description:
description: StatusDescription 状态描述。
type: string
used_count:
description: UsedCount 已使用次数。
type: integer
type: object
dto.TenantItem:
properties:
admin_users:
@@ -2994,6 +3048,40 @@ definitions:
description: Reason 申请加入原因(可选,空值会使用默认文案)。
type: string
type: object
dto.TenantJoinRequestItem:
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
updated_at:
description: UpdatedAt 更新时间RFC3339
type: string
user:
allOf:
- $ref: '#/definitions/dto.TenantMemberUserLite'
description: User 申请用户信息。
type: object
dto.TenantJoinReviewForm:
properties:
action:
@@ -3003,6 +3091,60 @@ definitions:
description: Reason 审核说明(可选,用于展示驳回原因或备注)。
type: string
type: object
dto.TenantMemberItem:
properties:
created_at:
description: CreatedAt 加入时间RFC3339
type: string
id:
description: ID 成员关系记录ID。
type: integer
role:
description: Role 成员角色列表。
items:
$ref: '#/definitions/consts.TenantUserRole'
type: array
role_description:
description: RoleDescription 角色描述列表。
items:
type: string
type: array
status:
allOf:
- $ref: '#/definitions/consts.UserStatus'
description: Status 成员状态。
status_description:
description: StatusDescription 成员状态描述。
type: string
tenant_id:
description: TenantID 租户ID。
type: integer
updated_at:
description: UpdatedAt 更新时间RFC3339
type: string
user:
allOf:
- $ref: '#/definitions/dto.TenantMemberUserLite'
description: User 成员用户信息。
type: object
dto.TenantMemberUserLite:
properties:
avatar:
description: Avatar 头像URL。
type: string
id:
description: ID 用户ID。
type: integer
nickname:
description: Nickname 昵称。
type: string
phone:
description: Phone 手机号。
type: string
username:
description: Username 用户名。
type: string
type: object
dto.TenantOwnerUserLite:
properties:
id:
@@ -6503,6 +6645,90 @@ paths:
summary: Dashboard stats
tags:
- CreatorCenter
/t/{tenantCode}/v1/creator/members:
get:
consumes:
- application/json
description: List tenant members with filters
parameters:
- description: 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).
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 成员状态筛选active/verified/banned 等)。
enum:
- active
- inactive
- pending_verify
- verified
- banned
in: query
name: status
type: string
x-enum-varnames:
- UserStatusActive
- UserStatusInactive
- UserStatusPendingVerify
- UserStatusVerified
- UserStatusBanned
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
items:
$ref: '#/definitions/dto.TenantMemberItem'
type: array
type: object
summary: List tenant members
tags:
- CreatorCenter
/t/{tenantCode}/v1/creator/members/{id}:
delete:
consumes:
- application/json
description: Remove a tenant member by relation ID
parameters:
- description: Member ID
format: int64
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Removed
schema:
type: string
summary: Remove tenant member
tags:
- CreatorCenter
/t/{tenantCode}/v1/creator/members/{id}/review:
post:
consumes:
@@ -6553,6 +6779,120 @@ paths:
summary: Create member invite
tags:
- CreatorCenter
/t/{tenantCode}/v1/creator/members/invites:
get:
consumes:
- application/json
description: List member invites with filters
parameters:
- 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 邀请状态筛选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:
items:
$ref: '#/definitions/dto.TenantInviteListItem'
type: array
type: object
summary: List member invites
tags:
- CreatorCenter
/t/{tenantCode}/v1/creator/members/invites/{id}:
delete:
consumes:
- application/json
description: Disable a member invite by ID
parameters:
- description: Invite ID
format: int64
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Disabled
schema:
type: string
summary: Disable member invite
tags:
- CreatorCenter
/t/{tenantCode}/v1/creator/members/join-requests:
get:
consumes:
- application/json
description: List tenant join requests
parameters:
- description: 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).
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
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
items:
$ref: '#/definitions/dto.TenantJoinRequestItem'
type: array
type: object
summary: List member join requests
tags:
- CreatorCenter
/t/{tenantCode}/v1/creator/orders:
get:
consumes: