Your Name 0b3dfa3c52 feat: AI 审核自动驳回 + 功效词可配置 + UI 修复
- AI 自动驳回:法规/品牌安全 HIGH 违规或总分<40 自动打回上传阶段
- 功效词可配置:从硬编码改为品牌方在规则页面自行管理
- 驳回通知:AI 驳回时只通知达人,含具体原因
- 达人端:脚本/视频页面展示 AI 驳回原因 + 重新上传入口
- 规则页面:新增"功效词"分类
- 种子数据:新增 6 条默认功效词
- 其他:代理商管理下拉修复、AI 配置模型列表扩展、视觉模型标签修正、规则编辑放开限制

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:24:32 +08:00

207 lines
4.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 任务相关类型定义
* 与后端 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
ai_auto_rejected?: boolean
ai_reject_reason?: string
ai_available?: boolean
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
}