-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplanningTypes.ts
More file actions
131 lines (116 loc) · 3.06 KB
/
planningTypes.ts
File metadata and controls
131 lines (116 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// 学习规划相关类型定义
// 任务类型
export type TaskType = 'learn' | 'practice' | 'project' | 'review';
// 任务状态
export type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'skipped';
// 阶段状态
export type PhaseStatus = 'pending' | 'active' | 'completed';
// 规划状态
export type PlanStatus = 'active' | 'paused' | 'completed' | 'archived';
// 资源类型
export interface PlanResource {
title: string;
type: 'article' | 'video' | 'book' | 'course' | 'project';
url?: string;
description?: string;
}
// 学习任务
export interface LearningTask {
id: string;
title: string;
description: string;
type: TaskType;
estimatedHours: number;
status: TaskStatus;
linkedTopic?: string; // 可跳转到学习链学习的主题
resources?: PlanResource[];
checkpoints?: string[]; // 完成检查点
completedAt?: string;
}
// 学习阶段
export interface LearningPhase {
id: string;
title: string;
description: string;
duration: string; // 预计时长(如"2周")
order: number;
status: PhaseStatus;
tasks: LearningTask[];
prerequisites?: string[]; // 前置阶段ID
}
// 里程碑
export interface PlanMilestone {
id: string;
title: string;
description: string;
targetDate?: string;
phaseId: string;
achieved: boolean;
achievedAt?: string;
}
// 学习规划
export interface LearningPlan {
id: string;
title: string;
goal: string;
totalDuration: string; // 预计总时长(如"12周")
weeklyHours: number;
createdAt: string;
updatedAt: string;
status: PlanStatus;
phases: LearningPhase[];
milestones: PlanMilestone[];
metadata: {
expertId: string;
language: 'zh' | 'en';
currentLevel?: string; // 用户当前水平
};
}
// 规划进度统计
export interface PlanProgress {
totalTasks: number;
completedTasks: number;
inProgressTasks: number;
totalPhases: number;
completedPhases: number;
activePhaseIndex: number;
progressPercentage: number;
estimatedRemainingHours: number;
}
// 规划创建输入
export interface PlanCreationInput {
goal: string;
weeklyHours: number;
currentLevel: 'beginner' | 'intermediate' | 'advanced';
}
// 规划状态(用于 App 状态管理)
export interface PlanningState {
plans: LearningPlan[];
activePlanId: string | null;
isCreating: boolean;
isLoading: boolean;
error: string | null;
}
// AI 生成规划响应
export interface GeneratePlanResponse {
title: string;
totalDuration: string;
phases: Array<{
title: string;
description: string;
duration: string;
tasks: Array<{
title: string;
description: string;
type: TaskType;
estimatedHours: number;
linkedTopic?: string;
checkpoints?: string[];
}>;
}>;
milestones: Array<{
title: string;
description: string;
phaseIndex: number;
}>;
}