feat: tenant content publish

This commit is contained in:
2025-12-25 14:29:16 +08:00
parent a66c0d9b90
commit 6542c71ec0
15 changed files with 1082 additions and 4 deletions

View File

@@ -524,6 +524,84 @@ definitions:
description: PriceAmount is the base price in cents (CNY 分).
type: integer
type: object
dto.ContentPublishForm:
properties:
audio_asset_ids:
description: AudioAssetIDs 音频资源 ID 列表:可为空;每个资源必须为 audio/main/ready。
items:
type: integer
type: array
cover_asset_ids:
description: CoverAssetIDs 展示图(封面图)资源 ID 列表1-3 张;每个资源必须为 image/main/ready。
items:
type: integer
type: array
currency:
allOf:
- $ref: '#/definitions/consts.Currency'
description: Currency 币种:当前固定为 CNY可不传后端默认 CNY
detail:
description: Detail 详细:用于详情页的长文本;可选;当非空时视为“文字内容”类型存在。
type: string
image_asset_ids:
description: ImageAssetIDs 多图内容资源 ID 列表:可为空;每个资源必须为 image/main/ready数量 >=
2 时视为“多图内容”类型存在。
items:
type: integer
type: array
preview_seconds:
description: PreviewSeconds 试看秒数:仅对 preview 资源生效;默认 60必须为正整数。
type: integer
price_amount:
description: PriceAmount 价格单位为分0 表示免费;必填(前端可默认填 0
type: integer
summary:
description: Summary 简介:用于列表/卡片展示的短文本;可选,建议 <= 256 字符。
type: string
tags:
description: Tags 标签:用于分类/检索;字符串数组;会做 trim/去重;可为空。
items:
type: string
type: array
title:
description: Title 标题:用于列表展示与搜索;必填。
type: string
video_asset_ids:
description: VideoAssetIDs 视频资源 ID 列表:可为空;每个资源必须为 video/main/ready。
items:
type: integer
type: array
visibility:
allOf:
- $ref: '#/definitions/consts.ContentVisibility'
description: Visibility 可见性:控制“详情页”可见范围;默认 tenant_only。
type: object
dto.ContentPublishResponse:
properties:
content:
allOf:
- $ref: '#/definitions/models.Content'
description: Content 内容主体(包含标题/简介/详细/状态等)。
content_types:
description: ContentTypes 内容类型列表text/audio/video/image/multi_image用于前端展示
items:
type: string
type: array
cover_assets:
description: CoverAssets 封面图绑定结果role=cover
items:
$ref: '#/definitions/models.ContentAsset'
type: array
main_assets:
description: MainAssets 主资源绑定结果role=main可能包含音频/视频/图片)。
items:
$ref: '#/definitions/models.ContentAsset'
type: array
price:
allOf:
- $ref: '#/definitions/models.ContentPrice'
description: Price 定价信息(单位分)。
type: object
dto.ContentUpdateForm:
properties:
description:
@@ -1139,6 +1217,14 @@ definitions:
allOf:
- $ref: '#/definitions/consts.ContentStatus'
description: 状态draft/reviewing/published/unpublished/blockedpublished 才对外展示
summary:
description: 简介:用于列表/卡片展示的短文本;建议 <= 256 字符(由业务校验)
type: string
tags:
description: 标签JSON 数组(字符串列表);用于分类/检索与聚合展示
items:
type: integer
type: array
tenant_id:
description: 租户ID多租户隔离关键字段所有查询/写入必须限定 tenant_id
type: integer
@@ -2876,6 +2962,32 @@ paths:
summary: 设置内容价格与折扣
tags:
- Tenant
/t/{tenantCode}/v1/admin/contents/publish:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.ContentPublishForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.ContentPublishResponse'
summary: 内容发布(创建+绑定资源+定价)
tags:
- Tenant
/t/{tenantCode}/v1/admin/invites:
get:
consumes: