feat: 课程自动排序、Web课程名显示、ICS日历导出#17
Open
magneticyue-tech wants to merge 3 commits into
Open
Conversation
- 课程自动排序(course_sort_enabled): 拓扑排序保证退课先于与其 冲突的选课执行(时间重叠或同课程号),其余选课尽量靠前, 选课间按开课类型优先(体育分项>通识选修课>其他), 保留手动排序选项;Web页面提供自动排序按钮与↑↓手动调整 - Web配置页按课程编号自动显示课程名称与上课时间 (来源course.json或任务落实情况课程导出Excel) - ICS日历导出(semester_start_date): 为选课课程生成日历文件, 兼容Apple/Google日历;因单双周原因每次上课为独立事件 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
d70a8e8 to
540987a
Compare
复用已有登录态请求教务系统xskbcx_cxXsgrkb接口,解析此前被丢弃的 kbList课表数组,生成timetable_<学年学期>_full.ics。与选课日历不同, 该文件包含无需手动选课的预置分配课程,是完整个人课表。无需浏览器 自动化。附kbList星期/节次/周次(单双周)解析的单元测试。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
将个人课表ICS生成移至抢课完成之后: - 反映实际选课结果,自动排除未选上的备选教学班, 解决同一课程配置多个备选教学班导致日历重复的问题 - 在线获取失败时回退为按选课配置生成 - 教务系统不提供第1周星期一的日历日期(课表接口仅有周次范围), 故 semester_start_date 保持手动填写,未填写则跳过并提示 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
|
感谢提交pr! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
新增功能
1. 课程自动排序(保留手动排序)
course_sort_enabled(默认关闭,完全保持原有手动顺序)。开启后程序在获取课程信息后对课程执行顺序做拓扑排序:退课先于与其冲突的选课执行。{2-8周(双)}与多段如{1-6周,9-17周}),或同一课程号的不同教学班(教务系统不允许同时持有)。体育分项>通识选修课> 其他(此类课程通常竞争最激烈),同优先级保持原有相对顺序(稳定排序)。自动排序按钮与每行↑↓按钮,便于手动微调。pkg/course/sortCourse_test.go(6个用例全部通过)。2. Web配置页按课程编号显示课程名
/getCourseInfo接口,从本地course.json或任务落实情况课程导出.xlsx读取课程信息;输入课程编号即实时显示课程名称与上课时间,便于用户手动调整课程顺序。3. ICS日历导出
semester_start_date(第1周星期一日期)。设置后程序为课程列表中选课的课程生成timetable_<学年学期>.ics,可导入Apple日历、Google日历。/exportIcs)。4. 个人完整课表ICS(抢课后生成,含预置分配课程)
timetable_<学年学期>_full.ics:复用已有登录态请求教务系统xskbcx_cxXsgrkb接口(此前GetStuInfo已请求该接口但仅取学号信息、丢弃了kbList课表数组)。kbList的星期/节次/周次(单双周)字段,附单元测试pkg/course/timetable_test.go。semester_start_date需每学期手动填写一次;未填写则跳过ICS生成,不影响选退课。兼容性
omitempty),旧配置文件无需修改即可运行。go vet、go test ./pkg/course/、go build全部通过(Go 1.23.4)。🤖 Generated with Claude Code