- 新增6种题目类型枚举:逆向接诗句、场景猜诗句、联想对对碰、字词飞花令、诗词常识、换字组成语 - 新增QuestionDrawer组件,支持富文本编辑和拼音转换功能 - 优化CategoryTree组件,增加分类选择本地存储和自动填充题目类型 - 更新question API接口,简化新增和更新题目库的参数传递 - 扩展QuestionRenderer组件,支持新增的题目类型渲染 - 添加多个题目库JSON文件,包含成语、诗词常识、字词飞花令等题目数据 - 调整环境配置,更新开发环境API地址
119 lines
2.9 KiB
TypeScript
119 lines
2.9 KiB
TypeScript
/**
|
|
* Namespace Api
|
|
*
|
|
* All backend api type
|
|
*/
|
|
declare namespace Api {
|
|
namespace Question {
|
|
/** common params of paginating */
|
|
interface PaginatingCommonParams {
|
|
/** pageIndex page number */
|
|
pageIndex: number
|
|
/** page size */
|
|
pageSizes: number
|
|
/** total count */
|
|
total: number
|
|
}
|
|
|
|
/** common params of paginating query list data */
|
|
interface PaginatingQueryRecord<T = any> extends PaginatingCommonParams {
|
|
data: T[]
|
|
}
|
|
|
|
/** disable question library params */
|
|
interface DisableQuestionLibraryParams {
|
|
/** question library id */
|
|
Id: number
|
|
/** is disabled 0: no 1: yes */
|
|
IsDisabled: boolean
|
|
}
|
|
|
|
/** get question library list all params */
|
|
interface GetQuestionLibraryListAllParams {
|
|
/** question id */
|
|
questionId: number
|
|
/** pageIndex page number */
|
|
pageIndex: number
|
|
/** page size */
|
|
pageSizes: number
|
|
/** search keyword */
|
|
keyWords?: string
|
|
}
|
|
|
|
/** add params */
|
|
interface AddParams {
|
|
/** question id */
|
|
id: number
|
|
/** question name */
|
|
name: string
|
|
/** question content */
|
|
questionContent: string
|
|
/** question type */
|
|
questionType: QuestionType
|
|
}
|
|
|
|
/** add question library params */
|
|
interface AddQuestionLibraryParams {
|
|
/** question library id */
|
|
id: number
|
|
/** question library name */
|
|
name: string
|
|
/** question library content */
|
|
answer: string
|
|
/** question id */
|
|
questionId: number
|
|
/** question library image url */
|
|
imageUrl: string
|
|
/** question library type */
|
|
// type?: QuestionScoreType
|
|
/** is priority 0: no 1: yes */
|
|
IsGood: number
|
|
/** is disabled */
|
|
IsDisabled: boolean
|
|
/** keyword */
|
|
KeyWord: string
|
|
/** keyword index */
|
|
KeyWordsIndex: number
|
|
}
|
|
|
|
/** update question library params */
|
|
interface UpdateQuestionLibraryParams extends AddQuestionLibraryParams {
|
|
/** question library id */
|
|
id: number
|
|
}
|
|
|
|
/** common search params of table */
|
|
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>
|
|
|
|
/**
|
|
* enable status
|
|
*
|
|
* - "1": enabled
|
|
* - "2": disabled
|
|
*/
|
|
type EnableStatus = '1' | '2'
|
|
|
|
/** question score type */
|
|
type QuestionScoreType = '1' | '2' /** 固定分数 | 答题个数 */
|
|
|
|
/** competition round type */
|
|
type CompetitionRoundType = '1' | '2' /** 题包环节 | 加时环节 */
|
|
|
|
/** common record */
|
|
type CommonRecord<T = any> = {
|
|
/** record id */
|
|
id: number
|
|
/** record creator */
|
|
createBy: string
|
|
/** record create time */
|
|
createTime: string
|
|
/** record updater */
|
|
updateBy: string
|
|
/** record update time */
|
|
updateTime: string
|
|
/** record status */
|
|
status: EnableStatus | null
|
|
} & T
|
|
}
|
|
}
|