feat: 移除目标管理功能模块

删除了完整的目标管理功能,包括目标创建、编辑、任务管理等相关页面和组件。同时移除了相关的API服务、Redux状态管理、类型定义和通知功能。应用版本从1.0.20升级到1.0.21。
This commit is contained in:
richarjiang
2025-10-31 08:49:22 +08:00
parent 7cd290d341
commit 16c2351160
31 changed files with 953 additions and 7884 deletions

View File

@@ -1,251 +0,0 @@
// 目标管理相关类型定义
export type RepeatType = 'daily' | 'weekly' | 'monthly';
export type GoalStatus = 'active' | 'paused' | 'completed' | 'cancelled';
export type GoalPriority = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
// 自定义重复规则
export interface CustomRepeatRule {
weekdays?: number[]; // 0-60为周日
dayOfMonth?: number[]; // 1-31
}
// 提醒设置
export interface ReminderSettings {
enabled: boolean;
weekdays?: number[]; // 0-60为周日
monthDays?: number[]; // 1-31每月几号
sound?: string;
vibration?: boolean;
}
// 目标数据结构
export interface Goal {
id: string;
userId: string;
title: string;
description?: string;
repeatType: RepeatType;
frequency: number;
customRepeatRule?: CustomRepeatRule;
startDate: string; // ISO date string
endDate?: string; // ISO date string
startTime: number; // HH:mm format
endTime: number; // HH:mm format
status: GoalStatus;
completedCount: number;
targetCount?: number;
category?: string;
priority: GoalPriority;
hasReminder: boolean;
reminderTime?: string; // HH:mm format
reminderSettings?: ReminderSettings;
createdAt?: string;
updatedAt?: string;
}
// 目标完成记录
export interface GoalCompletion {
id: string;
goalId: string;
userId: string;
completedAt: string; // ISO datetime string
completionCount: number;
notes?: string;
metadata?: Record<string, any>;
}
// 创建目标的请求数据
export interface CreateGoalRequest {
title: string;
description?: string;
repeatType: RepeatType;
frequency: number;
customRepeatRule?: CustomRepeatRule;
startDate?: string;
endDate?: string;
startTime?: number; // 单位:分钟
endTime?: number; // 单位:分钟
targetCount?: number;
category?: string;
priority: GoalPriority;
hasReminder: boolean;
reminderTime?: string;
reminderSettings?: ReminderSettings;
}
// 更新目标的请求数据
export interface UpdateGoalRequest {
title?: string;
description?: string;
repeatType?: RepeatType;
frequency?: number;
customRepeatRule?: CustomRepeatRule;
startDate?: string;
endDate?: string;
targetCount?: number;
category?: string;
priority?: GoalPriority;
hasReminder?: boolean;
reminderTime?: string;
reminderSettings?: ReminderSettings;
status?: GoalStatus;
}
// 记录目标完成的请求数据
export interface CompleteGoalRequest {
completionCount?: number;
notes?: string;
completedAt?: string;
}
// 获取目标列表的查询参数
export interface GetGoalsQuery {
page?: number;
pageSize?: number;
status?: GoalStatus;
repeatType?: RepeatType;
category?: string;
search?: string;
startDate?: string;
endDate?: string;
sortBy?: 'createdAt' | 'updatedAt' | 'priority' | 'title' | 'startDate';
sortOrder?: 'asc' | 'desc';
}
// 获取目标完成记录的查询参数
export interface GetGoalCompletionsQuery {
page?: number;
pageSize?: number;
startDate?: string;
endDate?: string;
}
// 批量操作目标的请求数据
export interface BatchGoalOperationRequest {
goalIds: string[];
action: 'pause' | 'resume' | 'complete' | 'delete';
}
// 批量操作结果
export interface BatchGoalOperationResult {
goalId: string;
success: boolean;
error?: string;
}
// 目标统计信息
export interface GoalStats {
total: number;
active: number;
completed: number;
paused: number;
cancelled: number;
byCategory: Record<string, number>;
byRepeatType: Record<RepeatType, number>;
totalCompletions: number;
thisWeekCompletions: number;
thisMonthCompletions: number;
}
// API响应格式
export interface ApiResponse<T> {
code: number;
message: string;
data: T;
}
// 分页响应格式
export interface PaginatedResponse<T> {
page: number;
pageSize: number;
total: number;
list: T[];
}
// 目标详情响应(包含完成记录)
export interface GoalDetailResponse extends Goal {
progressPercentage: number;
daysRemaining?: number;
completions: GoalCompletion[];
}
// 目标列表项响应
export interface GoalListItem extends Goal {
progressPercentage: number;
daysRemaining?: number;
}
// 任务相关类型定义
export type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'overdue' | 'skipped';
// 任务数据结构
export interface Task {
id: string;
goalId: string;
userId: string;
title: string;
description?: string;
startDate: string; // ISO date string
endDate: string; // ISO date string
targetCount: number;
currentCount: number;
status: TaskStatus;
progressPercentage: number;
completedAt?: string; // ISO datetime string
notes?: string;
metadata?: Record<string, any>;
daysRemaining: number;
isToday: boolean;
goal?: {
id: string;
title: string;
repeatType: RepeatType;
frequency: number;
category?: string;
};
}
// 获取任务列表的查询参数
export interface GetTasksQuery {
goalId?: string;
status?: TaskStatus;
startDate?: string;
endDate?: string;
page?: number;
pageSize?: number;
}
// 完成任务的请求数据
export interface CompleteTaskRequest {
count?: number;
notes?: string;
completedAt?: string;
}
// 跳过任务的请求数据
export interface SkipTaskRequest {
reason?: string;
}
// 任务统计信息
export interface TaskStats {
total: number;
pending: number;
inProgress: number;
completed: number;
overdue: number;
skipped: number;
totalProgress: number;
todayTasks: number;
weekTasks: number;
monthTasks: number;
}
// 任务列表项响应
export interface TaskListItem extends Task {
// 继承Task的所有属性
}