|
-
-
- // tslint:disable-next-line:class-name
- import {PeopleModel} from './people.model';
-
- export class apiV1LoginResponse {
-
- constructor(
- public login: boolean,
- public machineId: string,
- public session: string,
- public sessionExpire: number, // unix timestamp
- public role: string,
- public user: PeopleModel
- ) {
- this.login = login;
- this.machineId = machineId;
- this.session = session;
- this.sessionExpire = sessionExpire;
- }
-
- public static EmptyNew(): apiV1LoginResponse{
- return new apiV1LoginResponse(
- false, '', '', 0, '', PeopleModel.EmptyNew() );
- }
-
- public hasValidSession(): boolean {
- if (this.session === undefined || this.session === '') {
- return false;
- }else{
- return true;
- }
- }
-
- public hasValidMachineId(): boolean {
- if (this.machineId === undefined || this.machineId === '') {
- return false;
- }else{
- return true;
- }
- }
- }
|