1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

27 lines
611 B
TypeScript
Raw Normal View History

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