phy

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: MIT Imports: 10 Imported by: 0

README

phy 物理省实验平台

本地测试

在 phy/ 下新建 .env,并填入以下内容:

TOKEN=your_yunma_token  # 云码的账号 token
STUDENTID=your_username # 学号
PASSWORD=your_password  # 省实验平台的密码

注: phy可能灵活关闭,需要留意由此导致的 404

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CourseId          = "325"
	SemesterNo        = "202220231"
	QueryExperimentId = "-1"
)
View Source
var (
	ErrBeforeLogin  = errors.New("before login")
	ErrNoJSessionId = errors.New("JSessionId is needed")
)

Functions

This section is empty.

Types

type ExperSche

type ExperSche struct {
	QueryWeekDayFlag int64        `json:"queryWeekDayFlag"`
	Experiments      []Experiment `json:"experiments"`
}

type Experiment

type Experiment struct {
	Selected bool   `json:"selected"`
	Value    int64  `json:"value"`
	Text     string `json:"text"`
}

type User added in v0.1.1

type User struct {
	SessionId string
}

func Login

func Login(studentId, password string) (*User, error)

Login 用于登录省物理实验平台,入参为学号和物理实验平台的密码

func (*User) GetExperimentSche added in v0.1.1

func (u *User) GetExperimentSche() (*ExperSche, error)

GetExperimentSche 返回所有实验安排

Jump to

Keyboard shortcuts

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