67 lines
1.7 KiB
TypeScript
67 lines
1.7 KiB
TypeScript
/**
|
||
* Namespace Api
|
||
*
|
||
* All backend api type
|
||
*/
|
||
declare namespace Api {
|
||
namespace Common {
|
||
/** 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[];
|
||
}
|
||
|
||
/** common search params of table */
|
||
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>;
|
||
|
||
/**
|
||
* enable status
|
||
*
|
||
* - "1": enabled
|
||
* - "2": disabled
|
||
*/
|
||
type EnableStatus = '1' | '2';
|
||
|
||
/**
|
||
* 列表项「当前登录用户在该对象的角色」(产品 / 项目列表共用)。
|
||
*
|
||
* 后端只读计算字段,随登录身份变化:同一份列表不同账号看到的内容不同;无角色为 []。
|
||
* 提交 / 更新接口不需要回传它。
|
||
*/
|
||
interface CurrentUserRole {
|
||
/**
|
||
* 角色稳定标识(程序判断用,不随中文名变化)。
|
||
* 例:product_manager / project_manager / developer / tester / watcher / creator / implicit_observer。
|
||
*/
|
||
roleKey: string;
|
||
/** 角色中文名(直接展示) */
|
||
roleName: string;
|
||
}
|
||
|
||
/** 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 | undefined;
|
||
} & T;
|
||
}
|
||
}
|