import { Entity , Column , PrimaryGeneratedColumn , OneToMany } from 'typeorm' ; import { Picture } from './picture.entity' ; @ Entity ( 'picture_group' ) export class PictureGroup { @ PrimaryGeneratedColumn ( { comment : '自增主键' , } ) id : number ; @ Column ( { comment : '图组名称' , length : 20 } ) name : string ; @ OneToMany ( type => Picture , picture => picture . pictureGroup ) pictures : Picture [ ] ; }