app/@overflow/model/meta/MetaTargetStatus.ts

24 lines
455 B
TypeScript
Raw Normal View History

2018-08-26 15:15:10 +00:00
export interface MetaTargetStatus {
id?: number;
key?: string;
name?: string;
createDate?: Date;
}
export enum MetaTargetStatusEnum {
UP = 'UP',
DOWN = 'DOWN',
WARN = 'WARN',
ERROR = 'ERROR',
}
export const toMetaTargetStatusEnum = (v: MetaTargetStatus): MetaTargetStatusEnum => {
return MetaTargetStatusEnum[v.key];
};
export const toMetaTargetStatus = (v: MetaTargetStatusEnum): MetaTargetStatus => {
return {
key: v,
};
};