diff --git a/course.go b/course.go index fb36438..527d445 100644 --- a/course.go +++ b/course.go @@ -320,12 +320,18 @@ func (s *Student) GetSemesterCourses(term, viewState, eventValidation string) ([ // TODO: performance optimization res = append(res, &Course{ - Name: htmlquery.OutputHTML(info[1], false), - Syllabus: constants.JwchPrefix + safeExtractRegex(`javascript:pop1\('(.*?)&`, safeExtractionValue(info[2], "a", "href", 0)), - LessonPlan: constants.JwchPrefix + safeExtractRegex(`javascript:pop1\('(.*?)&`, safeExtractionValue(info[2], "a", "href", 1)), + Type: htmlquery.OutputHTML(info[0], false), + Name: htmlquery.OutputHTML(info[1], false), + Syllabus: constants.JwchPrefix + safeExtractRegex(`javascript:pop1\('(.*?)&`, safeExtractionValue(info[2], "a", "href", 0)), + LessonPlan: constants.JwchPrefix + safeExtractRegex(`javascript:pop1\('(.*?)&`, safeExtractionValue(info[2], "a", "href", 1)), + // PaymentStatus: safeExtractionFirst(info[3], "font"), + Credits: safeExtractionFirst(info[4], "span"), + ElectiveType: utils.GetChineseCharacter(htmlquery.OutputHTML(info[5], false)), + ExamType: utils.GetChineseCharacter(htmlquery.OutputHTML(info[6], false)), Teacher: htmlquery.OutputHTML(info[7], false), ScheduleRules: scheduleRules, RawScheduleRules: strings.Join(courseInfo8, "\n"), + RawExamTime: strings.TrimSpace(htmlquery.InnerText(info[9])), RawAdjust: strings.Join(courseInfo11, "\n"), Remark: htmlquery.OutputHTML(info[10], false), }) diff --git a/model.go b/model.go index 2cafe00..1cea0da 100644 --- a/model.go +++ b/model.go @@ -60,12 +60,18 @@ type Term struct { // 课程信息 type Course struct { - Name string `json:"name"` // 课程名称 - Syllabus string `json:"syllabus"` // 课程大纲 - LessonPlan string `json:"lessonplan"` // 课程计划 + Type string `json:"type"` // 修读类别 + Name string `json:"name"` // 课程名称 + Syllabus string `json:"syllabus"` // 课程大纲 + LessonPlan string `json:"lessonplan"` // 课程计划 + // PaymentStatus string `json:"paymentstatus"` // 缴费状态 + Credits string `json:"credit"` // 学分 + ElectiveType string `json:"electivetype"` // 选课类型 + ExamType string `json:"examtype"` // 考试类别 Teacher string `json:"teacher"` // 任课教师 ScheduleRules []CourseScheduleRule `json:"scheduleRules"` // 上课时间地点规则 RawScheduleRules string `json:"rawScheduleRules"` // 上课时间地点(原始文本) + RawExamTime string `json:"rawExamTime"` // 考试时间地点(原始文本) RawAdjust string `json:"rawAdjust"` // 调课信息(原始文本) Remark string `json:"remark"` // 备注 }