1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/backend/model/sql/enitites/PersonEntry.ts

25 lines
585 B
TypeScript
Raw Normal View History

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()
@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-01-12 23:41:45 +08:00
@OneToMany(type => FaceRegionEntry, faceRegion => faceRegion.person)
public faces: FaceRegionEntry[];
readyThumbnail: boolean;
2019-01-12 23:41:45 +08:00
}