xuexitong

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PageMobileChapterCardAction added in v1.0.6

func PageMobileChapterCardAction(
	cache *xuexitong.XueXiTUserCache,
	classId, courseId, knowledgeId, cardIndex, cpi int) (interface{}, error)

func ParseWorkQuestionAction added in v1.1.2

func ParseWorkQuestionAction(cache *xuexitong.XueXiTUserCache, workPoint *entity.PointWorkDto)

ParseWorkQuestionAction 用于解析作业题目,包括题目类型和题目文本

func VideoDtoFetchAction added in v1.0.7

func VideoDtoFetchAction(cache *xuexitong.XueXiTUserCache, p *entity.PointVideoDto) (bool, error)

func WorkPageFromAction added in v1.1.2

func WorkPageFromAction(cache *xuexitong.XueXiTUserCache, workPoint *entity.PointWorkDto) ([]entity.WorkInputField, error)

func XueXiTLoginAction

func XueXiTLoginAction(cache *xuexitong.XueXiTUserCache) error

Types

type APIError

type APIError struct {
	Message string
}

APIError 是 API 相关错误的一般错误 这里之后统一做整合

func (APIError) Error added in v1.0.6

func (e APIError) Error() string

type APIResponse

type APIResponse struct {
	Data []DataItem `json:"data"`
}

APIResponse 代表API返回的完整JSON结构

type Card

type Card struct {
	ID          int    `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description"`
	CardOrder   int    `json:"cardorder"`
	KnowledgeID int    `json:"knowledgeid"`
}

Card 代表卡片信息

func ChapterFetchCardsAction

func ChapterFetchCardsAction(
	cache *xuexitong.XueXiTUserCache,
	chapters *ChaptersList,
	nodes []int,
	index, courseId, classId, cpi int) ([]Card, []entity.PointDto, error)

type ChapterNotOpened added in v1.0.6

type ChapterNotOpened struct{}

ChapterNotOpened 是未打开章节时的错误类型

func (ChapterNotOpened) Error added in v1.0.6

func (e ChapterNotOpened) Error() string

type ChapterPointDTO

type ChapterPointDTO map[string]struct {
	ClickCount    int `json:"clickcount"`    // 是否还有节点
	FinishCount   int `json:"finishcount"`   // 已完成节点
	TotalCount    int `json:"totalcount"`    // 总节点
	OpenLock      int `json:"openlock"`      // 是否有锁
	UnFinishCount int `json:"unfinishcount"` // 未完成节点
}

type ChaptersList

type ChaptersList struct {
	ChatID    string          `json:"chatid"`
	Knowledge []KnowledgeItem `json:"knowledge"`
}

func ChapterFetchPointAction

func ChapterFetchPointAction(cache *xuexitong.XueXiTUserCache,
	nodes []int,
	chapters *ChaptersList,
	clazzID, userID, cpi, courseID int,
) (ChaptersList, error)

ChapterFetchPointAction 对应章节的作业点信息 刷新KnowledgeItem中对应节点完成状态

func PullCourseChapterAction

func PullCourseChapterAction(cache *xuexitong.XueXiTUserCache, cpi, key int) (chaptersList ChaptersList, ok bool, err error)

PullCourseChapterAction 获取对应课程的章节信息包括节点信息

type ChoiceQue added in v1.1.2

type ChoiceQue struct {
	Type ctype.QueType
	Text string
	// contains filtered or unexported fields
}

type DataItem

type DataItem struct {
	ClickCount     int    `json:"clickcount"`
	Createtime     int64  `json:"createtime"`
	OpenLock       int    `json:"openlock"`
	IndexOrder     int    `json:"indexorder"`
	Name           string `json:"name"`
	LastModifyTime int64  `json:"lastmodifytime"`
	ID             int    `json:"id"`
	Label          string `json:"label"`
	Layer          int    `json:"layer"`
	Card           struct {
		Data []Card `json:"data"`
	} `json:"card"`
	ParentNodeID int    `json:"parentnodeid"`
	Status       string `json:"status"`
}

DataItem 代表data数组中的每个项目

type IframeAttributes

type IframeAttributes struct {
	Data    map[string]interface{} `json:"data"`
	Other   map[string]string
	HasData bool // 表示data属性是否存在且非空
}

IframeAttributes iframe 的属性

type KnowledgeItem

type KnowledgeItem struct {
	JobCount      int           `json:"jobcount"` // 作业数量
	IsReview      int           `json:"isreview"` // 是否为复习
	Attachment    []interface{} `json:"attachment"`
	IndexOrder    int           `json:"indexorder"` // 节点顺序
	Name          string        `json:"name"`       // 章节名称
	ID            int           `json:"id"`
	Label         string        `json:"label"`        // 节点标签
	Layer         int           `json:"layer"`        // 节点层级
	ParentNodeID  int           `json:"parentnodeid"` // 父节点 ID
	Status        string        `json:"status"`       // 节点状态
	PointTotal    int
	PointFinished int
}

KnowledgeItem 结构体用于存储 knowledge 中的每个项目

type XueXiTCourse added in v1.1.7

type XueXiTCourse struct {
	Cpi           int    `json:"cpi"`      // 用户唯一标识
	Key           string `json:"key"`      // classID 在课程API中为key
	CourseID      string `json:"courseId"` // 课程ID
	ChatID        string `json:"chatId"`
	CourseTeacher string `json:"courseTeacher"` // 课程老师
	CourseName    string `json:"courseName"`    //课程名
	// 两个标识 暂时不知道有什么用
	CourseDataID int `json:"courseDataId"`
	ContentID    int `json:"ContentID"`
}

func XueXiTPullCourseAction

func XueXiTPullCourseAction(cache *xuexitong.XueXiTUserCache) ([]XueXiTCourse, error)

拉取学习通所有课程列表并返回

func (*XueXiTCourse) ToString added in v1.1.7

func (x *XueXiTCourse) ToString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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