ruoyi-plus-soybean/src/typings/api.d.ts

88 lines
1.8 KiB
TypeScript
Raw Normal View History

2023-11-17 08:45:00 +08:00
/**
2023-12-14 21:45:29 +08:00
* Namespace Api
*
* All backend api type
2023-11-17 08:45:00 +08:00
*/
declare namespace Api {
2024-01-28 00:44:21 +08:00
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 {
2024-01-28 00:44:21 +08:00
records: T[];
}
/** common search params of table */
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>;
2024-01-28 23:38:44 +08:00
/**
* enable status
*
* - "1": enabled
* - "2": disabled
*/
type EnableStatus = '1' | '2';
2024-01-28 00:44:21 +08:00
/** common record */
type CommonRecord<T = any> = {
2024-01-28 00:44:21 +08:00
/** record id */
id: number;
/** record creator */
createBy: string;
/** record create time */
createTime: string;
/** record updater */
updateBy: string;
/** record update time */
updateTime: string;
2024-01-28 23:38:44 +08:00
/** record status */
status: EnableStatus | null;
2024-01-28 00:44:21 +08:00
} & T;
}
2023-11-17 08:45:00 +08:00
/**
2024-01-28 00:44:21 +08:00
* namespace Auth
2023-12-14 21:45:29 +08:00
*
2024-01-28 00:44:21 +08:00
* backend api module: "auth"
2023-11-17 08:45:00 +08:00
*/
namespace Auth {
interface LoginToken {
token: string;
refreshToken: string;
}
2023-11-17 08:45:00 +08:00
interface UserInfo {
userId: string;
userName: string;
roles: string[];
2024-03-24 15:39:41 +08:00
buttons: string[];
2023-11-17 08:45:00 +08:00
}
}
2023-11-17 08:45:00 +08:00
/**
2024-01-28 00:44:21 +08:00
* namespace Route
2023-12-14 21:45:29 +08:00
*
2024-01-28 00:44:21 +08:00
* backend api module: "route"
2023-11-17 08:45:00 +08:00
*/
namespace Route {
type ElegantConstRoute = import('@elegant-router/types').ElegantConstRoute;
interface MenuRoute extends ElegantConstRoute {
id: string;
}
2023-11-17 08:45:00 +08:00
interface UserRoute {
routes: MenuRoute[];
home: import('@elegant-router/types').LastLevelRouteKey;
}
}
}