yinghua

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AIProblemMessage

func AIProblemMessage(testPaperTitle string, examTopic YingHuaExamTopic) utils.AIChatMessages

组装AI问题消息

func CourseVideListApi

func CourseVideListApi(UserCache YingHuaUserCache, courseId string, retry int, lastError error) (string, error)

CourseVideListApi 对应课程的视屏列表

func ExamDetailApi

func ExamDetailApi(UserCache YingHuaUserCache, nodeId string, retryNum int, lastError error) (string, error)

ExamDetailApi 获取考试信息

func ExamFinallyDetailApi

func ExamFinallyDetailApi(userCache YingHuaUserCache, courseId, nodeId, workId string, retryNum int, lastError error) (string, error)

WorkedDetail 获取最后作业得分接口 {"_code":9,"status":false,"msg":"您已完成作业,该作业仅可答题1次","result":{}}

func GetExamTopicApi

func GetExamTopicApi(UserCache YingHuaUserCache, nodeId, examId string, retryNum int, lastError error) (string, error)

GetExamTopicApi 获取所有考试题目,但是HTML,建议配合TurnExamTopic函数使用将题目html转成结构体

func GetWorkApi

func GetWorkApi(UserCache YingHuaUserCache, nodeId, workId string, retryNum int, lastError error) (string, error)

GetWorkApi 获取所有作业题目

func KeepAliveApi

func KeepAliveApi(UserCache YingHuaUserCache) string

KeepAliveApi 登录心跳保活

func StartExam

func StartExam(userCache YingHuaUserCache, courseId, nodeId, examId string, retryNum int, lastError error) (string, error)

StartExam 开始考试接口 {"_code":9,"status":false,"msg":"考试测试时间还未开始","result":{}}

func StartWork

func StartWork(userCache YingHuaUserCache, courseId, nodeId, workId string, retryNum int, lastError error) (string, error)

StartWork 开始做作业接口 {"_code":9,"status":false,"msg":"您已完成作业,该作业仅可答题1次","result":{}}

func SubmitExamApi

func SubmitExamApi(UserCache YingHuaUserCache, examId, answerId string, answers YingHuaAnswer, finish string, retryNum int, lastError error) (string, error)

SubmitExamApi 提交考试答案接口

func SubmitStudyTimeApi

func SubmitStudyTimeApi(UserCache YingHuaUserCache, nodeId string, studyId string, studyTime int, retry int, lastError error) (string, error)

SubmitStudyTimeApi 提交学时

func SubmitWorkApi

func SubmitWorkApi(UserCache YingHuaUserCache, workId, answerId string, answers YingHuaAnswer, finish string, retryNum int, lastError error) (string, error)

SubmitWorkApi 提交作业答案接口

func VideStudyTimeApi

func VideStudyTimeApi(userEntity entity.UserEntity, nodeId string, retryNum int, lastError error) string

VideStudyTimeApi 获取单个视屏的学习进度

func VideWatchRecodeApi

func VideWatchRecodeApi(UserCache YingHuaUserCache, courseId string, page int, retry int, lastError error) (string, error)

VideWatchRecodeApi 获取指定课程视屏观看记录

func WorkDetailApi

func WorkDetailApi(userCache YingHuaUserCache, nodeId string, retryNum int, lastError error) (string, error)

WorkDetailApi 获取作业信息

func WorkedFinallyDetailApi

func WorkedFinallyDetailApi(userCache YingHuaUserCache, courseId, nodeId, workId string, retryNum int, lastError error) (string, error)

WorkedDetail 获取最后作业得分接口 {"_code":9,"status":false,"msg":"您已完成作业,该作业仅可答题1次","result":{}}

Types

type TopicSelect

type TopicSelect struct {
	Value string `json:"value"`
	Num   string `json:"num"`
	Text  string `json:"text"`
}

TopicSelect represents a possible answer choice

type YingHuaAnswer

type YingHuaAnswer struct {
	Type    string   //题目类型
	Answers []string //回答内容
}

type YingHuaExamTopic

type YingHuaExamTopic struct {
	AnswerId string        `json:"answerId"`
	Index    string        `json:"index"`
	Source   string        `json:"source"`
	Content  string        `json:"content"`
	Type     string        `json:"type"`
	Selects  []TopicSelect `json:"selects"`
	Answers  string        `json:"answers"`
}

ExamTopic represents a single exam question

type YingHuaExamTopics

type YingHuaExamTopics struct {
	YingHuaExamTopics map[string]YingHuaExamTopic
}

ExamTopics holds a map of ExamTopic indexed by answerId

func TurnExamTopic

func TurnExamTopic(examHtml string) YingHuaExamTopics

题目转换

type YingHuaUserCache

type YingHuaUserCache struct {
	PreUrl   string //前置url
	Account  string //账号
	Password string //用户密码
	// contains filtered or unexported fields
}

func (*YingHuaUserCache) CourseDetailApi

func (cache *YingHuaUserCache) CourseDetailApi(courseId string, retry int, lastError error) (string, error)

CourseDetailApi 获取课程详细信息API

func (*YingHuaUserCache) CourseListApi

func (cache *YingHuaUserCache) CourseListApi(retry int, lastError error) (string, error)

CourseListApi 拉取课程列表API

func (*YingHuaUserCache) GetCookie

func (cache *YingHuaUserCache) GetCookie() string

func (*YingHuaUserCache) GetSign

func (cache *YingHuaUserCache) GetSign() string

func (*YingHuaUserCache) GetToken

func (cache *YingHuaUserCache) GetToken() string

func (*YingHuaUserCache) GetVerCode

func (cache *YingHuaUserCache) GetVerCode() string

func (*YingHuaUserCache) LoginApi

func (cache *YingHuaUserCache) LoginApi(retry int, lastError error) (string, error)

LoginApi 登录接口

func (*YingHuaUserCache) SetCookie

func (cache *YingHuaUserCache) SetCookie(cookie string)

func (*YingHuaUserCache) SetSign

func (cache *YingHuaUserCache) SetSign(sign string)

func (*YingHuaUserCache) SetToken

func (cache *YingHuaUserCache) SetToken(token string)

func (*YingHuaUserCache) SetVerCode

func (cache *YingHuaUserCache) SetVerCode(verCode string)

func (*YingHuaUserCache) VerificationCodeApi

func (cache *YingHuaUserCache) VerificationCodeApi(retry int) (string, string)

Jump to

Keyboard shortcuts

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