api

package
v0.0.0-...-95a90c7 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyURL           = "xtgl/login_getPublicKey.html"
	LoginURL         = "xtgl/login_slogin.html"
	KaptchaURL       = "kaptcha"
	InfoURL1         = "xsxxxggl/xsxxwh_cxCkDgxsxx.html"
	InfoURL2         = "xsxxxggl/xsgrxxwh_cxXsgrxx.html"
	ExtraInfoURL     = "xszbbgl/xszbbgl_cxXszbbsqIndex.html?doType=details&gnmkdm=N106005"
	GradeURL         = "cjcx/cjcx_cxDgXscj.html?doType=query&gnmkdm=N305005"
	PersonalGradeURL = "cjcx/cjcx_cxXsgrcj.html?doType=query&gnmkdm=N305005"
	ScheduleURL      = "kbcx/xskbcx_cxXsKb.html?gnmkdm=N2151"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ClientOptions

	Cookies []*http.Cookie    // cookies to be used for the requests
	Headers map[string]string // headers to be used for the requests
	Timeout int               // timeout for the requests
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options ClientOptions, cookies []*http.Cookie, timeout int) *Client

func (*Client) Get

func (c *Client) Get(url string, query map[string]string) (resp *resty.Response, err error)

func (*Client) Grade

func (c *Client) Grade(year int, term int, usePersonalGrade bool) (models.Result, error)

func (*Client) Info

func (c *Client) Info() (models.Result, error)

func (*Client) Login

func (c *Client) Login(sid string, password string) (models.Result, error)

func (*Client) LoginWithKaptcha

func (c *Client) LoginWithKaptcha(loginKaptcha models.LoginKaptcha, password string, kaptcha string) (models.Result, error)

func (*Client) Post

func (c *Client) Post(url string, data map[string]string, noRedirect bool) (resp *resty.Response, err error)

func (*Client) Schedule

func (c *Client) Schedule(year int, term int) (models.Result, error)

type ClientOptions

type ClientOptions struct {
	BaseURL string // base url of the api

}

Jump to

Keyboard shortcuts

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