lib

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 34 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MyPointsUri = "https://pc.xuexi.cn/points/my-points.html"

	DailyBUTTON = `` /* 151-byte string literal not displayed */

	WEEKEND = `` /* 151-byte string literal not displayed */

	SPECIALBUTTON = `` /* 152-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func CheckUserCookie

func CheckUserCookie(user *model.User) bool

CheckUserCookie *

  • @Description: 获取用户成绩
  • @param user
  • @return bool

func Clip

func Clip(in io.Reader, out io.Writer, wi, hi, x0, y0, x1, y1, quality int) (err error)

Clip * 图片裁剪 * 入参:图片输入、输出、缩略图宽、缩略图高、Rectangle{Pt(x0, y0), Pt(x1, y1)},精度 * 规则:如果精度为0则精度保持不变 * * 返回:error */

func FillBlank

func FillBlank(page playwright.Page, tips []string) error

func FormatScore

func FormatScore(score Score) string

func GetPaymentStr

func GetPaymentStr(fi io.Reader) (paymentCodeUrl *gozxing.Result)

func GetToken

func GetToken(code, sign, pushId string) (bool, error)

func GetUserInfo

func GetUserInfo(cookies []*http.Cookie) (string, string, error)

GetUserInfo *

  • @Description: 获取用户信息
  • @param cookies
  • @return string
  • @return string
  • @return error

func PrintScore

func PrintScore(score Score) string

func RemoveRepByLoop

func RemoveRepByLoop(slc []string) []string

RemoveRepByLoop 通过两重循环过滤重复元素

func WaitStudy

func WaitStudy(user *model.User, id string)

Types

type Cookie struct {
	Name     string `json:"name" yaml:"name"`
	Value    string `json:"value" yaml:"value"`
	Domain   string `json:"domain" yaml:"domain"`
	Path     string `json:"path" yaml:"path"`
	Expires  int    `json:"expires" yaml:"expires"`
	HTTPOnly bool   `json:"httpOnly" yaml:"http_only"`
	Secure   bool   `json:"secure" yaml:"secure"`
	SameSite string `json:"same_site" yaml:"same_site"`
}

Cookie @Description:

type Core

type Core struct {
	ShowBrowser bool
	Push        func(kind string, message string)
	// contains filtered or unexported fields
}

Core @Description:

func (*Core) CheckQrCode

func (c *Core) CheckQrCode(code, pushID string) (*model.User, bool, error)

func (*Core) GenerateCode

func (c *Core) GenerateCode() (string, string, error)

GenerateCode

@Description: 生成二维码
* @receiver c
* @return string 二维码连接
* @return string 二维码回调查询的code
* @return error

func (*Core) Init

func (c *Core) Init()

Init *

  • @Description:
  • @receiver c

func (*Core) IsQuit

func (c *Core) IsQuit() bool

func (*Core) L

func (c *Core) L(retryTimes int, pushID string) (*model.User, error)

L *

  • @Description:
  • @receiver c
  • @return *model.User
  • @return error

func (*Core) LearnArticle

func (c *Core) LearnArticle(user *model.User)

LearnArticle *

  • @Description: 文章学习
  • @receiver c
  • @param cookies

func (*Core) LearnVideo

func (c *Core) LearnVideo(user *model.User)

LearnVideo *

  • @Description: 视频学习
  • @receiver c
  • @param cookies

func (*Core) Quit

func (c *Core) Quit()

func (*Core) RespondDaily

func (c *Core) RespondDaily(user *model.User, model string)

RespondDaily

@Description:
* @receiver c
* @param user
* @param model

type Data

type Data struct {
	CurrentScore int `json:"current_score"`
	MaxScore     int `json:"max_score"`
}

type Handle

type Handle interface {
	// contains filtered or unexported methods
}
type Link struct {
	Editor       string   `json:"editor"`
	PublishTime  string   `json:"publishTime"`
	ItemType     string   `json:"itemType"`
	Author       string   `json:"author"`
	CrossTime    int      `json:"crossTime"`
	Source       string   `json:"source"`
	NameB        string   `json:"nameB"`
	Title        string   `json:"title"`
	Type         string   `json:"type"`
	Url          string   `json:"url"`
	ShowSource   string   `json:"showSource"`
	ItemId       string   `json:"itemId"`
	ThumbImage   string   `json:"thumbImage"`
	AuditTime    string   `json:"auditTime"`
	ChannelNames []string `json:"channelNames"`
	Producer     string   `json:"producer"`
	ChannelIds   []string `json:"channelIds"`
	DataValid    bool     `json:"dataValid"`
}

type Mather

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

type Score

type Score struct {
	TotalScore int             `json:"total_score"`
	TodayScore int             `json:"today_score"`
	Content    map[string]Data `json:"content"`
}

func GetUserScore

func GetUserScore(cookies []*http.Cookie) (Score, error)

type SpecialList

type SpecialList struct {
	PageNo         int `json:"pageNo"`
	PageSize       int `json:"pageSize"`
	TotalPageCount int `json:"totalPageCount"`
	TotalCount     int `json:"totalCount"`
	List           []struct {
		TipScore    float64 `json:"tipScore"`
		EndDate     string  `json:"endDate"`
		Achievement struct {
			Score   int `json:"score"`
			Total   int `json:"total"`
			Correct int `json:"correct"`
		} `json:"achievement"`
		Year             int    `json:"year"`
		SeeSolution      bool   `json:"seeSolution"`
		Score            int    `json:"score"`
		ExamScoreId      int    `json:"examScoreId"`
		UsedTime         int    `json:"usedTime"`
		Overdue          bool   `json:"overdue"`
		Month            int    `json:"month"`
		Name             string `json:"name"`
		QuestionNum      int    `json:"questionNum"`
		AlreadyAnswerNum int    `json:"alreadyAnswerNum"`
		StartTime        string `json:"startTime"`
		Id               int    `json:"id"`
		ExamTime         int    `json:"examTime"`
		Forever          int    `json:"forever"`
		StartDate        string `json:"startDate"`
		Status           int    `json:"status"`
	} `json:"list"`
	PageNum int `json:"pageNum"`
}

type T

type T struct {
	Question    string      `json:"question"`
	Answer      string      `json:"answer"`
	WrongAnswer string      `json:"wrongAnswer"`
	Option      string      `json:"option"`
	Datetime    interface{} `json:"datetime"`
}

type Telegram

type Telegram struct {
	Token  string
	ChatId int64

	Proxy string
	// contains filtered or unexported fields
}

Telegram @Description:

func (*Telegram) Init

func (t *Telegram) Init()

Init *

  • @Description:
  • @receiver t
  • @return func(kind string, message string)

func (*Telegram) SendMsg

func (t *Telegram) SendMsg(message string) int

func (*Telegram) SendPhoto

func (t *Telegram) SendPhoto(image []byte)

type WeekList

type WeekList struct {
	PageNo         int `json:"pageNo"`
	PageSize       int `json:"pageSize"`
	TotalPageCount int `json:"totalPageCount"`
	TotalCount     int `json:"totalCount"`
	List           []struct {
		Month     string `json:"month"`
		Practices []struct {
			SeeSolution bool    `json:"seeSolution"`
			TipScore    float64 `json:"tipScore"`
			ExamScoreId int     `json:"examScoreId"`
			Overdue     bool    `json:"overdue"`
			Achievement struct {
				Total   int `json:"total"`
				Correct int `json:"correct"`
			} `json:"achievement"`
			Name               string `json:"name"`
			BeginYear          int    `json:"beginYear"`
			StartTime          string `json:"startTime"`
			Id                 int    `json:"id"`
			BeginMonth         int    `json:"beginMonth"`
			Status             int    `json:"status"`
			TipScoreReasonType int    `json:"tipScoreReasonType"`
		} `json:"practices"`
	} `json:"list"`
	PageNum int `json:"pageNum"`
}

Jump to

Keyboard shortcuts

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