import { Column, Entity } from 'typeorm';
import { BaseModel } from '../../frame/BaseModel';
import * as dayjs from 'dayjs';
// 收藏
@Entity('collection')
export class Collection extends BaseModel {
  @Column({ type: 'integer', nullable: true, comment: '平台用户id' })
  user: number;
  @Column({ type: 'integer', nullable: true, comment: '来源id' })
  source: number;
  @Column({ type: 'character varying', nullable: true, comment: '类型' })
  type: string;
  @Column({ type: 'timestamp without time zone', nullable: true, comment: '收藏时间', transformer: { from: value => dayjs(value).format('YYYY-MM-DD HH:mm:ss'), to: value => value } })
  time: Date;
}
