Documentation ¶
Index ¶
- Variables
- func BuildAirSchedule(raw []CourseInfo) (ret [20][7][5][]CourseInfo)
- type CourseInfo
- type DayfreeSelParam
- type JwTime
- type JwUser
- func (u *JwUser) BindSecUser(secUser *sec.SecUser) (err error)
- func (u *JwUser) GetBannerRpt() (body string, err error)
- func (u *JwUser) GetCXGRCJRpt(timeMode uint, mode uint, flag uint, year uint, term uint, stuID string) (body string, err error)
- func (u *JwUser) GetClassID(name string) (id string, err error)
- func (u *JwUser) GetClassSelPage() (body string, err error)
- func (u *JwUser) GetClassSelRpt(year int, term int, calssID string) (body string, err error)
- func (u *JwUser) GetDayfreeSelRpt(data DayfreeSelParam) (body string, err error)
- func (u *JwUser) GetJwTime() (jwTime JwTime, err error)
- func (u *JwUser) GetListXSRpt(stuID string) (body string, err error)
- func (u *JwUser) GetLookxlRpt() (body string, err error)
- func (u *JwUser) GetStuBYFAHJRpt() (body string, err error)
- func (u *JwUser) GetStuBYFAKCRpt() (body string, err error)
- func (u *JwUser) GetStuDJKSCJ() (body string, err error)
- func (u *JwUser) GetStuID(name string) (id string, err error)
- func (u *JwUser) GetStuMyInfoRpt() (body string, err error)
- func (u *JwUser) GetStuXKJGRpt() (body string, err error)
- func (u *JwUser) GetXscjbmLeftRpt(classID string, year uint, term uint, timeMode uint, isBX bool, isXX bool, ...) (body string, err error)
- func (u *JwUser) GetXscjbmRightRpt(classID string, year uint, term uint, timeMode uint, HidKC string, isBX bool, ...) (body string, err error)
- func (u *JwUser) GetXscjbmRpt(classID string, year uint, term uint, timeMode uint, isBX bool, isXX bool, ...) (body string, err error)
- func (u *JwUser) IsLogged() (isLogged bool)
- func (u *JwUser) Login() (err error)
- func (u *JwUser) LoginBySec() (err error)
- func (u *JwUser) SetPassword(password string) *JwUser
- func (u *JwUser) SetSelType(selType string) *JwUser
- func (u *JwUser) SetUrl(url *url.URL) *JwUser
- func (u *JwUser) SetUsername(username string) *JwUser
- func (u *JwUser) XscjbmLeftRptToHidKC(body string) string
Constants ¶
This section is empty.
Variables ¶
var ( // MianHost MianHost = "jw.sec.lit.edu.cn" // MianUrl 主网址 MianUrl = "http://" + MianHost // 120.194.42.205:9001 // DefaultPath 首页 DefaultPath = "/default.aspx" // LoginPath 登陆接口 LoginPath = "/_data/index_LOGIN.aspx" // MenuPath 菜单接口 MenuPath = "/frame/menu.aspx" // SysBannerPath 管理员菜单接口(通用) SysBannerPath = "/SYS/Main_banner.aspx" // StuMyInfoPath 学生学籍信息接口 StuMyInfoPath = "/xsxj/Stu_MyInfo_RPT.aspx" // StuZXJGPath 学生正选结果 StuZXJGPath = "/wsxk/stu_zxjg_rpt.aspx" // StuBYFAKCPath 学生理论课程结果 StuBYFAKCPath = "/jxjh/Stu_byfakc_rpt.aspx" // StuBYFAHJPath 学生实践环节结果 StuBYFAHJPath = "/jxjh/Stu_byfahj_rpt.aspx" // StuDJKSCJPath 学生等级成绩 StuDJKSCJPath = "/xscj/Stu_djkscj_rpt.aspx" // SysListXSPath 管理员查询学生姓名结果 SysListXSPath = "/XSCJ/Private/list_XS.aspx" // SysXSGRCJPath 管理员查询学生成绩结果 SysXSGRCJPath = "/XSCJ/f_xsgrcj_rpt.aspx" // SysZNPKDayfreeSelPath 管理员查询空教室结果 SysZNPKDayfreeSelPath = "/ZNPK/DayfreeSel_Rpt.aspx" // SysClassSelPath 管理员查询班级课表 SysClassSelPath = "/ZNPK/ClassSel_rpt.aspx" // ClassSelPath 公用课表接口 ClassSelPath = "/ZNPK/KBFB_ClassSel.aspx" // LoginBySecPath 智慧门户快速登陆 LoginBySecPath = "/cas_njjz.aspx" // XscjbmLeft 有效成绩排名 left SysXscjbmLeftPath = "/XSCJ/g_xscjbm_left.aspx" // SysXscjbmRightPath 有效成绩排名 right SysXscjbmRightPath = "/XSCJ/g_xscjbm_right.aspx" // LookxlRptPath 查看校历 LookxlRptPath = "/_data/index_Lookxl.aspx" // MAINFRMPath 主页 MAINFRMPath = "/MAINFRM.aspx" // UA UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36" // SchoolCode 院校代号 SchoolCode = "11070" // MainHeaders 主请求头 MainHeaders = map[string]string{ "dnt": "1", "x-requested-with": "XMLHttpRequest", "sec-ch-ua-mobile": "1", "User-Agent": UA, "sec-fetch-site": "same-origin", "sec-fetch-mode": "cors", "sec-fetch-dest": "empty", "Accept-Language": "zh-CN,zh;q=0.9", } // StuType 学生 StuType = "STU" // TeaType 教师教辅人员 TeaType = "TEA" // SysType 管理人员 SysType = "SYS" // AdmType 门户维护员 AdmType = "ADM" )
var ( // 王城 WangchengCampus uint = 1 // 开元 KaiyuanCampus uint = 2 // 九都 JiuduCampus uint = 3 )
Functions ¶
func BuildAirSchedule ¶
func BuildAirSchedule(raw []CourseInfo) (ret [20][7][5][]CourseInfo)
构建云小洛课表结构
Types ¶
type CourseInfo ¶
type CourseInfo struct { Day int `json:"day"` Titile string `json:"title"` Location string `json:"location"` Credit string `json:"credit"` Code string `json:"code"` Sections []int `json:"sections"` Start int `json:"start"` Duration int `json:"duration"` Teacher string `json:"teacher"` Weeks []int `json:"weeks"` Time string `json:"time"` }
课程信息
func XKJGRptToSchedule ¶
func XKJGRptToSchedule(body string) (courses []CourseInfo, err error)
XKJGRptToSchedule 正选结果解析为课程表结构
type DayfreeSelParam ¶
type JwTime ¶
type JwTime struct { Year uint `json:"year"` Term uint `json:"term"` Week uint `json:"week"` IsVacation bool `json:"is_vacation"` RawData string `json:"raw_data"` OnlineNum uint `json:"online_num"` Sub string `json:"sub"` }
JwTime 教务时间
type JwUser ¶
type JwUser struct { Username string Password string SelType string Url *url.URL IsBoundSec bool Client *resty.Client }
JwUser 教务在线结构体
func (*JwUser) BindSecUser ¶
BindSecUser 绑定智慧门户帐号
func (*JwUser) GetBannerRpt ¶
GetBannerRpt 获取主页顶部横幅原始数据
func (*JwUser) GetCXGRCJRpt ¶
func (u *JwUser) GetCXGRCJRpt(timeMode uint, mode uint, flag uint, year uint, term uint, stuID string) (body string, err error)
GetCXGRCJRpt 获取学生成绩 timeMode {0: 入学以来, 1: 按照学年, 2: 按照学期} mode {0: 原始成绩, 1: 有效成绩} flag {0: 主修, 1: 辅修}
func (*JwUser) GetClassID ¶
GetClassID 获取班级ID
func (*JwUser) GetClassSelPage ¶
GetClassSelRpt 获取公共班级课表页面
func (*JwUser) GetClassSelRpt ¶
GetClassSelRpt 获取班级课表
func (*JwUser) GetDayfreeSelRpt ¶
func (u *JwUser) GetDayfreeSelRpt(data DayfreeSelParam) (body string, err error)
获取空教室
func (*JwUser) GetListXSRpt ¶
GetListXSRpt 查询学生
func (*JwUser) GetLookxlRpt ¶
GetLookxlRpt 获取校历返回页面
func (*JwUser) GetStuBYFAHJRpt ¶
GetStuXKJGRpt 获取学生教学方案原始数据
func (*JwUser) GetStuBYFAKCRpt ¶
GetStuXKJGRpt 获取学生理论课程原始数据
func (*JwUser) GetStuDJKSCJ ¶
GetStuDJKSCJ 获取学生等级成绩
func (*JwUser) GetStuMyInfoRpt ¶
GetStuMyInfoRpt 获取学生学籍信息原数据
func (*JwUser) GetStuXKJGRpt ¶
GetStuXKJGRpt 获取学生正选结果原数据
func (*JwUser) GetXscjbmLeftRpt ¶
func (u *JwUser) GetXscjbmLeftRpt(classID string, year uint, term uint, timeMode uint, isBX bool, isXX bool, isRX bool, isHJ bool) (body string, err error)
GetXscjbmLeftRpt 有效成绩排名 left 结果 timeMode {0: 入学以来, 1: 按照学年, 2: 按照学期}
func (*JwUser) GetXscjbmRightRpt ¶
func (u *JwUser) GetXscjbmRightRpt(classID string, year uint, term uint, timeMode uint, HidKC string, isBX bool, isXX bool, isRX bool, isHJ bool) (body string, err error)
GetXscjbmRightRpt 有效成绩排名 right 最终结果 timeMode {0: 入学以来, 1: 按照学年, 2: 按照学期}
func (*JwUser) GetXscjbmRpt ¶
func (u *JwUser) GetXscjbmRpt(classID string, year uint, term uint, timeMode uint, isBX bool, isXX bool, isRX bool, isHJ bool) (body string, err error)
GetXscjbmRpt 有效成绩排名 最终结果 timeMode {0: 入学以来, 1: 按照学年, 2: 按照学期}
func (*JwUser) SetSelType ¶
SetSelType 设置登陆类型
// StuType 学生 StuType = "STU" // TeaType 教师教辅人员 TeaType = "TEA" // SysType 管理人员 SysType = "SYS" // AdmType 门户维护员 AdmType = "ADM"
func (*JwUser) SetUsername ¶
SetUsername 设置用户名
func (*JwUser) XscjbmLeftRptToHidKC ¶
成绩排名参数构造