@@ -35,6 +35,7 @@ type LearningQuestionListReq struct {
OrderBy *model.OrderBy `json:"orderBy"`
SkillId int `json:"skillId"`
Name string `json:"name"`
+ Type int `json:"type"` // 题型 1 单选 2 多选 3 判断
}
type LearningQuestionAddReq struct {
@@ -72,6 +72,9 @@ func (s LearningQuestionService) List(ctx context.Context, req *learning.Learnin
if req.SkillId != 0 {
dao = dao.Where("SkillId = ?", req.SkillId)
+ if req.Type != 0 {
+ dao = dao.Where("Type = ?", req.Type)
+ }
total, err := dao.Count()
if err != nil {
return 0, nil, err
@@ -1106,6 +1106,9 @@ components:
name:
type: string
description: 按题目名称模糊查询
+ type:
+ type: integer
+ description: 题型 1 单选 2 多选 3 判断
LearningQuestionAdd:
type: object
required:
@@ -1565,6 +1568,7 @@ components:
value: id
skillId: 2
name: "测试"
+ type: 1
value: