增加了题库不允许重复的业务逻辑5

This commit is contained in:
wucongxing8150 2025-07-29 13:14:20 +08:00
parent 57e581c4e9
commit c7f68e4edc
2 changed files with 5 additions and 3 deletions

View File

@ -231,7 +231,9 @@ func (r *QuestionQaDao) GetQuestionQaListSearch(req requests.GetQuestionQaList)
}
// 类型
query = query.Where("qa_type = ?", req.QaType)
//query = query.Where("qa_type = ?", req.QaType)
query = query.Where("qa_type IN ?", []string{"1", "2", "3"})
// 状态
if req.QaStatus != nil {

View File

@ -29,8 +29,8 @@ type GetQuestionQaPage struct {
// GetQuestionQaList 获取问答题库列表
type GetQuestionQaList struct {
QaName string `json:"qa_name" form:"qa_name" label:"名称"`
QaType int `json:"qa_type" form:"qa_type" label:"题库类型" validate:"required,oneof=1 2 3"` // 1:常规模式 2:固定套题模式 3:多轮固定题型模式)
QaStatus *int `json:"qa_status" form:"qa_status" label:"状态"` // 1:正常 2:过期)
QaType int `json:"qa_type" form:"qa_type" label:"题库类型"` // 1:常规模式 2:固定套题模式 3:多轮固定题型模式)
QaStatus *int `json:"qa_status" form:"qa_status" label:"状态"` // 1:正常 2:过期)
QaRuleContent string `json:"qa_rule_content" form:"qa_rule_content" label:"规则解释"`
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转换为字符串格式处理