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

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