chore: init read-star monorepo
This commit is contained in:
20
apps/admin/src/typings/api/auth.d.ts
vendored
Normal file
20
apps/admin/src/typings/api/auth.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
declare namespace Api {
|
||||
/**
|
||||
* namespace Auth
|
||||
*
|
||||
* backend api module: "auth"
|
||||
*/
|
||||
namespace Auth {
|
||||
interface LoginToken {
|
||||
token: string
|
||||
refreshToken: string
|
||||
}
|
||||
|
||||
interface UserInfo {
|
||||
userId: string
|
||||
userName: string
|
||||
roles: string[]
|
||||
buttons: string[]
|
||||
}
|
||||
}
|
||||
}
|
||||
50
apps/admin/src/typings/api/common.d.ts
vendored
Normal file
50
apps/admin/src/typings/api/common.d.ts
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
/**
|
||||
* 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'
|
||||
|
||||
/** 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
|
||||
}
|
||||
}
|
||||
19
apps/admin/src/typings/api/route.d.ts
vendored
Normal file
19
apps/admin/src/typings/api/route.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
declare namespace Api {
|
||||
/**
|
||||
* namespace Route
|
||||
*
|
||||
* backend api module: "route"
|
||||
*/
|
||||
namespace Route {
|
||||
type ElegantConstRoute = import('@elegant-router/types').ElegantConstRoute
|
||||
|
||||
interface MenuRoute extends ElegantConstRoute {
|
||||
id: string
|
||||
}
|
||||
|
||||
interface UserRoute {
|
||||
routes: MenuRoute[]
|
||||
home: import('@elegant-router/types').LastLevelRouteKey
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user