FrontEnd Angular - v0.0.1-alpha
This commit is contained in:
6
src/app/shared/model/user/user.checker.ts
Normal file
6
src/app/shared/model/user/user.checker.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { createCheckers } from "ts-interface-checker";
|
||||
import TokenTI from "../token/token.model-ti";
|
||||
import UserTI from "./user.model-ti";
|
||||
|
||||
const UserChecker = createCheckers(UserTI, TokenTI)['User'];
|
||||
export default UserChecker;
|
||||
23
src/app/shared/model/user/user.model-ti.ts
Normal file
23
src/app/shared/model/user/user.model-ti.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* This module was automatically generated by `ts-interface-builder`
|
||||
*/
|
||||
import * as t from "ts-interface-checker";
|
||||
// tslint:disable:object-literal-key-quotes
|
||||
|
||||
export const User = t.iface([], {
|
||||
"id": t.opt("number"),
|
||||
"name": t.opt("string"),
|
||||
"email": t.opt("string"),
|
||||
"username": "string",
|
||||
"password": t.opt("string"),
|
||||
"accessToken": t.opt("Token"),
|
||||
"refreshToken": t.opt("Token"),
|
||||
"authorities": t.opt(t.array(t.iface([], {
|
||||
"authority": "string",
|
||||
}))),
|
||||
});
|
||||
|
||||
const UserTI: t.ITypeSuite = {
|
||||
User,
|
||||
};
|
||||
export default UserTI;
|
||||
13
src/app/shared/model/user/user.model.ts
Normal file
13
src/app/shared/model/user/user.model.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Token } from "../token/token.model";
|
||||
|
||||
export interface User {
|
||||
id?: number,
|
||||
fullname?: string,
|
||||
email?: string,
|
||||
username: string,
|
||||
password?: string,
|
||||
accessToken?: Token,
|
||||
refreshToken?: Token,
|
||||
authorities?: Array<{authority: string}>,
|
||||
validateAccessToken?: () => Token | undefined;
|
||||
};
|
||||
Reference in New Issue
Block a user