/** * 任务相关类型定义 * 与后端 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 }