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 extends NonNullable<unknown>> extends PaginatingCommonParams {
|
|
|
|
records: T[];
|
|
|
|
}
|
|
|
|
|
|
|
|
/** common record */
|
|
|
|
type CommonRecord<T extends NonNullable<unknown>> = {
|
|
|
|
/** record id */
|
|
|
|
id: number;
|
|
|
|
/** record creator */
|
|
|
|
createBy: string;
|
|
|
|
/** record create time */
|
|
|
|
createTime: string;
|
|
|
|
/** record updater */
|
|
|
|
updateBy: string;
|
|
|
|
/** record update time */
|
|
|
|
updateTime: string;
|
|
|
|
} & 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;
|
|
|
|
}
|
2022-03-12 17:45:37 +08:00
|
|
|
|
2023-11-17 08:45:00 +08:00
|
|
|
interface UserInfo {
|
|
|
|
userId: string;
|
|
|
|
userName: string;
|
|
|
|
roles: string[];
|
|
|
|
}
|
2022-03-12 17:45:37 +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;
|
|
|
|
}
|
2022-04-04 19:13:15 +08:00
|
|
|
|
2023-11-17 08:45:00 +08:00
|
|
|
interface UserRoute {
|
|
|
|
routes: MenuRoute[];
|
|
|
|
home: import('@elegant-router/types').LastLevelRouteKey;
|
|
|
|
}
|
2022-07-30 22:16:42 +08:00
|
|
|
}
|
2024-01-28 00:44:21 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* namespace SystemManage
|
|
|
|
*
|
|
|
|
* backend api module: "systemManage"
|
|
|
|
*/
|
|
|
|
namespace SystemManage {
|
2024-01-28 16:24:43 +08:00
|
|
|
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>;
|
|
|
|
|
2024-01-28 00:44:21 +08:00
|
|
|
/**
|
|
|
|
* role status
|
|
|
|
*
|
|
|
|
* - "1": enabled
|
|
|
|
* - "2": disabled
|
|
|
|
*/
|
|
|
|
type RoleStatus = '1' | '2';
|
|
|
|
|
|
|
|
/** role */
|
|
|
|
type Role = Common.CommonRecord<{
|
|
|
|
/** role name */
|
|
|
|
roleName: string;
|
|
|
|
/** role code */
|
|
|
|
roleCode: string;
|
|
|
|
/** role description */
|
|
|
|
roleDesc: string;
|
|
|
|
/** role status */
|
|
|
|
roleStatus: RoleStatus | null;
|
|
|
|
}>;
|
|
|
|
|
|
|
|
/** role search params */
|
|
|
|
type RoleSearchParams = CommonType.RecordNullable<
|
2024-01-28 16:24:43 +08:00
|
|
|
Pick<Api.SystemManage.Role, 'roleName' | 'roleCode' | 'roleStatus'> & CommonSearchParams
|
2024-01-28 00:44:21 +08:00
|
|
|
>;
|
|
|
|
|
|
|
|
/** role list */
|
|
|
|
type RoleList = Common.PaginatingQueryRecord<Role>;
|
2024-01-28 16:24:43 +08:00
|
|
|
|
|
|
|
/** all role */
|
|
|
|
type AllRole = Pick<Role, 'id' | 'roleName' | 'roleCode'>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* user gender
|
|
|
|
*
|
|
|
|
* - "1": "male"
|
|
|
|
* - "2": "female"
|
|
|
|
*/
|
|
|
|
type UserGender = '1' | '2';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* user status
|
|
|
|
*
|
|
|
|
* - "1": enabled
|
|
|
|
* - "2": disabled
|
|
|
|
*/
|
|
|
|
type UserStatus = '1' | '2';
|
|
|
|
|
|
|
|
/** user */
|
|
|
|
type User = Common.CommonRecord<{
|
|
|
|
/** user name */
|
|
|
|
userName: string;
|
|
|
|
/** user gender */
|
|
|
|
userGender: UserGender | null;
|
|
|
|
/** user nick name */
|
|
|
|
nickName: string;
|
|
|
|
/** user phone */
|
|
|
|
userPhone: string;
|
|
|
|
/** user email */
|
|
|
|
userEmail: string;
|
|
|
|
/** user role code collection */
|
|
|
|
userRoles: string[];
|
|
|
|
/** user status */
|
|
|
|
userStatus: UserStatus | null;
|
|
|
|
}>;
|
|
|
|
|
|
|
|
/** user search params */
|
|
|
|
type UserSearchParams = CommonType.RecordNullable<
|
|
|
|
Pick<Api.SystemManage.User, 'userName' | 'userGender' | 'nickName' | 'userPhone' | 'userEmail' | 'userStatus'> &
|
|
|
|
CommonSearchParams
|
|
|
|
>;
|
|
|
|
|
|
|
|
/** user list */
|
|
|
|
type UserList = Common.PaginatingQueryRecord<User>;
|
2024-01-28 00:44:21 +08:00
|
|
|
}
|
2022-07-30 22:16:42 +08:00
|
|
|
}
|