40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
/**
|
||
* 应用层枚举(VARCHAR 存储 + TS 常量校验)。
|
||
* 取值与数据库列存储值一一对应,作为全项目唯一枚举源。
|
||
*/
|
||
|
||
export const CommonStatus = {
|
||
ENABLED: 'enabled',
|
||
DISABLED: 'disabled',
|
||
} as const;
|
||
export type CommonStatus = (typeof CommonStatus)[keyof typeof CommonStatus];
|
||
|
||
export const UserStatus = {
|
||
ENABLED: 'enabled',
|
||
DISABLED: 'disabled',
|
||
LOCKED: 'locked',
|
||
} as const;
|
||
export type UserStatus = (typeof UserStatus)[keyof typeof UserStatus];
|
||
|
||
export const ResourceType = {
|
||
MENU: 'menu',
|
||
BUTTON: 'button',
|
||
API: 'api',
|
||
} as const;
|
||
export type ResourceType = (typeof ResourceType)[keyof typeof ResourceType];
|
||
|
||
export const DataScope = {
|
||
ALL: 'all',
|
||
DEPT: 'dept',
|
||
DEPT_AND_CHILD: 'dept_and_child',
|
||
SELF: 'self',
|
||
CUSTOM: 'custom',
|
||
} as const;
|
||
export type DataScope = (typeof DataScope)[keyof typeof DataScope];
|
||
|
||
export const LoginStatus = {
|
||
SUCCESS: 'success',
|
||
FAIL: 'fail',
|
||
} as const;
|
||
export type LoginStatus = (typeof LoginStatus)[keyof typeof LoginStatus];
|