content performance

This commit is contained in:
2025-03-14 23:23:47 +08:00
parent d0f2ab0620
commit 4056bac3ab
4 changed files with 630 additions and 0 deletions

View File

@@ -3462,6 +3462,207 @@ export const openAPISpec = {
}
}
},
'/api/analytics/content-performance': {
get: {
summary: '获取内容表现分析数据',
description: '提供内容覆盖量、互动率、互动量等散点图数据,用于四象限分析',
tags: ['Analytics'],
parameters: [
{
name: 'timeRange',
in: 'query',
description: '时间范围(天)',
schema: {
type: 'string',
enum: ['7', '30', '90'],
default: '30'
}
},
{
name: 'projectId',
in: 'query',
description: '项目ID',
schema: {
type: 'string'
}
},
{
name: 'platform',
in: 'query',
description: '平台',
schema: {
type: 'string'
}
},
{
name: 'kolId',
in: 'query',
description: 'KOL ID',
schema: {
type: 'string'
}
},
{
name: 'contentType',
in: 'query',
description: '内容类型',
schema: {
type: 'string',
enum: ['post', 'video', 'article', 'all'],
default: 'all'
}
},
{
name: 'limit',
in: 'query',
description: '最大返回条数',
schema: {
type: 'integer',
default: 100
}
}
],
responses: {
'200': {
description: '内容表现分析数据',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
success: {
type: 'boolean'
},
data: {
type: 'array',
items: {
type: 'object',
properties: {
content_id: {
type: 'string',
description: '内容ID'
},
title: {
type: 'string',
description: '内容标题'
},
platform: {
type: 'string',
description: '平台'
},
content_type: {
type: 'string',
description: '内容类型'
},
influencer_name: {
type: 'string',
description: 'KOL名称'
},
publish_date: {
type: 'string',
description: '发布日期'
},
coverage: {
type: 'integer',
description: '内容覆盖量(阅读量/浏览量)'
},
interaction_rate: {
type: 'number',
format: 'float',
description: '互动率(互动总数/覆盖量)'
},
interaction_count: {
type: 'integer',
description: '互动总量(点赞+评论+分享)'
},
likes: {
type: 'integer',
description: '点赞数'
},
comments: {
type: 'integer',
description: '评论数'
},
shares: {
type: 'integer',
description: '分享数'
},
quadrant: {
type: 'string',
enum: ['high_value', 'high_coverage', 'high_engagement', 'low_performance'],
description: '四象限分类'
}
}
}
},
metadata: {
type: 'object',
properties: {
total: {
type: 'integer',
description: '内容总数'
},
average_coverage: {
type: 'number',
format: 'float',
description: '平均覆盖量'
},
average_interaction_rate: {
type: 'number',
format: 'float',
description: '平均互动率'
},
quadrant_counts: {
type: 'object',
properties: {
high_value: {
type: 'integer',
description: '高价值内容数'
},
high_coverage: {
type: 'integer',
description: '高覆盖内容数'
},
high_engagement: {
type: 'integer',
description: '高互动内容数'
},
low_performance: {
type: 'integer',
description: '低表现内容数'
}
}
}
}
}
}
}
}
}
},
'400': {
description: '无效请求',
content: {
'application/json': {
schema: {
$ref: '#/components/schemas/Error'
}
}
}
},
'500': {
description: '服务器错误',
content: {
'application/json': {
schema: {
$ref: '#/components/schemas/Error'
}
}
}
}
}
}
},
},
components: {
schemas: {