xuexitong

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiLoginWeb = "https://passport2.chaoxing.com/fanyalogin"

	ApiPullCourses = "https://mooc1-api.chaoxing.com/mycourse/backclazzdata"

	// ApiChapterPoint 接口-课程章节任务点状态
	ApiChapterPoint = "https://mooc1-api.chaoxing.com/job/myjobsnodesmap"
	ApiChapterCards = "https://mooc1-api.chaoxing.com/gas/knowledge"
	ApiPullChapter  = "https://mooc1-api.chaoxing.com/gas/clazz"

	// PageMobileChapterCard SSR页面-客户端章节任务卡片
	PageMobileChapterCard = "https://mooc1-api.chaoxing.com/knowledge/cards"

	// APIChapterCardResource 接口-课程章节卡片资源
	APIChapterCardResource = "https://mooc1-api.chaoxing.com/ananas/status"
	// APIVideoPlayReport 接口-视频播放上报
	APIVideoPlayReport = "https://mooc1.chaoxing.com/mooc-ans/multimedia/log/a"

	KEY = "u2oh6Vu^HWe4_AES" // 注意 Go 语言中字符串默认就是 UTF-8 编码
)

注意Api类文件主需要写最原始的接口请求和最后的json的string形式返回,不需要用结构体序列化。 序列化和具体的功能实现请移步到Action代码文件中

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Message string
}

func (*APIError) Error

func (e *APIError) Error() string

type XueXiTUserCache

type XueXiTUserCache struct {
	Name        string //用户使用Phone
	Password    string //用户密码
	JsonContent map[string]interface{}
	// contains filtered or unexported fields
}

func (*XueXiTUserCache) CourseListApi

func (cache *XueXiTUserCache) CourseListApi() (string, error)

CourseListApi 拉取对应账号的课程数据

func (*XueXiTUserCache) FetchChapterCords

func (cache *XueXiTUserCache) FetchChapterCords(nodes []int, index, courseId int) (string, error)

FetchChapterCords 以课程序号拉取对应“章节”的任务节点卡片资源 Args:

nodes: 任务点集合 , index: 任务点索引

func (*XueXiTUserCache) FetchChapterPointStatus

func (cache *XueXiTUserCache) FetchChapterPointStatus(nodes []int, clazzID, userID, cpi, courseID int) (string, error)

FetchChapterPointStatus 章节状态 nodes 各章节对应ID

func (*XueXiTUserCache) GetCookie

func (cache *XueXiTUserCache) GetCookie() string

func (*XueXiTUserCache) LoginApi

func (cache *XueXiTUserCache) LoginApi() (string, error)

LoginApi 登录Api

func (*XueXiTUserCache) PageMobileChapterCard added in v1.0.6

func (cache *XueXiTUserCache) PageMobileChapterCard(
	classId, courseId, knowledgeId, cardIndex, cpi int) (string, error)

PageMobileChapterCard 客户端章节任务卡片 原始html数据返回

func (*XueXiTUserCache) PullChapter

func (cache *XueXiTUserCache) PullChapter(cpi int, key int) (string, error)

PullChapter ??????????cpi ?key ?? ???? cpi ? key ?? ????json?????? int TODO???? int ???????? ?Course???????? ? ?action?????XueXiTCourseDetailForCourseIdAction???? ???

func (*XueXiTUserCache) VerificationCodeApi

func (cache *XueXiTUserCache) VerificationCodeApi() (string, string)

VerificationCodeApi 获取验证码和SESSION验证码,并返回文件路径和SESSION字符串

func (*XueXiTUserCache) VideoDtoFetch added in v1.0.6

func (cache *XueXiTUserCache) VideoDtoFetch(p *entity.PointVideoDto) (string, error)

func (*XueXiTUserCache) VideoDtoPlayReport added in v1.0.7

func (cache *XueXiTUserCache) VideoDtoPlayReport(p *entity.PointVideoDto, playingTime int) (string, error)

Jump to

Keyboard shortcuts

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