2016-12-27 23:09:47 +08:00
|
|
|
import {UserDTO, UserRoles} from "../../../../common/entities/UserDTO";
|
2017-07-04 01:17:49 +08:00
|
|
|
import {Column, Entity, PrimaryGeneratedColumn} from "typeorm";
|
2016-12-27 23:09:47 +08:00
|
|
|
|
2017-02-05 23:19:35 +08:00
|
|
|
@Entity()
|
2016-12-27 23:09:47 +08:00
|
|
|
export class UserEntity implements UserDTO {
|
|
|
|
|
2017-07-04 01:17:49 +08:00
|
|
|
@PrimaryGeneratedColumn()
|
|
|
|
id: number;
|
2016-12-27 23:09:47 +08:00
|
|
|
|
2017-07-22 01:14:22 +08:00
|
|
|
@Column()
|
2017-07-04 01:17:49 +08:00
|
|
|
name: string;
|
2016-12-27 23:09:47 +08:00
|
|
|
|
2017-07-22 01:14:22 +08:00
|
|
|
@Column()
|
2017-07-04 01:17:49 +08:00
|
|
|
password: string;
|
2016-12-27 23:09:47 +08:00
|
|
|
|
2017-07-22 01:14:22 +08:00
|
|
|
@Column("smallint")
|
2017-07-04 01:17:49 +08:00
|
|
|
role: UserRoles;
|
2016-12-27 23:09:47 +08:00
|
|
|
|
2017-10-20 00:08:07 +08:00
|
|
|
@Column("text", {nullable: true})
|
2017-07-04 01:17:49 +08:00
|
|
|
permissions: string[];
|
|
|
|
|
|
|
|
}
|