lib

package
v0.0.0-...-8fdaee9 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: AGPL-3.0 Imports: 21 Imported by: 0

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 FillBlank

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

func FormatScore

func FormatScore(score Score) string

func FormatScoreShort

func FormatScoreShort(score Score) string

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 Study

func Study(core2 *Core, u *model.User)

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(id string, 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(pushID string) (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 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 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 SpecialContent

type SpecialContent struct {
	Perfect   bool `json:"perfect"`
	TotalTime int  `json:"totalTime"`
	Questions []struct {
		HasDescribe bool `json:"hasDescribe"`
		// 提示信息
		QuestionDesc string `json:"questionDesc"`
		QuestionId   int    `json:"questionId"`
		Origin       string `json:"origin"`
		// 答案
		Answers []struct {
			AnswerId int    `json:"answerId"`
			Label    string `json:"label"`
			Content  string `json:"content"`
		} `json:"answers"`
		QuestionScore int `json:"questionScore"`
		// 题目呢偶然
		Body               string `json:"body"`
		OriginTitle        string `json:"originTitle"`
		AllCorrect         bool   `json:"allCorrect"`
		Supplier           string `json:"supplier"`
		QuestionDescOrigin string `json:"questionDescOrigin"`
		QuestionDisplay    int    `json:"questionDisplay"`
		Recommender        string `json:"recommender"`
	} `json:"questions"`
	Type               int    `json:"type"`
	TotalScore         int    `json:"totalScore"`
	PassScore          int    `json:"passScore"`
	FinishedNum        int    `json:"finishedNum"`
	UsedTime           int    `json:"usedTime"`
	Name               string `json:"name"`
	QuestionNum        int    `json:"questionNum"`
	Id                 int    `json:"id"`
	UniqueId           string `json:"uniqueId"`
	TipScoreReasonType int    `json:"tipScoreReasonType"`
}

func GetSpecialContent

func GetSpecialContent(cookies []*http.Cookie, id int) *SpecialContent

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 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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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