import { Column, Entity } from 'typeorm';
import { BaseModel } from '../../frame/BaseModel';
import dayjs = require('dayjs');
// 导入的数据没有归属,只能不加权限的查询,也无法作为用户的证明
// 专家
@Entity('expert')
export class Expert extends BaseModel {
  @Column({ type: 'integer', nullable: true, comment: '平台用户id' })
  user: number;
  @Column({ type: 'jsonb', nullable: true, comment: '标签' })
  tags: Array<any>;
  @Column({ type: 'character varying', nullable: true, comment: '专家姓名' })
  name: string;
  @Column({ type: 'jsonb', nullable: true, comment: '头像' })
  icon: Array<any>;
  @Column({ type: 'character varying', nullable: true, comment: '性别' })
  gender: 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 } })
  birth: Date;
  @Column({ type: 'character varying', nullable: true, comment: '证件类型' })
  cardType: string;
  @Column({ type: 'character varying', nullable: true, comment: '证件号码' })
  card: string;
  @Column({ type: 'character varying', nullable: true, comment: '联系电话' })
  phone: string;
  @Column({ type: 'character varying', nullable: true, comment: '所属领域' })
  field: string;
  @Column({ type: 'character varying', nullable: true, comment: '研究方向' })
  direction: string;
  @Column({ type: 'character varying', nullable: true, comment: '工作单位' })
  work: string;
  @Column({ type: 'character varying', nullable: true, comment: '学历' })
  education: string;
  @Column({ type: 'character varying', nullable: true, comment: '职称' })
  title: string;
  @Column({ type: 'text', nullable: true, comment: '简介' })
  brief: string;
  @Column({ type: 'jsonb', nullable: true, comment: '所在地区' })
  area: Array<any>;
  @Column({ type: 'character varying', nullable: true, comment: '是否公开' })
  is_show: string;
  @Column({ type: 'character varying', nullable: true, comment: '状态', default: '0' })
  status: string;
  @Column({ type: 'character varying', nullable: true, comment: '产业类型' })
  industry_type: string;
  @Column({ type: 'character varying', nullable: true, comment: '所属产业' })
  industry: string;
  @Column({ type: 'character varying', nullable: true, comment: '工作单位类型' })
  work_type: string;
}
