// ========================================================================== // GFast自动生成api操作代码。 // 生成日期:2023-10-07 15:52:18 // 生成路径: api/v1/system/bus_question_bank.go // 生成人:gfast // desc:题库相关参数 // company:云南奇讯科技有限公司 // ========================================================================== package system import ( "github.com/gogf/gf/v2/frame/g" commonApi "github.com/tiger1103/gfast/v3/api/v1/common" "github.com/tiger1103/gfast/v3/internal/app/system/model" ) // BusQuestionBankSearchReq 分页请求参数 type BusQuestionBankSearchReq struct { g.Meta `path:"/list" tags:"题库" method:"get" summary:"题库列表"` CategoryId string `p:"categoryId" v:"categoryId@integer#题目类别需为整数"` //题目类别 QuestionType string `p:"questionType"` //题目类型(1单选、2多选、3判断、4填空、5问答) QuestionText string `p:"questionText"` //题目内容 CreatedAt string `p:"createdAt" v:"createdAt@datetime#创建时间需为YYYY-MM-DD hh:mm:ss格式"` //创建时间 commonApi.PageReq commonApi.Author } // BusQuestionBankSearchRes 列表返回结果 type BusQuestionBankSearchRes struct { g.Meta `mime:"application/json"` commonApi.ListRes List []*model.BusQuestionBankListRes `json:"list"` } // BusQuestionBankAddReq 添加操作请求参数 type BusQuestionBankAddReq struct { g.Meta `path:"/add" tags:"题库" method:"post" summary:"题库添加"` commonApi.Author CategoryId int64 `p:"categoryId" v:"required#题目类别不能为空"` QuestionType string `p:"questionType" v:"required#题目类型(1单选、2多选、3判断、4填空、5问答)不能为空"` QuestionText string `p:"questionText" ` Options string `p:"options" ` CorrectAnswer string `p:"correctAnswer" ` //Score float64 `p:"score" ` WxOrPc string `p:"wxOrPc" v:"required#创建人类型(1pc、2小程序)不能为空"` } // BusQuestionBankAddRes 添加操作返回结果 type BusQuestionBankAddRes struct { commonApi.EmptyRes } // BusQuestionBankEditReq 修改操作请求参数 type BusQuestionBankEditReq struct { g.Meta `path:"/edit" tags:"题库" method:"put" summary:"题库修改"` commonApi.Author Id int64 `p:"id" v:"required#主键ID不能为空"` CategoryId int64 `p:"categoryId" v:"required#题目类别不能为空"` QuestionType string `p:"questionType" v:"required#题目类型(1单选、2多选、3判断、4填空、5问答)不能为空"` QuestionText string `p:"questionText" ` Options string `p:"options" ` CorrectAnswer string `p:"correctAnswer" ` //Score float64 `p:"score" ` WxOrPc string `p:"wxOrPc" v:"required#创建人类型(1pc、2小程序)不能为空"` } // BusQuestionBankEditRes 修改操作返回结果 type BusQuestionBankEditRes struct { commonApi.EmptyRes } // BusQuestionBankGetReq 获取一条数据请求 type BusQuestionBankGetReq struct { g.Meta `path:"/get" tags:"题库" method:"get" summary:"获取题库信息"` commonApi.Author Id int64 `p:"id" v:"required#主键必须"` //通过主键获取 } // BusQuestionBankGetRes 获取一条数据结果 type BusQuestionBankGetRes struct { g.Meta `mime:"application/json"` *model.BusQuestionBankInfoRes } // BusQuestionBankDeleteReq 删除数据请求 type BusQuestionBankDeleteReq struct { g.Meta `path:"/delete" tags:"题库" method:"delete" summary:"删除题库"` commonApi.Author Ids []int64 `p:"ids" v:"required#主键必须"` //通过主键删除 } // BusQuestionBankDeleteRes 删除数据返回 type BusQuestionBankDeleteRes struct { commonApi.EmptyRes } // ExaminationPaperReq 生成试卷 type ExaminationPaperReq struct { g.Meta `path:"/examinationPaper" tags:"题库" method:"get" summary:"生成试卷"` commonApi.Author } // ExaminationPaperRes 生成试卷返回结果 type ExaminationPaperRes struct { g.Meta `mime:"application/json"` Maximum int `p:"最大考试时间(分钟)"` Single *ExaminationPaperOne `json:"singleList" dc:"单选题"` Multiple *ExaminationPaperOne `json:"multipleList" dc:"多选题"` Estimate *ExaminationPaperOne `json:"estimateList" dc:"判断题"` } type ExaminationPaperOne struct { Topic string `p:"categoryId" dc:"题目+分数"` List []*ExaminationPaperTwo `json:"list"` } type ExaminationPaperTwo struct { Id int64 `json:"id" dc:"题库id"` QuestionType string `json:"questionType" dc:"题类型"` QuestionText string `json:"questionText" dc:"题内容"` Options string `json:"options" dc:"题选项"` Score float64 `json:"score" dc:"题分数"` }