mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
24 lines
430 B
TypeScript
24 lines
430 B
TypeScript
import {UserDTO, UserRoles} from '../../../../common/entities/UserDTO';
|
|
import {Column, Entity, PrimaryGeneratedColumn, Unique} from 'typeorm';
|
|
|
|
@Entity()
|
|
@Unique(['name'])
|
|
export class UserEntity implements UserDTO {
|
|
|
|
@PrimaryGeneratedColumn()
|
|
id: number;
|
|
|
|
@Column()
|
|
name: string;
|
|
|
|
@Column()
|
|
password: string;
|
|
|
|
@Column('smallint')
|
|
role: UserRoles;
|
|
|
|
@Column('text', {nullable: true})
|
|
permissions: string[];
|
|
|
|
}
|