import { Column, Entity } from 'typeorm';
import { BaseModel } from '../frame/BaseModel';
import dayjs = require('dayjs');
@Entity('test')
export class Test extends BaseModel {
  @Column({ type: 'character varying', nullable: true, comment: '昵称' })
  nick_name: string;
  @Column({ type: 'character varying', nullable: true, comment: '账号' })
  account: string;
  @Column({ type: 'integer', nullable: true, comment: '数字' })
  age: number;
  @Column({ type: 'jsonb', nullable: true, comment: '爱好' })
  hobby: Array<any>;
  @Column({ type: 'jsonb', nullable: true, comment: '属性' })
  props: object;
  @Column({ type: 'jsonb', nullable: true, comment: '数组属性' })
  array_props: Array<object>;
  @Column({ type: 'text', nullable: true, comment: '备注' })
  remark: 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;
  @Column({ type: 'jsonb', nullable: true, comment: '爱好' })
  tags: Array<any>;
}
