feat: 添加媒体播放功能,支持基于短时效token的播放入口及相关API接口

This commit is contained in:
2025-12-22 17:44:25 +08:00
parent 70bba28492
commit 335a546aab
18 changed files with 639 additions and 38 deletions

View File

@@ -2340,6 +2340,37 @@ const docTemplate = `{
}
}
},
"/t/{tenantCode}/v1/media/play": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"TenantMedia"
],
"summary": "媒体播放入口(短时效 token",
"parameters": [
{
"type": "string",
"description": "Tenant Code",
"name": "tenantCode",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Play token",
"name": "token",
"in": "query",
"required": true
}
],
"responses": {}
}
},
"/t/{tenantCode}/v1/orders": {
"get": {
"consumes": [
@@ -3235,10 +3266,10 @@ const docTemplate = `{
"type": "object",
"properties": {
"assets": {
"description": "Assets is the list of media assets for the requested role (preview/main).",
"description": "Assets is the list of playable assets for the requested role (preview/main).",
"type": "array",
"items": {
"$ref": "#/definitions/models.MediaAsset"
"$ref": "#/definitions/dto.ContentPlayableAsset"
}
},
"content": {
@@ -3330,6 +3361,32 @@ const docTemplate = `{
}
}
},
"dto.ContentPlayableAsset": {
"type": "object",
"properties": {
"asset_id": {
"type": "integer"
},
"expires_at": {
"description": "ExpiresAt indicates when PlayURL/token expires; optional.",
"type": "string"
},
"meta": {
"description": "Meta is a display-safe whitelist (currently passthrough JSON); optional.",
"type": "array",
"items": {
"type": "integer"
}
},
"play_url": {
"description": "PlayURL is a short-lived URL; do NOT expose bucket/object_key directly.",
"type": "string"
},
"type": {
"$ref": "#/definitions/consts.MediaAssetType"
}
}
},
"dto.ContentPriceUpsertForm": {
"type": "object",
"properties": {