- 删除后端 risk_exceptions 模块(API/Model/Schema/迁移/测试) - 删除后端 metrics 模块(API/测试) - 删除后端 ManualTask 模型和相关 Schema - 修复搜索接口响应缺少 total 字段的问题 - 统一 Platform 枚举(前端去掉后端不支持的 weibo/wechat) - 新增前端注册页面 /register,登录页添加注册链接 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
99 lines
1.6 KiB
TypeScript
99 lines
1.6 KiB
TypeScript
/**
|
|
* 规则管理类型定义
|
|
* 与后端 api/rules.py 对齐
|
|
*/
|
|
|
|
// ===== 违禁词 =====
|
|
|
|
export interface ForbiddenWordCreate {
|
|
word: string
|
|
category: string
|
|
severity: string
|
|
}
|
|
|
|
export interface ForbiddenWordResponse {
|
|
id: string
|
|
word: string
|
|
category: string
|
|
severity: string
|
|
}
|
|
|
|
export interface ForbiddenWordListResponse {
|
|
items: ForbiddenWordResponse[]
|
|
total: number
|
|
}
|
|
|
|
// ===== 白名单 =====
|
|
|
|
export interface WhitelistCreate {
|
|
term: string
|
|
reason: string
|
|
brand_id: string
|
|
}
|
|
|
|
export interface WhitelistResponse {
|
|
id: string
|
|
term: string
|
|
reason: string
|
|
brand_id: string
|
|
}
|
|
|
|
export interface WhitelistListResponse {
|
|
items: WhitelistResponse[]
|
|
total: number
|
|
}
|
|
|
|
// ===== 竞品 =====
|
|
|
|
export interface CompetitorCreate {
|
|
name: string
|
|
brand_id: string
|
|
logo_url?: string
|
|
keywords: string[]
|
|
}
|
|
|
|
export interface CompetitorResponse {
|
|
id: string
|
|
name: string
|
|
brand_id: string
|
|
logo_url?: string | null
|
|
keywords: string[]
|
|
}
|
|
|
|
export interface CompetitorListResponse {
|
|
items: CompetitorResponse[]
|
|
total: number
|
|
}
|
|
|
|
// ===== 平台规则 =====
|
|
|
|
export interface PlatformRuleResponse {
|
|
platform: string
|
|
rules: Record<string, unknown>[]
|
|
version: string
|
|
updated_at: string
|
|
}
|
|
|
|
export interface PlatformListResponse {
|
|
items: PlatformRuleResponse[]
|
|
total: number
|
|
}
|
|
|
|
// ===== 规则冲突检测 =====
|
|
|
|
export interface RuleValidateRequest {
|
|
brand_id: string
|
|
platform: string
|
|
brief_rules: Record<string, unknown>
|
|
}
|
|
|
|
export interface RuleConflict {
|
|
brief_rule: string
|
|
platform_rule: string
|
|
suggestion: string
|
|
}
|
|
|
|
export interface RuleValidateResponse {
|
|
conflicts: RuleConflict[]
|
|
}
|