xuexitong

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 13 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 XueXiTCourseDetailForCourseIdAction

func XueXiTCourseDetailForCourseIdAction(cache *xuexitong.XueXiTUserCache, courseId string) (entity.XueXiTCourse, error)

XueXiTCourseDetailForCourseIdAction 根据课程ID拉取学习课程详细信息

func XueXiTLoginAction

func XueXiTLoginAction(cache *xuexitong.XueXiTUserCache) error

func XueXiTPullCourseAction

func XueXiTPullCourseAction(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, error)

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

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 中的每个项目

Jump to

Keyboard shortcuts

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