2019-02-15 07:25:55 +08:00
|
|
|
import {Column, Entity, Index, OneToMany, PrimaryGeneratedColumn, Unique} from 'typeorm';
|
2019-01-12 23:41:45 +08:00
|
|
|
import {FaceRegionEntry} from './FaceRegionEntry';
|
2019-02-15 07:25:55 +08:00
|
|
|
import {PersonDTO} from '../../../../common/entities/PersonDTO';
|
2019-01-12 23:41:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
@Entity()
|
|
|
|
@Unique(['name'])
|
2019-02-15 07:25:55 +08:00
|
|
|
export class PersonEntry implements PersonDTO {
|
2019-01-12 23:41:45 +08:00
|
|
|
@Index()
|
2019-01-28 03:36:42 +08:00
|
|
|
@PrimaryGeneratedColumn({unsigned: true})
|
2019-01-12 23:41:45 +08:00
|
|
|
id: number;
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
name: string;
|
|
|
|
|
2019-02-15 07:25:55 +08:00
|
|
|
@Column('int', {unsigned: true, default: 0})
|
|
|
|
count: number;
|
|
|
|
|
2019-03-04 04:17:42 +08:00
|
|
|
@Column({default: false})
|
|
|
|
isFavourite: boolean;
|
|
|
|
|
2019-01-12 23:41:45 +08:00
|
|
|
@OneToMany(type => FaceRegionEntry, faceRegion => faceRegion.person)
|
|
|
|
public faces: FaceRegionEntry[];
|
2019-03-03 17:30:12 +08:00
|
|
|
|
|
|
|
|
2019-01-12 23:41:45 +08:00
|
|
|
}
|