refactor(dataset): 更新数据集导入配置接口定义

- 添加 DatasetImportConfig 接口定义
- 定义 source、target、dataSource 等属性
- 支持 splitByLine 和 hasArchive 配置选项
- 将 importConfig 类型从 any 改为 DatasetImportConfig
- 增强类型安全性和代码可维护性
This commit is contained in:
2026-01-20 13:37:28 +08:00
parent 79371ba078
commit d58d026256
5 changed files with 185 additions and 121 deletions

View File

@@ -58,6 +58,15 @@ export interface Dataset {
distribution?: Record<string, Record<string, number>>;
}
export interface DatasetImportConfig {
source?: DataSource | string;
target?: DataSource | string;
dataSource?: string;
splitByLine?: boolean;
hasArchive?: boolean;
[key: string]: string | number | boolean | null | undefined;
}
export interface TagItem {
id: string;
name: string;
@@ -84,7 +93,7 @@ export interface DatasetTask {
status: "importing" | "waiting" | "completed" | "failed";
progress: number;
createdAt: string;
importConfig: any;
importConfig: DatasetImportConfig;
scheduleConfig: ScheduleConfig;
nextExecution?: string;
lastExecution?: string;