funel data

This commit is contained in:
2025-03-11 00:36:22 +08:00
parent 7857a9007a
commit bc42ff4dbf
13 changed files with 2171 additions and 11 deletions

View File

@@ -1987,6 +1987,137 @@ export const openAPISpec = {
}
}
},
'/api/analytics/project/{id}/conversion-funnel': {
get: {
summary: '获取KOL合作转换漏斗数据',
description: '获取项目中KOL合作的转换漏斗数据包括各个阶段的数量和比率',
tags: ['Analytics'],
security: [{ bearerAuth: [] }],
parameters: [
{
name: 'id',
in: 'path',
required: true,
description: '项目ID',
schema: {
type: 'string'
}
},
{
name: 'timeframe',
in: 'query',
required: false,
description: '时间范围 (7days, 30days, 90days, 6months)',
schema: {
type: 'string',
enum: ['7days', '30days', '90days', '6months'],
default: '30days'
}
}
],
responses: {
'200': {
description: '成功获取KOL合作转换漏斗数据',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
project: {
type: 'object',
properties: {
id: {
type: 'string',
description: '项目ID'
},
name: {
type: 'string',
description: '项目名称'
}
}
},
timeframe: {
type: 'string',
description: '时间范围'
},
funnel_data: {
type: 'array',
description: '漏斗数据',
items: {
type: 'object',
properties: {
stage: {
type: 'string',
description: '阶段名称'
},
count: {
type: 'integer',
description: 'KOL数量'
},
rate: {
type: 'integer',
description: '占总数的百分比'
}
}
}
},
metrics: {
type: 'object',
properties: {
total_influencers: {
type: 'integer',
description: 'KOL总数'
},
conversion_rate: {
type: 'integer',
description: '总体转化率'
},
avg_stage_dropoff: {
type: 'integer',
description: '平均阶段流失率'
}
}
}
}
}
}
}
},
'404': {
description: '项目未找到',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
error: {
type: 'string',
example: 'Project not found'
}
}
}
}
}
},
'500': {
description: '服务器错误',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
error: {
type: 'string',
example: 'Internal server error'
}
}
}
}
}
}
}
}
},
'/api/analytics/project/{id}/top-performers': {
get: {
tags: ['Analytics'],