Skip to content

[feat] 为添加课程页面提供更自由的时间选项#128

Open
hazuki-keatsu wants to merge 8 commits intomainfrom
feat/improveAddingCourse
Open

[feat] 为添加课程页面提供更自由的时间选项#128
hazuki-keatsu wants to merge 8 commits intomainfrom
feat/improveAddingCourse

Conversation

@hazuki-keatsu
Copy link
Copy Markdown
Collaborator

@hazuki-keatsu hazuki-keatsu commented Apr 17, 2026

新增自定义课程类支持,包含对应的数据模型、控制器与界面集成;为所有支持的语言添加了月份翻译,并完善课程表相关的本地化文案;同时包含若干代码优化与问题修复(例如,使用散列空间更大的通知ID生成器)。

Closes: #116

- Added CustomClass and CustomClassTimeRange models for handling custom classes and their time ranges.
- Introduced CustomClassController to manage the lifecycle of custom classes, including adding, editing, and deleting classes and their time ranges.
- Updated ClassTableWidgetState to integrate custom class data and provide methods for managing custom classes.
- Enhanced ClassCard to support displaying and interacting with custom classes.
- Created CustomClassDetailCard for detailed view and actions on custom classes.
- Implemented DateSelectorFree for selecting date ranges and time slots for classes.
- Updated class organization logic to include custom classes in the timetable.
- Refactored existing code to accommodate new custom class features and ensure smooth integration with the existing class table functionality.
Copy link
Copy Markdown
Owner

@BenderBlog BenderBlog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我接下来一周会忙其他的事情,所以您先慢慢改。现在没有发版本压力,所以不着急。

Comment thread lib/controller/custom_class_controller.dart
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果还没做,这样做:将原先的自定义课程代码删除,课程区间转换为时间保存到您写的新结构体。不要写迁移代码。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原先的自定义课程逻辑还是保留了。考虑到数据迁移带来的不确定性,我没有破坏任何原有的代码,只是为课程表引入了新的、独立的数据流。用户可以在添加课程页面自由选择是使用原来的数据流,还是新的方式的数据流。(个人觉得这是最保险的引入方式了,,)

image

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要写迁移代码的意思是,我们不管之前用户自定义课程的数据了。考虑到该功能使用人数很少,他们自己重新输入吧。之前的导入方式很不好,因为涉及两类数据合流,而且有 index 这个不确定因素(这个是我按照数据库外键设计的),最开始时候容易修改时候崩溃。现在未知,因为我程序没有测试代码。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

您的意思是,直接移除原来的自定义课程的数据流,全部使用新的数据流?同时不进行数据迁移?

如果是这样,我还要不要保留原有得通过周索引来添加课程的方式?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

保留,转换到时间就完了。具体等我忙完这阵给您时间对照表。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

时间对照表目前是以数组的形式硬编码的,我直接使用就可以。

只是确认一下您的描述,我这段时间期中也稍微有点忙,下周我会开始工作。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 为添加课程页面提供更自由的时间选项

2 participants