后端: - 审核结果拆分为 4 个独立维度 (法规合规/平台规则/品牌安全/Brief匹配度) - 卖点优先级从 required:bool 改为三级 (core/recommended/reference) - AI 语义匹配卖点覆盖 + AI 整体 Brief 匹配度分析 - BriefMatchDetail 评分详情 (覆盖率+亮点+问题点) - min_selling_points 代理商可配置最少卖点数 + Alembic 迁移 - AI 语境复核过滤误报 - Brief AI 解析 + 规则 AI 解析 - AI 未配置/异常时通知品牌方 - 种子数据更新 (新格式审核结果+brief_match_detail) 前端: - 三端审核页面展示四维度评分卡片 - 卖点编辑改为三级优先级选择器 - BriefMatchDetail 展示 (覆盖率进度条+亮点+问题) - min_selling_points 配置 UI - AI 配置页未配置时静默处理 - 文件预览/下载/签名 URL 优化 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
204 lines
4.0 KiB
TypeScript
204 lines
4.0 KiB
TypeScript
/**
|
||
* 任务相关类型定义
|
||
* 与后端 TaskStage/TaskStatus/TaskResponse 对齐
|
||
*/
|
||
|
||
// 任务阶段(对应后端 TaskStage)
|
||
export type TaskStage =
|
||
| 'script_upload'
|
||
| 'script_ai_review'
|
||
| 'script_agency_review'
|
||
| 'script_brand_review'
|
||
| 'video_upload'
|
||
| 'video_ai_review'
|
||
| 'video_agency_review'
|
||
| 'video_brand_review'
|
||
| 'completed'
|
||
| 'rejected'
|
||
|
||
// 审核状态(对应后端 TaskStatus)
|
||
export type TaskStatus =
|
||
| 'pending'
|
||
| 'processing'
|
||
| 'passed'
|
||
| 'rejected'
|
||
| 'force_passed'
|
||
|
||
// 关联信息
|
||
export interface ProjectInfo {
|
||
id: string
|
||
name: string
|
||
brand_name?: string | null
|
||
platform?: string | null
|
||
}
|
||
|
||
export interface AgencyInfo {
|
||
id: string
|
||
name: string
|
||
}
|
||
|
||
export interface CreatorInfo {
|
||
id: string
|
||
name: string
|
||
avatar?: string | null
|
||
}
|
||
|
||
// 审核维度评分
|
||
export interface DimensionScore {
|
||
score: number
|
||
passed: boolean
|
||
issue_count: number
|
||
}
|
||
|
||
// 四维度审核结果
|
||
export interface ReviewDimensions {
|
||
legal: DimensionScore
|
||
platform: DimensionScore
|
||
brand_safety: DimensionScore
|
||
brief_match: DimensionScore
|
||
}
|
||
|
||
// 卖点匹配结果
|
||
export interface SellingPointMatchResult {
|
||
content: string
|
||
priority: 'core' | 'recommended' | 'reference'
|
||
matched: boolean
|
||
evidence?: string
|
||
}
|
||
|
||
// Brief 匹配度评分详情
|
||
export interface BriefMatchDetail {
|
||
total_points: number
|
||
matched_points: number
|
||
required_points: number
|
||
coverage_score: number
|
||
overall_score: number
|
||
highlights: string[]
|
||
issues: string[]
|
||
explanation: string
|
||
}
|
||
|
||
// AI 审核结果
|
||
export interface AIReviewResult {
|
||
score: number
|
||
summary?: string
|
||
dimensions?: ReviewDimensions
|
||
selling_point_matches?: SellingPointMatchResult[]
|
||
brief_match_detail?: BriefMatchDetail
|
||
violations: Array<{
|
||
type: string
|
||
content: string
|
||
severity: string
|
||
suggestion: string
|
||
dimension?: string
|
||
timestamp?: number
|
||
source?: string
|
||
}>
|
||
soft_warnings: Array<{
|
||
type: string
|
||
content: string
|
||
suggestion: string
|
||
}>
|
||
}
|
||
|
||
// 任务响应(对应后端 TaskResponse)
|
||
export interface TaskResponse {
|
||
id: string
|
||
name: string
|
||
sequence: number
|
||
stage: TaskStage
|
||
|
||
// 关联
|
||
project: ProjectInfo
|
||
agency: AgencyInfo
|
||
creator: CreatorInfo
|
||
|
||
// 脚本信息
|
||
script_file_url?: string | null
|
||
script_file_name?: string | null
|
||
script_uploaded_at?: string | null
|
||
script_ai_score?: number | null
|
||
script_ai_result?: AIReviewResult | null
|
||
script_agency_status?: TaskStatus | null
|
||
script_agency_comment?: string | null
|
||
script_brand_status?: TaskStatus | null
|
||
script_brand_comment?: string | null
|
||
|
||
// 视频信息
|
||
video_file_url?: string | null
|
||
video_file_name?: string | null
|
||
video_duration?: number | null
|
||
video_thumbnail_url?: string | null
|
||
video_uploaded_at?: string | null
|
||
video_ai_score?: number | null
|
||
video_ai_result?: AIReviewResult | null
|
||
video_agency_status?: TaskStatus | null
|
||
video_agency_comment?: string | null
|
||
video_brand_status?: TaskStatus | null
|
||
video_brand_comment?: string | null
|
||
|
||
// 申诉
|
||
appeal_count: number
|
||
is_appeal: boolean
|
||
appeal_reason?: string | null
|
||
|
||
// 时间
|
||
created_at: string
|
||
updated_at: string
|
||
}
|
||
|
||
export interface TaskListResponse {
|
||
items: TaskResponse[]
|
||
total: number
|
||
page: number
|
||
page_size: number
|
||
}
|
||
|
||
export interface TaskSummary {
|
||
id: string
|
||
name: string
|
||
stage: TaskStage
|
||
creator_name: string
|
||
creator_avatar?: string | null
|
||
project_name: string
|
||
is_appeal: boolean
|
||
appeal_reason?: string | null
|
||
created_at: string
|
||
updated_at: string
|
||
}
|
||
|
||
export interface ReviewTaskListResponse {
|
||
items: TaskSummary[]
|
||
total: number
|
||
page: number
|
||
page_size: number
|
||
}
|
||
|
||
// 请求类型
|
||
export interface TaskCreateRequest {
|
||
project_id: string
|
||
creator_id: string
|
||
name?: string
|
||
}
|
||
|
||
export interface TaskScriptUploadRequest {
|
||
file_url: string
|
||
file_name: string
|
||
}
|
||
|
||
export interface TaskVideoUploadRequest {
|
||
file_url: string
|
||
file_name: string
|
||
duration?: number
|
||
thumbnail_url?: string
|
||
}
|
||
|
||
export interface TaskReviewRequest {
|
||
action: 'pass' | 'reject' | 'force_pass'
|
||
comment?: string
|
||
}
|
||
|
||
export interface AppealRequest {
|
||
reason: string
|
||
}
|