This commit is contained in:
2024-07-02 17:37:50 +08:00
parent c87c7076df
commit 53e72e1ee2
35 changed files with 1813 additions and 60 deletions
+27
View File
@@ -0,0 +1,27 @@
package requests
type LabelRequest struct {
GetLabelList // 获取标签列表
AddLabel // 新增标签
PutLabel // 修改标签
}
// GetLabelList 获取标签列表
type GetLabelList struct {
LabelId string `json:"label_id" form:"label_id" label:"主键id"`
LabelName string `json:"label_name" form:"label_name" label:"标签名称"`
ParentId string `json:"parent_id" form:"parent_id" label:"父级ID"`
LabelLevel *int `json:"label_level" form:"label_level" label:"级别"`
}
// AddLabel 新增标签
type AddLabel struct {
LabelName string `json:"label_name" form:"label_name" label:"标签名称" validate:"required" `
ParentId string `json:"parent_id" form:"parent_id" label:"父级ID" `
LabelLevel int `json:"label_level" form:"label_level" label:"级别" validate:"required,number,min=1" `
}
// PutLabel 修改标签
type PutLabel struct {
LabelName string `json:"label_name" form:"label_name" label:"标签名称" validate:"required" `
}
+18 -6
View File
@@ -1,12 +1,13 @@
package requests
type QuestionRequest struct {
GetQuestionPage // 获取题目列表-分页
AddQuestion // 新增题目
AddQuestionTest // 新增题目
PutQuestion // 修改题目
PutQuestionTest // 修改题目
DeleteQuestion // 修改题目
GetQuestionPage // 获取题目列表-分页
AddQuestion // 新增题目
AddQuestionTest // 新增题目
PutQuestion // 修改题目
PutQuestionTest // 修改题目
DeleteQuestion // 修改题目
GetQuestionCount // 获取题目数量
}
// GetQuestionPage 获取题目列表-分页
@@ -44,6 +45,7 @@ type AddQuestion struct {
SecondLabelId string `json:"second_label_id" form:"second_label_id" label:"二级标签id"`
QuestionImage []string `json:"question_image" form:"question_image" label:"图片"`
QuestionOption []string `json:"question_option" form:"question_option" label:"选项"`
QaId string `json:"qa_id" form:"qa_id" label:"题库id"`
}
// AddQuestionTest 新增题目
@@ -102,3 +104,13 @@ type PutQuestionTest struct {
type DeleteQuestion struct {
QuestionId []string `json:"question_id" form:"question_id" validate:"required" label:"题目id"`
}
// GetQuestionCount 获取题目数量
type GetQuestionCount struct {
QuestionType *int `json:"question_type" form:"question_type" validate:"omitempty,oneof=1 2 3 4" label:"题目类型"` // 题目类型(1:单选 2:多选 3:问答 4:判断)
QuestionStatus *int `json:"question_status" form:"question_status" label:"状态"`
QuestionSource *int `json:"question_source" form:"question_source" validate:"omitempty,oneof=1 2" label:"题目来源"` // 题目来源(1:本题库 2:外部数据)
Difficulty *int `json:"difficulty" form:"difficulty" label:"难度"`
FirstLabelId *string `json:"first_label_id" form:"first_label_id" label:"一级标签id"`
SecondLabelId *string `json:"second_label_id" form:"second_label_id" label:"二级标签id"`
}
+7 -1
View File
@@ -6,6 +6,7 @@ type QuestionQaRequest struct {
PutQuestionQa // 修改问答题库
PutQuestionQaPassword // 修改问答题库密码
PutQuestionQaExpire // 修改问答题库有效期
PutQuestionQaRule // 修改问答题库规则解释
}
// GetQuestionQaPage 获取问答题库列表-分页
@@ -19,7 +20,7 @@ type GetQuestionQaPage struct {
QaDisplayType *int `json:"qa_display_type" form:"qa_display_type" label:"展示类型"` // 1:常规 2:飞花令)
QaExpireTime string `json:"qa_expire_time" form:"qa_expire_time" label:"过期时间"` // 注意:这里假设LocalTime转换为字符串格式处理
CreatedAt string `json:"created_at" form:"created_at" label:"创建时间"` // 注意:这里假设LocalTime转换为字符串格式处理
UpdatedAt string `json:"updated_at" form:"updated_at" label:"过期时间"` // 注意:这里假设LocalTime转换为字符串格式处理
UpdatedAt string `json:"updated_at" form:"updated_at" label:"修改时间"` // 注意:这里假设LocalTime转换为字符串格式处理
Order *GetQuestionQaPageOrder `json:"order" form:"order" label:"排序"`
}
@@ -80,3 +81,8 @@ type PutQuestionQaPassword struct {
type PutQuestionQaExpire struct {
QaExpireTime string `json:"qa_expire_time" form:"qa_expire_time" label:"过期时间" validate:"required"` // 注意:这里假设LocalTime转换为字符串格式处理
}
// PutQuestionQaRule 修改问答题库规则解释
type PutQuestionQaRule struct {
QaRuleContent string `json:"qa_rule_content" form:"qa_rule_content" label:"规则解释" validate:"required"`
}
+38
View File
@@ -0,0 +1,38 @@
package requests
type QuestionQaItemRequest struct {
GetQuestionQaItemPage // 获取问答题库明细列表-分页
DeleteQuestionQaItem // 删除问答题库明细
PutQuestionQaItemMust // 修改必选
}
// GetQuestionQaItemPage 获取问答题库明细列表-分页
type GetQuestionQaItemPage struct {
Page int `json:"page" form:"page" label:"页码"`
PageSize int `json:"page_size" form:"page_size" label:"每页个数"`
QaId string `json:"qa_id" form:"qa_id" label:"题库id" validate:"required"`
QuestionId string `json:"question_id" form:"question_id" label:"题目id"`
IsMustSelect *int `json:"is_must_select" form:"is_must_select" label:"是否必被选中"`
QuestionName string `json:"question_name" form:"question_name" label:"题目名称"`
QuestionType *int `json:"question_type" form:"question_type" validate:"omitempty,oneof=1 2 3 4" label:"题目类型"` // 题目类型(1:单选 2:多选 3:问答 4:判断)
QuestionSource *int `json:"question_source" form:"question_source" validate:"omitempty,oneof=1 2" label:"题目来源"` // 题目来源(1:本题库 2:外部数据)
Difficulty *int `json:"difficulty" form:"difficulty" label:"难度"`
FirstLabelId *string `json:"first_label_id" form:"first_label_id" label:"一级标签id"`
SecondLabelId *string `json:"second_label_id" form:"second_label_id" label:"二级标签id"`
Order *GetQuestionQaItemPageOrder `json:"order" form:"order" label:"排序"`
}
// GetQuestionQaItemPageOrder 获取题目明细列表-分页-排序条件
type GetQuestionQaItemPageOrder struct {
UpdatedAt string `json:"updated_at" form:"updated_at" label:"排序"`
}
// DeleteQuestionQaItem 删除问答题库明细
type DeleteQuestionQaItem struct {
ItemId []string `json:"item_id" form:"item_id" validate:"required" label:"明细id"`
}
// PutQuestionQaItemMust 修改必选
type PutQuestionQaItemMust struct {
IsMustSelect int `json:"is_must_select" form:"is_must_select" label:"是否必被选中"`
}
+10
View File
@@ -0,0 +1,10 @@
package requests
type ShareRequest struct {
GetShare // 获取分享数据
}
type GetShare struct {
QaShareId string `json:"qa_share_id" form:"qa_share_id" label:"分享标识" validate:"required"`
QaPassword string `json:"qa_password" form:"qa_password" label:"密码" validate:"required"`
}