expert.entity.ts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { Column, Entity } from 'typeorm';
  2. import { BaseModel } from '../../frame/BaseModel';
  3. import dayjs = require('dayjs');
  4. // 导入的数据没有归属,只能不加权限的查询,也无法作为用户的证明
  5. // 专家
  6. @Entity('expert')
  7. export class Expert extends BaseModel {
  8. @Column({ type: 'integer', nullable: true, comment: '平台用户id' })
  9. user: number;
  10. @Column({ type: 'jsonb', nullable: true, comment: '标签', default: [] })
  11. tags: Array<any>;
  12. @Column({ type: 'character varying', nullable: true, comment: '专家姓名' })
  13. name: string;
  14. @Column({ type: 'jsonb', nullable: true, comment: '头像', default: [] })
  15. icon: Array<any>;
  16. @Column({ type: 'character varying', nullable: true, comment: '性别' })
  17. gender: string;
  18. @Column({ type: 'timestamp without time zone', nullable: true, comment: '出生年月', transformer: { from: value => dayjs(value).format('YYYY-MM-DD HH:mm:ss'), to: value => value } })
  19. birth: Date;
  20. @Column({ type: 'character varying', nullable: true, comment: '证件类型' })
  21. cardType: string;
  22. @Column({ type: 'character varying', nullable: true, comment: '证件号码' })
  23. card: string;
  24. @Column({ type: 'character varying', nullable: true, comment: '联系电话' })
  25. phone: string;
  26. @Column({ type: 'character varying', nullable: true, comment: '所属领域' })
  27. field: string;
  28. @Column({ type: 'character varying', nullable: true, comment: '研究方向' })
  29. direction: string;
  30. @Column({ type: 'character varying', nullable: true, comment: '工作单位' })
  31. work: string;
  32. @Column({ type: 'character varying', nullable: true, comment: '学历' })
  33. education: string;
  34. @Column({ type: 'character varying', nullable: true, comment: '职称' })
  35. title: string;
  36. @Column({ type: 'text', nullable: true, comment: '简介' })
  37. brief: string;
  38. @Column({ type: 'jsonb', nullable: true, comment: '所在地区' })
  39. area: Array<any>;
  40. @Column({ type: 'character varying', nullable: true, comment: '是否公开' })
  41. is_show: string;
  42. @Column({ type: 'character varying', nullable: true, comment: '状态', default: '0' })
  43. status: string;
  44. @Column({ type: 'character varying', nullable: true, comment: '产业类型' })
  45. industry_type: string;
  46. @Column({ type: 'character varying', nullable: true, comment: '所属产业' })
  47. industry: string;
  48. @Column({ type: 'character varying', nullable: true, comment: '工作单位类型' })
  49. work_type: string;
  50. }