jwmodel

package
v0.0.0-...-a336665 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 主机
	JwHost = "http://jwgl.ouc.edu.cn"
	// 数据页
	DataTable = JwHost + "/taglib/DataTable.jsp"
	// 登录
	Login = JwHost + "/cas/logon.action"
	// 验证码
	Captcha = JwHost + "/cas/genValidateCode"
	// 检查会话有效性
	OnlineMessage = JwHost + "/online/message"
	// 获取所有学科的专业的列表
	SpecialtyList = JwHost + "/frame/droplist/getDropLists.action"
	// 获取指定年级的专业信息
	GradeSpeciality = JwHost + "/jw/common/getStuGradeSpeciatyInfo.action"
	// 获取二维形式的课表
	HtmlTimeTable = JwHost + "/student/wsxk.zx.bykb.jsp"
	// 获取学生选课币使用情况
	Coin = JwHost + "/jw/common/getSelectLessonPointsInfo.action"
	// 检测是否可以重修某一门课
	RepeatCourse = JwHost + "/jw/common/isRepeatCourse.action"
	// 选课
	SaveCourse = JwHost + "/jw/common/saveElectiveCourse.action"
	// 选课前检验是否具有资格的接口
	ConfirmSelectable = JwHost + "/jw/common/isSelectableSkbjdm.action"
	// 删除已选课程
	CancelCourse = JwHost + "/jw/common/cancelElectiveCourse.action"
	// 加密参数接口
	KeyTimeParam = JwHost + "/custom/js/SetKingoEncypt.jsp"
	// 获取成绩接口
	Score = JwHost + "/student/xscj.stuckcj_data.jsp"
)
View Source
const RecognizeURL = "https://itstudio.club/ocr/jw"

识别验证码的接口

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptchaBody

type CaptchaBody struct {
	SpendTime int    `json:"spend_time(ms)"` // 识别耗费的时间 毫秒
	TimeStamp string `json:"Time"`           // 时间戳
	Value     string `json:"value"`          // 识别值
}

识别接口返回的body

type CoinStatus

type CoinStatus struct {
	Total float32 `json:"point_total"`   // 全部选课币
	Used  float32 `json:"point_used"`    // 已使用选课比
	Rest  float32 `json:"point_canused"` // 剩余选课币
}

type CourseScore

type CourseScore struct {
	CourseName string // 课程名
	Credit     string // 学分
	CourseType string // 课程类型
	Score      string // 成绩
	// contains filtered or unexported fields
}

type CreditRequire

type CreditRequire struct {
	CreditType string  // 学分类型,如 `专业知识/限选课`
	Credit     float64 // 这类课程总计所需的学分
}

毕业学分要求

type JwSession

type JwSession struct {
	UserCode   string `json:"UserCode"`     // 学号
	PassWord   string `json:"password"`     // 密码
	JSESSIONID string `json:"j_session_id"` // 教务会话ID
}

教务会话

func NewSession

func NewSession() *JwSession

创建新会话

func (*JwSession) CanRetake

func (session *JwSession) CanRetake(classCode string) (bool, error)

判断学生是否可以重修某门课程 @param classCode 课程代码

func (*JwSession) Do

func (session *JwSession) Do(f func(req *fasthttp.Request, resp *fasthttp.Response))

添加教务会话cookie,

func (*JwSession) GetCoinStatus

func (session *JwSession) GetCoinStatus(year, semester int) (*CoinStatus, error)

获取指定学年学期的选课币使用情况

func (*JwSession) GetCreditRequire

func (session *JwSession) GetCreditRequire() ([]CreditRequire, error)

获取毕业要求的每类课程所需的学分

func (*JwSession) GetHtmlStuCourse

func (session *JwSession) GetHtmlStuCourse(year, semester int) (string, error)

获取二维html格式课程表

func (*JwSession) GetInfo

func (session *JwSession) GetInfo() (*Student, error)

获取个人年级、专业信息

func (*JwSession) GetKeyParam

func (session *JwSession) GetKeyParam() (*KeyParam, error)

获取加密参数

func (*JwSession) GetScores

func (session *JwSession) GetScores() ([]CourseScore, error)

func (*JwSession) GetStuCourse

func (session *JwSession) GetStuCourse(year, semester int) ([]StuCourse, error)

根据学年、学期获得该学年、学期的选课记录

func (*JwSession) Login

func (session *JwSession) Login(userCode, passWord string) (bool, error)

登录教务系统

func (*JwSession) Validate

func (session *JwSession) Validate() bool

验证会话有效性

type KeyParam

type KeyParam struct {
	Key  string
	Time string
}

教务系统的加密参数 部分请求需要加密参数

type Specialty

type Specialty struct {
	// contains filtered or unexported fields
}

func GetSpecialties

func GetSpecialties(year int) ([]Specialty, error)

获取指定年份的专业列表

type StuCourse

type StuCourse struct {
	// contains filtered or unexported fields
}

type Student

type Student struct {
	UserCode      string // 学号
	Grade         string // 年级
	Specialty     string // 专业名称
	SpecialtyCode string // 专业代码
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL