feat: 添加公开内容相关API接口及测试用例

This commit is contained in:
2025-12-22 16:33:35 +08:00
parent 39454458f1
commit 7eb7b14557
4 changed files with 508 additions and 0 deletions

View File

@@ -2189,6 +2189,184 @@
}
}
}
},
"/t/{tenantCode}/v1/public/contents": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"TenantPublic"
],
"summary": "公开内容列表(已发布 + public",
"parameters": [
{
"type": "string",
"description": "Tenant Code",
"name": "tenantCode",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Keyword filters by title keyword (LIKE).",
"name": "keyword",
"in": "query"
},
{
"type": "integer",
"description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.",
"name": "page",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/requests.Pager"
},
{
"type": "object",
"properties": {
"items": {
"$ref": "#/definitions/dto.ContentItem"
}
}
}
]
}
}
}
}
},
"/t/{tenantCode}/v1/public/contents/{contentID}": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"TenantPublic"
],
"summary": "公开内容详情(已发布 + public",
"parameters": [
{
"type": "string",
"description": "Tenant Code",
"name": "tenantCode",
"in": "path",
"required": true
},
{
"type": "integer",
"format": "int64",
"description": "ContentID",
"name": "contentID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ContentDetail"
}
}
}
}
},
"/t/{tenantCode}/v1/public/contents/{contentID}/assets": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"TenantPublic"
],
"summary": "获取公开正片资源main role免费/作者/已购)",
"parameters": [
{
"type": "string",
"description": "Tenant Code",
"name": "tenantCode",
"in": "path",
"required": true
},
{
"type": "integer",
"format": "int64",
"description": "ContentID",
"name": "contentID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ContentAssetsResponse"
}
}
}
}
},
"/t/{tenantCode}/v1/public/contents/{contentID}/preview": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"TenantPublic"
],
"summary": "获取公开试看资源preview role",
"parameters": [
{
"type": "string",
"description": "Tenant Code",
"name": "tenantCode",
"in": "path",
"required": true
},
{
"type": "integer",
"format": "int64",
"description": "ContentID",
"name": "contentID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ContentAssetsResponse"
}
}
}
}
}
},
"definitions": {