Files
reader-star/apps/admin/src/typings/api/question.d.ts

67 lines
1.5 KiB
TypeScript
Raw Normal View History

/**
* Namespace Api
*
* All backend api type
*/
declare namespace Api {
namespace Question {
/** common params of paginating */
interface PaginatingCommonParams {
/** current page number */
current: number
/** page size */
size: number
/** total count */
total: number
}
/** common params of paginating query list data */
interface PaginatingQueryRecord<T = any> extends PaginatingCommonParams {
records: T[]
}
/** add params */
interface AddParams {
/** question id */
id: string
/** question name */
name: string
/** question content */
questionContent: string
}
/** 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
}
}