Commit Graph

4 Commits

Author SHA1 Message Date
minecraft1024a
5fc9d1b9da refactor(schedule_api): 重构日程与计划API为只读数据库查询
将日程API从依赖`schedule_manager`的内存状态改为直接从数据库异步查询。这提高了数据一致性,并解除了模块间的紧密耦合。

主要变更:
- **解耦**: 移除对`schedule_manager`的依赖,所有数据直接来自数据库。
- **只读设计**: 移除了`regenerate_schedule`, `ensure_monthly_plans`, `archive_monthly_plans`等写操作API,使API职责更清晰,专注于查询。
- **功能增强**:
    - `get_schedule` (原`get_today_schedule`) 现在支持查询任意日期的日程。
    - `get_monthly_plans` 新增随机抽样功能。
    - 新增`get_activities_between`用于查询特定时间范围的活动。
    - 新增`count_monthly_plans`用于统计月度计划数量。
- **格式化输出**: 所有查询函数均增加了`formatted`参数,方便插件直接获取格式化后的字符串。
- **文档更新**: 全面更新了模块和函数的文档字符串,以反映新的API设计和用法。
2025-10-25 13:29:49 +08:00
John Richard
7923eafef3 re-style: 格式化代码 2025-10-02 20:26:01 +08:00
John Richard
ecb02cae31 style: 格式化代码 2025-10-02 19:38:39 +08:00
minecraft1024a
742a8c2c37 feat(plugin_system): 导出 schedule_api
将 schedule_api 添加到插件系统的 API 导出列表中,使其对插件可用。
2025-09-21 13:30:27 +08:00