Documentation
¶
Index ¶
- func GetValidateCode(image string) (string, error)
- type CalTerm
- type CalTermEvent
- type CalTermEvents
- type Course
- type CourseAdjustRule
- type CourseScheduleRule
- type CreditStatistics
- type EmptyRoomReq
- type ExamRoomInfo
- type ExamRoomReq
- type GPABean
- type GPAData
- type LocateDate
- type Mark
- type NoticeInfo
- type NoticeInfoReq
- type SchoolCalendar
- type Student
- func (s *Student) CheckSession() error
- func (s *Student) ClearLoginData()
- func (s *Student) GetCET() ([]*UnifiedExam, error)
- func (s *Student) GetCredit() (creditStatistics []*CreditStatistics, err error)
- func (s *Student) GetCultivatePlan() (string, error)
- func (s *Student) GetEmptyRoom(req EmptyRoomReq) ([]string, error)
- func (s *Student) GetExamRoom(req ExamRoomReq) ([]*ExamRoomInfo, error)
- func (s *Student) GetGPA() (gpa *GPABean, err error)
- func (s *Student) GetIdentifierAndCookies() (string, []*http.Cookie, error)
- func (s *Student) GetInfo() (resp *StudentDetail, err error)
- func (s *Student) GetJS() ([]*UnifiedExam, error)
- func (s *Student) GetLocateDate() (*LocateDate, error)
- func (s *Student) GetMarks() (resp []*Mark, err error)
- func (s *Student) GetNoticeInfo(req *NoticeInfoReq) (list []*NoticeInfo, totalPages int, err error)
- func (s *Student) GetQiShanEmptyRoom(req EmptyRoomReq) ([]string, error)
- func (s *Student) GetSchoolCalendar() (*SchoolCalendar, error)
- func (s *Student) GetSemesterCourses(term, viewState, eventValidation string) ([]*Course, error)
- func (s *Student) GetTermEvents(termId string) (*CalTermEvents, error)
- func (s *Student) GetTerms() (*Term, error)
- func (s *Student) GetWithIdentifier(url string) (*html.Node, error)
- func (s *Student) Login() error
- func (s *Student) NewRequest() *resty.Request
- func (s *Student) PostWithIdentifier(url string, formData map[string]string) (*html.Node, error)
- func (s *Student) SetCookies(cookies []*http.Cookie)
- func (s *Student) SetIdentifier(identifier string)
- func (s *Student) WithLoginData(identifier string, cookies []*http.Cookie) *Student
- func (s *Student) WithUser(id, password string) *Student
- type StudentDetail
- type Term
- type UnifiedExam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CalTermEvent ¶
type CalTermEvents ¶
type CalTermEvents struct { TermId string `json:"termId"` // 学期ID Term string `json:"term"` // 学期 SchoolYear string `json:"schoolYear"` // 学年 Events []CalTermEvent `json:"events"` // 事件 }
type Course ¶
type Course struct { 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"` // 备注 }
课程信息
type CourseAdjustRule ¶
type CourseAdjustRule struct { OldWeek int `json:"oldWeek"` // 原-周次 OldWeekday int `json:"oldWeekday"` // 原-星期几 OldStartClass int `json:"oldStartClass"` // 原-开始节数 OldEndClass int `json:"oldEndClass"` // 原-结束节数 NewWeek int `json:"newWeek"` // 新-周次 NewWeekday int `json:"newWeekday"` // 新-星期几 NewStartClass int `json:"newStartClass"` // 新-开始节数 NewEndClass int `json:"newEndClass"` // 新-结束节数 NewLocation string `json:"newLocation"` // 新-上课地点 }
type CourseScheduleRule ¶
type CourseScheduleRule struct { Location string `json:"location"` // 上课地点 StartClass int `json:"startClass"` // 开始节数 EndClass int `json:"endClass"` // 结束节数 StartWeek int `json:"startWeek"` // 开始周 EndWeek int `json:"endWeek"` // 结束周 Weekday int `json:"weekday"` // 星期几 Single bool `json:"single"` // 单周 (PS: 为啥不用 odd) Double bool `json:"double"` // 双周 (PS: 为啥不用 even) Adjust bool `json:"adjust"` // 调课 FromFullWeek bool `json:"fromFullWeek"` // 是否来自整周课程 }
type CreditStatistics ¶
type EmptyRoomReq ¶
type EmptyRoomReq struct { Campus string `form:"campus" binding:"required"` // 校区 Time string `form:"time" binding:"required"` // 日期 格式:2023-09-22 Start string `form:"start" binding:"required"` End string `form:"end" binding:"required"` // 查询第Start节到第End节 Building string `form:"build" binding:"required"` // 教学楼名 }
空教室请求
type ExamRoomInfo ¶ added in v0.1.8
type ExamRoomReq ¶ added in v0.1.8
type ExamRoomReq struct {
Term string
}
type LocateDate ¶ added in v0.2.12
LocateDate 当前时间
type Mark ¶
type Mark struct { Type string `json:"type"` // 修读类别 Semester string `json:"semester"` // 开课学期 Name string `json:"name"` // 课程名称 Credits string `json:"credit"` // 计划学分 Score string `json:"score"` // 得分 GPA string `json:"GPA"` // 绩点 EarnedCredits string `json:"earned_credits"` // 得到学分 ElectiveType string `json:"electivetype"` // 选课类型 ExamType string `json:"examtype"` // 考试类别 Teacher string `json:"teacher"` // 任课教师 Classroom string `json:"classroom"` // 上课时间地点 ExamTime string `json:"examtime"` // 考试时间地点 }
type NoticeInfo ¶ added in v0.2.3
type NoticeInfoReq ¶ added in v0.2.3
type NoticeInfoReq struct {
PageNum int // 获取第几页的数据,从 1 开始
}
type SchoolCalendar ¶
type SchoolCalendar struct { CurrentTerm string `json:"currentTerm"` // 当前学期 Terms []CalTerm `json:"terms"` // 学期信息 }
校历
type Student ¶
type Student struct { ID string `json:"id"` // 学号 Password string `json:"password"` // 密码 // 如果我们使用client进行登陆的话,此时该字段失效,因为client会在登录时自动保存登陆凭证(session) // 所以该字段用于其他服务调用时传递登陆凭证 Identifier string // 位于url上id=....的一个标识符,主要用于组成url // contains filtered or unexported fields }
学生对象
func NewStudent ¶
func NewStudent() *Student
func (*Student) CheckSession ¶
CheckSession returns not nil if SessionExpired or AccountConflict
func (*Student) ClearLoginData ¶
func (s *Student) ClearLoginData()
func (*Student) GetCredit ¶
func (s *Student) GetCredit() (creditStatistics []*CreditStatistics, err error)
func (*Student) GetCultivatePlan ¶ added in v0.2.2
func (*Student) GetEmptyRoom ¶
func (s *Student) GetEmptyRoom(req EmptyRoomReq) ([]string, error)
func (*Student) GetExamRoom ¶ added in v0.1.8
func (s *Student) GetExamRoom(req ExamRoomReq) ([]*ExamRoomInfo, error)
考场查询
func (*Student) GetIdentifierAndCookies ¶
GetIdentifierAndCookies 方面服务端进行测试设置的接口
func (*Student) GetInfo ¶
func (s *Student) GetInfo() (resp *StudentDetail, err error)
GetInfo 获取学生个人信息
func (*Student) GetLocateDate ¶ added in v0.2.12
func (s *Student) GetLocateDate() (*LocateDate, error)
func (*Student) GetNoticeInfo ¶ added in v0.2.3
func (s *Student) GetNoticeInfo(req *NoticeInfoReq) (list []*NoticeInfo, totalPages int, err error)
func (*Student) GetQiShanEmptyRoom ¶
func (s *Student) GetQiShanEmptyRoom(req EmptyRoomReq) ([]string, error)
func (*Student) GetSchoolCalendar ¶
func (s *Student) GetSchoolCalendar() (*SchoolCalendar, error)
func (*Student) GetSemesterCourses ¶
获取我的选课
func (*Student) GetTermEvents ¶
func (s *Student) GetTermEvents(termId string) (*CalTermEvents, error)
func (*Student) GetWithIdentifier ¶
func (*Student) NewRequest ¶
func (s *Student) NewRequest() *resty.Request
func (*Student) PostWithIdentifier ¶
PostWithIdentifier returns parse tree for the resp of the request.
func (*Student) SetCookies ¶
func (*Student) SetIdentifier ¶
func (*Student) WithLoginData ¶
type StudentDetail ¶
type StudentDetail struct { Name string `json:"name"` // 姓名 Sex string `json:"sex"` // 性别 Birthday string `json:"birthday"` // 出生日期 Phone string `json:"phont"` // 手机号 Email string `json:"email"` // 邮箱 College string `json:"college"` // 学院 Grade string `json:"grade"` // 年级 StatusChanges string `json:"status_change"` // 学籍异动与奖励 Major string `json:"major"` // 专业 Counselor string `json:"counselor"` // 辅导员 ExamineeCategory string `json:"examinee_category"` // 考生类别 Nationality string `json:"nationality"` // 民族 Country string `json:"country"` // 国别 PoliticalStatus string `json:"political_status"` // 政治面貌 Source string `json:"source"` // 生源地 }
学生信息详情
type Term ¶
type Term struct { Terms []string `json:"terms"` // 学期数量 ViewState string `json:"viewstate"` // 课表必要信息 EventValidation string `json:"eventvalidation"` // 课表必要信息 }
学期信息
type UnifiedExam ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.