27 lines
488 B
TypeScript
27 lines
488 B
TypeScript
import { Serializable } from '../Serializable';
|
|
|
|
export class Principal implements Serializable<Principal> {
|
|
|
|
id: number;
|
|
token: string;
|
|
name: string;
|
|
expiresAt: Date;
|
|
appRoles: Principal.AppRole[];
|
|
|
|
fromJSONObject(item: any): Principal {
|
|
this.id = item.id;
|
|
this.token = item.token;
|
|
this.name = item.name;
|
|
this.expiresAt = item.expiresAt;
|
|
this.appRoles = item.appRoles;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
export namespace Principal {
|
|
export enum AppRole {
|
|
Admin = 0,
|
|
User = 1
|
|
}
|
|
}
|