feat: add superadmin assets and notifications
This commit is contained in:
@@ -38,6 +38,50 @@ definitions:
|
||||
- GenderMale
|
||||
- GenderFemale
|
||||
- GenderSecret
|
||||
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
|
||||
consts.NotificationType:
|
||||
enum:
|
||||
- system
|
||||
- order
|
||||
- audit
|
||||
- interaction
|
||||
type: string
|
||||
x-enum-varnames:
|
||||
- NotificationTypeSystem
|
||||
- NotificationTypeOrder
|
||||
- NotificationTypeAudit
|
||||
- NotificationTypeInteraction
|
||||
consts.OrderStatus:
|
||||
enum:
|
||||
- created
|
||||
@@ -1013,6 +1057,99 @@ definitions:
|
||||
description: Likes 累计点赞数。
|
||||
type: integer
|
||||
type: object
|
||||
dto.SuperAssetItem:
|
||||
properties:
|
||||
bucket:
|
||||
description: Bucket 存储桶名称。
|
||||
type: string
|
||||
created_at:
|
||||
description: CreatedAt 创建时间(RFC3339)。
|
||||
type: string
|
||||
filename:
|
||||
description: Filename 原始文件名。
|
||||
type: string
|
||||
hash:
|
||||
description: Hash 文件哈希(MD5)。
|
||||
type: string
|
||||
id:
|
||||
description: ID 资产ID。
|
||||
type: integer
|
||||
object_key:
|
||||
description: ObjectKey 对象Key。
|
||||
type: string
|
||||
provider:
|
||||
description: Provider 存储提供方。
|
||||
type: string
|
||||
size:
|
||||
description: Size 文件大小(字节)。
|
||||
type: integer
|
||||
source_asset_id:
|
||||
description: SourceAssetID 源资产ID(用于变体关联)。
|
||||
type: integer
|
||||
status:
|
||||
allOf:
|
||||
- $ref: '#/definitions/consts.MediaAssetStatus'
|
||||
description: Status 处理状态。
|
||||
tenant_code:
|
||||
description: TenantCode 租户编码。
|
||||
type: string
|
||||
tenant_id:
|
||||
description: TenantID 租户ID。
|
||||
type: integer
|
||||
tenant_name:
|
||||
description: TenantName 租户名称。
|
||||
type: string
|
||||
type:
|
||||
allOf:
|
||||
- $ref: '#/definitions/consts.MediaAssetType'
|
||||
description: Type 媒体类型。
|
||||
updated_at:
|
||||
description: UpdatedAt 更新时间(RFC3339)。
|
||||
type: string
|
||||
url:
|
||||
description: URL 访问URL(若可用)。
|
||||
type: string
|
||||
used_count:
|
||||
description: UsedCount 被内容引用次数。
|
||||
type: integer
|
||||
user_id:
|
||||
description: UserID 上传用户ID。
|
||||
type: integer
|
||||
username:
|
||||
description: Username 上传用户名/昵称。
|
||||
type: string
|
||||
variant:
|
||||
allOf:
|
||||
- $ref: '#/definitions/consts.MediaAssetVariant'
|
||||
description: Variant 媒体变体(main/preview/cover 等)。
|
||||
type: object
|
||||
dto.SuperAssetUsageItem:
|
||||
properties:
|
||||
count:
|
||||
description: Count 该类型资产数量。
|
||||
type: integer
|
||||
total_size:
|
||||
description: TotalSize 该类型资产大小总和(字节)。
|
||||
type: integer
|
||||
type:
|
||||
allOf:
|
||||
- $ref: '#/definitions/consts.MediaAssetType'
|
||||
description: Type 媒体类型。
|
||||
type: object
|
||||
dto.SuperAssetUsageResponse:
|
||||
properties:
|
||||
by_type:
|
||||
description: ByType 按媒体类型汇总的用量统计。
|
||||
items:
|
||||
$ref: '#/definitions/dto.SuperAssetUsageItem'
|
||||
type: array
|
||||
total_count:
|
||||
description: TotalCount 资产总量。
|
||||
type: integer
|
||||
total_size:
|
||||
description: TotalSize 资产总大小(字节)。
|
||||
type: integer
|
||||
type: object
|
||||
dto.SuperContentBatchReviewForm:
|
||||
properties:
|
||||
action:
|
||||
@@ -1214,6 +1351,123 @@ definitions:
|
||||
required:
|
||||
- action
|
||||
type: object
|
||||
dto.SuperNotificationBroadcastForm:
|
||||
properties:
|
||||
content:
|
||||
description: Content 通知内容。
|
||||
type: string
|
||||
tenant_id:
|
||||
description: TenantID 租户ID(选填,用于指定租户成员)。
|
||||
type: integer
|
||||
title:
|
||||
description: Title 通知标题。
|
||||
type: string
|
||||
type:
|
||||
allOf:
|
||||
- $ref: '#/definitions/consts.NotificationType'
|
||||
description: Type 通知类型(system/order/audit/interaction)。
|
||||
user_ids:
|
||||
description: UserIDs 指定接收用户ID列表(优先级高于 TenantID)。
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
type: object
|
||||
dto.SuperNotificationItem:
|
||||
properties:
|
||||
content:
|
||||
description: Content 通知内容。
|
||||
type: string
|
||||
created_at:
|
||||
description: CreatedAt 创建时间(RFC3339)。
|
||||
type: string
|
||||
id:
|
||||
description: ID 通知ID。
|
||||
type: integer
|
||||
is_read:
|
||||
description: IsRead 是否已读。
|
||||
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:
|
||||
allOf:
|
||||
- $ref: '#/definitions/consts.NotificationType'
|
||||
description: Type 通知类型。
|
||||
user_id:
|
||||
description: UserID 用户ID。
|
||||
type: integer
|
||||
username:
|
||||
description: Username 用户名/昵称。
|
||||
type: string
|
||||
type: object
|
||||
dto.SuperNotificationTemplateCreateForm:
|
||||
properties:
|
||||
content:
|
||||
description: Content 通知内容。
|
||||
type: string
|
||||
is_active:
|
||||
description: IsActive 是否启用(不传默认启用)。
|
||||
type: boolean
|
||||
name:
|
||||
description: Name 模板名称(用于识别用途)。
|
||||
type: string
|
||||
tenant_id:
|
||||
description: TenantID 租户ID(不传代表全平台模板)。
|
||||
type: integer
|
||||
title:
|
||||
description: Title 通知标题。
|
||||
type: string
|
||||
type:
|
||||
allOf:
|
||||
- $ref: '#/definitions/consts.NotificationType'
|
||||
description: Type 通知类型(system/order/audit/interaction)。
|
||||
type: object
|
||||
dto.SuperNotificationTemplateItem:
|
||||
properties:
|
||||
content:
|
||||
description: Content 模板内容。
|
||||
type: string
|
||||
created_at:
|
||||
description: CreatedAt 创建时间(RFC3339)。
|
||||
type: string
|
||||
id:
|
||||
description: ID 模板ID。
|
||||
type: integer
|
||||
is_active:
|
||||
description: IsActive 是否启用。
|
||||
type: boolean
|
||||
name:
|
||||
description: Name 模板名称。
|
||||
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.NotificationType'
|
||||
description: Type 通知类型。
|
||||
updated_at:
|
||||
description: UpdatedAt 更新时间(RFC3339)。
|
||||
type: string
|
||||
type: object
|
||||
dto.SuperOrderDetail:
|
||||
properties:
|
||||
buyer:
|
||||
@@ -2402,6 +2656,78 @@ info:
|
||||
title: ApiDoc
|
||||
version: "1.0"
|
||||
paths:
|
||||
/super/v1/assets:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: List assets 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.SuperAssetItem'
|
||||
type: array
|
||||
type: object
|
||||
summary: List assets
|
||||
tags:
|
||||
- Asset
|
||||
/super/v1/assets/{id}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Delete asset
|
||||
parameters:
|
||||
- description: Asset ID
|
||||
format: int64
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: Force delete
|
||||
in: query
|
||||
name: force
|
||||
type: boolean
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Deleted
|
||||
schema:
|
||||
type: string
|
||||
summary: Delete asset
|
||||
tags:
|
||||
- Asset
|
||||
/super/v1/assets/usage:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Asset usage statistics
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/dto.SuperAssetUsageResponse'
|
||||
summary: Asset usage
|
||||
tags:
|
||||
- Asset
|
||||
/super/v1/auth/login:
|
||||
post:
|
||||
consumes:
|
||||
@@ -2715,6 +3041,102 @@ paths:
|
||||
summary: List creators
|
||||
tags:
|
||||
- Creator
|
||||
/super/v1/notifications:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: List notifications 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.SuperNotificationItem'
|
||||
type: array
|
||||
type: object
|
||||
summary: List notifications
|
||||
tags:
|
||||
- Notification
|
||||
/super/v1/notifications/broadcast:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Broadcast notification to users or tenant members
|
||||
parameters:
|
||||
- description: Broadcast form
|
||||
in: body
|
||||
name: form
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.SuperNotificationBroadcastForm'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Sent
|
||||
schema:
|
||||
type: string
|
||||
summary: Broadcast notification
|
||||
tags:
|
||||
- Notification
|
||||
/super/v1/notifications/templates:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: List notification templates
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/definitions/requests.Pager'
|
||||
- properties:
|
||||
items:
|
||||
items:
|
||||
$ref: '#/definitions/dto.SuperNotificationTemplateItem'
|
||||
type: array
|
||||
type: object
|
||||
summary: List notification templates
|
||||
tags:
|
||||
- Notification
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Create notification template
|
||||
parameters:
|
||||
- description: Template form
|
||||
in: body
|
||||
name: form
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.SuperNotificationTemplateCreateForm'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/dto.SuperNotificationTemplateItem'
|
||||
summary: Create notification template
|
||||
tags:
|
||||
- Notification
|
||||
/super/v1/orders:
|
||||
get:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user