entity

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAIAnswer added in v1.4.9

func GetAIAnswer(as AnswerSetter, userID string, url, model string, aiType ctype.AiType, aiChatMessages aiq.AIChatMessages, apiKey string)

func GroupPointDtos added in v1.7.8

func GroupPointDtos[T IPointDto](pointDTOs []PointDto, predicate func(T) bool) []T

func ParsePointDto added in v1.0.9

func ParsePointDto(pointDTOs []PointDto) (videoDTOs []PointVideoDto, workDTOs []PointWorkDto, documentDTOs []PointDocumentDto)

Types

type Account added in v1.0.6

type Account struct {
	PUID string
}

type AnswerSetter added in v1.4.9

type AnswerSetter interface {
	SetAnswers([]string)
}

type ChannelItem

type ChannelItem struct {
	Cfid     int    `json:"cfid"`
	Norder   int    `json:"norder"`
	CataName string `json:"cataName"`
	Cataid   string `json:"cataid"`
	Id       int    `json:"id"`
	Cpi      int    `json:"cpi"`
	Key      any    `json:"key"`
	Content  struct {
		Studentcount int    `json:"studentcount"`
		Chatid       string `json:"chatid"`
		IsFiled      int    `json:"isFiled"`
		Isthirdaq    int    `json:"isthirdaq"`
		Isstart      bool   `json:"isstart"`
		Isretire     int    `json:"isretire"`
		Name         string `json:"name"`
		Course       struct {
			Data []struct {
				BelongSchoolId     string `json:"belongSchoolId"`
				Coursestate        int    `json:"coursestate"`
				Teacherfactor      string `json:"teacherfactor"`
				IsCourseSquare     int    `json:"isCourseSquare"`
				Schools            string `json:"schools"`
				CourseSquareUrl    string `json:"courseSquareUrl"`
				Imageurl           string `json:"imageurl"`
				AppInfo            string `json:"appInfo"`
				Name               string `json:"name"`
				DefaultShowCatalog int    `json:"defaultShowCatalog"`
				Id                 int    `json:"id"`
				AppData            int    `json:"appData"`
			} `json:"data"`
		} `json:"course"`
		Roletype int    `json:"roletype"`
		Id       int    `json:"id"`
		State    int    `json:"state"`
		Cpi      int    `json:"cpi"`
		Bbsid    string `json:"bbsid"`
		IsSquare int    `json:"isSquare"`
	} `json:"content"`
	Topsign int `json:"topsign"`
}

ChannelItem 课程列表

type ChoiceQue added in v1.3.0

type ChoiceQue struct {
	Type    qtype.QueType
	Qid     string //题目ID
	Text    string
	Options map[string]string
	Answers []string // 答案
}

ChoiceQue 选择类型

func (*ChoiceQue) AnswerAIGet added in v1.3.0

func (q *ChoiceQue) AnswerAIGet(userID,
	url, model string, aiType ctype.AiType, aiChatMessages aiq.AIChatMessages, apiKey string)

AnswerAIGet ChoiceQue的AI回答获取方法

func (*ChoiceQue) SetAnswers added in v1.4.9

func (q *ChoiceQue) SetAnswers(answers []string)

type ExamTurn added in v1.3.0

type ExamTurn struct {
	XueXChoiceQue ChoiceQue
	XueXJudgeQue  JudgeQue
	XueXFillQue   FillQue
	XueXShortQue  ShortQue
	YingHuaExamTopic
}

type FillQue added in v1.4.5

type FillQue struct {
	Type         qtype.QueType
	Qid          string
	Text         string
	OpFromAnswer map[string][]string // 位置与答案
}

FillQue 填空类型

func (*FillQue) AnswerAIGet added in v1.4.9

func (q *FillQue) AnswerAIGet(userID,
	url, model string, aiType ctype.AiType, aiChatMessages aiq.AIChatMessages, apiKey string)

AnswerAIGet FillQue的AI回答获取方法

func (*FillQue) SetAnswers added in v1.4.9

func (q *FillQue) SetAnswers(answers []string)

type IAttachment added in v1.0.6

type IAttachment interface {
	AttachmentsDetection(attachment interface{}) (bool, error)
}

type IPointDto added in v1.7.8

type IPointDto interface {
	GetType() ctype.CardType
	IsSetted() bool
}

type JudgeQue added in v1.4.2

type JudgeQue struct {
	Type    qtype.QueType
	Qid     string //题目ID
	Text    string
	Options map[string]string
	Answers []string // 答案
}

JudgeQue 判断类型

func (*JudgeQue) AnswerAIGet added in v1.4.9

func (q *JudgeQue) AnswerAIGet(userID,
	url, model string, aiType ctype.AiType, aiChatMessages aiq.AIChatMessages, apiKey string)

AnswerAIGet JudgeQue的AI回答获取方法

func (*JudgeQue) SetAnswers added in v1.4.9

func (q *JudgeQue) SetAnswers(answers []string)

type PointDocumentDto added in v1.0.6

type PointDocumentDto struct {
	CardIndex   int
	CourseID    string
	ClassID     string
	KnowledgeID int
	Cpi         string

	ObjectID string
	Title    string
	JobID    string
	Jtoken   string

	Type  ctype.CardType
	IsSet bool
}

PointDocumentDto 文档查看任务点

func (*PointDocumentDto) AttachmentsDetection added in v1.2.0

func (p *PointDocumentDto) AttachmentsDetection(attachment interface{}) (bool, error)

func (PointDocumentDto) GetType added in v1.7.8

func (d PointDocumentDto) GetType() ctype.CardType

func (PointDocumentDto) IsSetted added in v1.7.8

func (d PointDocumentDto) IsSetted() bool

type PointDto added in v1.0.6

type PointDto struct {
	PointVideoDto
	PointWorkDto
	PointDocumentDto
}

func (*PointDto) All added in v1.7.8

func (p *PointDto) All() iter.Seq[IPointDto]

All 返回一个迭代器,依次迭代 PointDto 中的各个 DTO

type PointVideoDto added in v1.0.6

type PointVideoDto struct {
	CardIndex   int
	CourseID    string
	ClassID     string
	KnowledgeID int
	Cpi         string
	ObjectID    string
	// 从SSR视图中获取
	IsPassed            bool
	FID                 int
	DToken              string
	PlayTime            int
	Duration            int
	JobID               string
	OtherInfo           string
	Title               string
	RT                  float64
	VideoFaceCaptureEnc string
	RandomCaptureTime   string //大概的下次人脸时间
	AttDurationEnc      string
	Enc                 string
	Logger              *log.Logger
	PUID                string
	Mid                 string
	Session             *Session

	Type  ctype.CardType
	IsSet bool

	Attachment interface{} //视图获取后的原始map
}

PointVideoDto 视频任务点

func (*PointVideoDto) AttachmentsDetection added in v1.0.6

func (p *PointVideoDto) AttachmentsDetection(attachment interface{}) (bool, error)

AttachmentsDetection 使用接口对每种DTO进行检测再次赋值, 以对应后续的刷取请求

func (PointVideoDto) GetType added in v1.7.8

func (v PointVideoDto) GetType() ctype.CardType

func (PointVideoDto) IsSetted added in v1.7.8

func (v PointVideoDto) IsSetted() bool

type PointWorkDto added in v1.0.6

type PointWorkDto struct {
	CardIndex   int
	CourseID    string
	ClassID     string
	KnowledgeID int
	Cpi         string
	WorkID      string
	SchoolID    string
	JobID       string
	PUID        string
	KToken      string
	Enc         string

	Type  ctype.CardType
	IsSet bool
}

PointWorkDto 测验任务点

func (*PointWorkDto) AttachmentsDetection added in v1.0.9

func (p *PointWorkDto) AttachmentsDetection(attachment interface{}) (bool, error)

func (PointWorkDto) GetType added in v1.7.8

func (w PointWorkDto) GetType() ctype.CardType

func (PointWorkDto) IsSetted added in v1.7.8

func (w PointWorkDto) IsSetted() bool

type Question added in v1.3.0

type Question struct {
	Title            string //试卷标题
	Cpi              string
	JobId            string
	WorkId           string
	ClassId          string
	CourseId         string
	Ua               string
	FormType         string
	SaveStatus       string
	Version          string
	Tempsave         string
	PyFlag           string
	UserId           string
	Knowledgeid      string
	OldWorkId        string //最原始作业id
	FullScore        string //满分是多少
	OldSchoolId      string //原始作业单位id
	Api              string //api值
	WorkRelationId   string
	Enc_work         string
	Isphone          string
	RandomOptions    string
	WorkAnswerId     string
	AnswerId         string
	TotalQuestionNum string
	Choice           []ChoiceQue //选择类型
	Judge            []JudgeQue  //判断类型
	Fill             []FillQue   //填空类型
	Short            []ShortQue  //简答类型
}

Question TODO 这里考虑是否在其中直接将答案做出 直接上报提交 或 保存提交

type Session added in v1.0.6

type Session struct {
	Client *http.Client
	Acc    *Account
}

type ShortQue added in v1.6.1

type ShortQue struct {
	Type         qtype.QueType
	Qid          string
	Text         string
	OpFromAnswer map[string][]string
}

简答类型

func (*ShortQue) AnswerAIGet added in v1.6.1

func (q *ShortQue) AnswerAIGet(userID,
	url, model string, aiType ctype.AiType, aiChatMessages aiq.AIChatMessages, apiKey string)

AnswerAIGet ShortQue的AI回答获取方法

func (*ShortQue) SetAnswers added in v1.6.1

func (q *ShortQue) SetAnswers(answers []string)

type UserEntity

type UserEntity struct {
	PreUrl   string //前置url
	Account  string //账号
	Password string //用户密码
	VerCode  string //验证码
	Cookie   string //验证码用的session
	Token    string //保持会话的Token
}

type WorkInputField added in v1.1.2

type WorkInputField struct {
	Name  string
	Value string
	Type  string // Optional: to store the type attribute if needed
	ID    string // Store the id attribute if present
}

WorkInputField represents an <input> element in the HTML form.

type XueXiTCourse

type XueXiTCourse struct {
	CourseName string //课程名称
	ClassId    string //classId
	CourseId   string //课程Id
	Cpi        string //不知道是啥玩意,反正需要
	PersonId   string //个人Id
	UserId     string //UserId
}

XueXiTCourse 关键信息过滤截取最终的实体

type XueXiTCourseJson

type XueXiTCourseJson struct {
	Result           int           `json:"result"`
	Msg              string        `json:"msg"`
	ChannelList      []ChannelItem `json:"channelList"`
	Mcode            string        `json:"mcode"`
	Createcourse     int           `json:"createcoursed"`
	TeacherEndCourse int           `json:"teacherEndCourse"`
	ShowEndCourse    int           `json:"showEndCourse"`
	HasMore          bool          `json:"hasMore"`
	StuEndCourse     int           `json:"stuEndCourse"`
}

XueXiTCourse 课程所有信息

type YingHuaExamTopic added in v1.3.0

type YingHuaExamTopic struct {
	AnswerId string `json:"answerId"`
	Index    string `json:"index"`
	Source   string `json:"source"`
	qentity.Question
}

ExamTopic represents a single exam question

type YingHuaExamTopics added in v1.3.0

type YingHuaExamTopics struct {
	YingHuaExamTopics map[string]YingHuaExamTopic
}

ExamTopics holds a map of ExamTopic indexed by answerId

Jump to

Keyboard shortcuts

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