Documentation ¶
Index ¶
- Constants
- func CampusEasyMap(c string) string
- func GetSelectedCourseNames(cl global.JwxtClienter) (courseNames []string)
- type Course
- func (c *Course) AutoChoose(cl global.JwxtClienter, sleep time.Duration) <-chan msg
- func (c *Course) Cancel(cl global.JwxtClienter) bool
- func (c *Course) Choose(cl global.JwxtClienter) bool
- func (c *Course) CourseName() string
- func (c *Course) GetTeachers(cl global.JwxtClienter) ([]teacherInfo, error)
- func (c *Course) IsSelected() bool
- func (c *Course) PopCollection(cl global.JwxtClienter) bool
- func (c *Course) PushCollection(cl global.JwxtClienter) bool
- func (c *Course) Refresh(cl global.JwxtClienter) error
- func (c *Course) VacancyInfo() string
- func (c *Course) VacancyNum() int
- type CourseInfo
- type CourseList
- type CourseListReq
- func (reqJson *CourseListReq) Do(c global.JwxtClienter) *CourseList
- func (reqJson *CourseListReq) DoPage(c global.JwxtClienter) (courseList *CourseList, n_page int)
- func (r *CourseListReq) IncrePageNo() *CourseListReq
- func (r *CourseListReq) Marshall() string
- func (r *CourseListReq) Option(opts ...ReqOptionSetter) ReqOptionSetter
- func (r *CourseListReq) SetPageNo(pageNo int) *CourseListReq
- type CourseListResp
- type CoursePhase
- type CoursePhaseResp
- type CourseType
- type ReqOptionSetter
- type ReqOptions
Constants ¶
View Source
const ( CAMPUS_EAST = "5063559" CAMPUS_NORTH = "5062202" CAMPUS_SOUTH = "5062201" CAMPUS_SZ = "333291143" CAMPUS_ZH = "5062203" CAMPUS_ALL = "" TYPE_PUB_ELECTIVE = "公选" TYPE_MAJ_ELECTIVE = "专选" TYPE_MAJ_COMPULSORY = "专必" TYPE_GYM = "体育" TYPE_ENGLISH = "英语" TYPE_OTHERS = "其他" NAME_ALL = "" )
Variables ¶
This section is empty.
Functions ¶
func CampusEasyMap ¶
func GetSelectedCourseNames ¶
func GetSelectedCourseNames(cl global.JwxtClienter) (courseNames []string)
Types ¶
type Course ¶
type Course struct { CourseType *CourseType Option ReqOptions BaseInfo CourseInfo }
func (*Course) AutoChoose ¶
func (c *Course) AutoChoose(cl global.JwxtClienter, sleep time.Duration) <-chan msg
如果作为一个三方库设计,不应该是一个完全黑盒,所以这里也传递选课失败信息
func (*Course) CourseName ¶
func (*Course) GetTeachers ¶
func (c *Course) GetTeachers(cl global.JwxtClienter) ([]teacherInfo, error)
func (*Course) IsSelected ¶
note: u should call course.refresh to update it
func (*Course) PopCollection ¶
func (c *Course) PopCollection(cl global.JwxtClienter) bool
func (*Course) PushCollection ¶
func (c *Course) PushCollection(cl global.JwxtClienter) bool
func (*Course) VacancyInfo ¶
func (*Course) VacancyNum ¶
type CourseInfo ¶
type CourseInfo struct { MainClassesID string `json:"mainClassesID"` TeachingClassID string `json:"teachingClassId"` // note this is clazzId TeachingClassNum string `json:"teachingClassNum"` TeachingClassName interface{} `json:"teachingClassName"` CourseNum string `json:"courseNum"` CourseName string `json:"courseName"` Credit float64 `json:"credit"` ExamFormName string `json:"examFormName"` CourseUnitNum string `json:"courseUnitNum"` CourseUnitName string `json:"courseUnitName"` TeachingTeacherNum string `json:"teachingTeacherNum"` TeachingTeacherName string `json:"teachingTeacherName"` BaseReceiveNum int `json:"baseReceiveNum"` AddReceiveNum int `json:"addReceiveNum"` TeachingTimePlace string `json:"teachingTimePlace"` StudyCampusID string `json:"studyCampusId"` Week string `json:"week"` ClassTimes string `json:"classTimes"` CourseSelectedNum string `json:"courseSelectedNum"` FilterSelectedNum string `json:"filterSelectedNum"` SelectedStatus string `json:"selectedStatus"` CollectionStatus string `json:"collectionStatus"` TeachingLanguageCode string `json:"teachingLanguageCode"` PubCourseTypeCode interface{} `json:"pubCourseTypeCode"` CourseCateCode string `json:"courseCateCode"` SpecialClassCode interface{} `json:"specialClassCode"` SportItemID interface{} `json:"sportItemId"` RecordMode string `json:"recordMode"` ClazzNum string `json:"clazzNum"` ExamFormCode string `json:"examFormCode"` CourseID string `json:"courseId"` ScheduleExamTime interface{} `json:"scheduleExamTime"` }
type CourseList ¶
type CourseList struct {
Courses []*Course
}
func NewCourseList ¶
func NewCourseList(courseType *CourseType, baseInfos []CourseInfo, reqOption ReqOptions) *CourseList
func (*CourseList) CourseNames ¶
func (l *CourseList) CourseNames() []string
func (*CourseList) First ¶
func (l *CourseList) First() (*Course, error)
type CourseListReq ¶
type CourseListReq struct {
// contains filtered or unexported fields
}
func NewCourseListReq ¶
func NewCourseListReq(courseType *CourseType, opts ...ReqOptionSetter) *CourseListReq
func (*CourseListReq) Do ¶
func (reqJson *CourseListReq) Do(c global.JwxtClienter) *CourseList
返回所有课程列表,从第一页开始
func (*CourseListReq) DoPage ¶
func (reqJson *CourseListReq) DoPage(c global.JwxtClienter) (courseList *CourseList, n_page int)
返回一页课程列表,设置courseListReq.SetPage() @return 返回本页内所有课程列表,和所有页的课程数
func (*CourseListReq) IncrePageNo ¶
func (r *CourseListReq) IncrePageNo() *CourseListReq
func (*CourseListReq) Marshall ¶
func (r *CourseListReq) Marshall() string
func (*CourseListReq) Option ¶
func (r *CourseListReq) Option(opts ...ReqOptionSetter) ReqOptionSetter
set optional parameters
func (*CourseListReq) SetPageNo ¶
func (r *CourseListReq) SetPageNo(pageNo int) *CourseListReq
type CourseListResp ¶
type CourseListResp struct { Code int `json:"code"` Message interface{} `json:"message"` Data struct { Total int `json:"total"` Rows []CourseInfo `json:"rows"` } `json:"data"` }
type CoursePhase ¶
type CoursePhase struct { ElectiveCourseStageName string `json:"electiveCourseStageName"` RetreatCourseStatus string `json:"retreatCourseStatus"` Code int `json:"code"` SemesterYear string `json:"semesterYear"` CourseSelectType string `json:"courseSelectType"` ChooseCourseStatus string `json:"chooseCourseStatus"` ElectiveCourseStageCode string `json:"electiveCourseStageCode"` StartTime string `json:"startTime"` EndTime string `json:"endTime"` CrossMajor string `json:"crossMajor"` }
func GetCoursePhase ¶
func GetCoursePhase(c global.JwxtClienter) *CoursePhase
func (*CoursePhase) CanSelect ¶
func (p *CoursePhase) CanSelect() bool
type CoursePhaseResp ¶
type CoursePhaseResp struct { Code int `json:"code"` Message interface{} `json:"message"` Data CoursePhase `json:"data"` }
type CourseType ¶
type ReqOptionSetter ¶
type ReqOptionSetter struct {
// contains filtered or unexported fields
}
func WithCampus ¶
func WithCampus(campusId string) ReqOptionSetter
func WithCourseName ¶
func WithCourseName(courseName string) ReqOptionSetter
func WithShowCollected ¶
func WithShowCollected(isOnlyShowCollected bool) ReqOptionSetter
func (*ReqOptionSetter) Value ¶
func (ros *ReqOptionSetter) Value() interface{}
type ReqOptions ¶
type ReqOptions struct {
// contains filtered or unexported fields
}
之所以这样设计,一方面是往New函数里面传option是一种风格,另一方面,也是为了可拓展性,因为请求还可以加入其他字段
func (*ReqOptions) GetCampusId ¶
func (o *ReqOptions) GetCampusId() string
func (*ReqOptions) GetCollectionStatus ¶
func (o *ReqOptions) GetCollectionStatus() string
func (*ReqOptions) GetCourseName ¶
func (o *ReqOptions) GetCourseName() string
Click to show internal directories.
Click to hide internal directories.