platform.entity.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { Entity, Column, PrimaryGeneratedColumn, Index } from 'typeorm';
  2. @Entity('employer_platform')
  3. export class Platform {
  4. @PrimaryGeneratedColumn({
  5. name: 'platform_id',
  6. type: 'int',
  7. unsigned: true,
  8. comment: '平台ID'
  9. })
  10. id!: number;
  11. @Column({
  12. name: 'platform_name',
  13. type: 'varchar',
  14. length: 100,
  15. nullable: false,
  16. comment: '平台名称'
  17. })
  18. @Index('idx_platform_name', { unique: true })
  19. platformName!: string;
  20. @Column({
  21. name: 'contact_person',
  22. type: 'varchar',
  23. length: 50,
  24. nullable: false,
  25. default: '',
  26. comment: '联系人'
  27. })
  28. contactPerson!: string;
  29. @Column({
  30. name: 'contact_phone',
  31. type: 'varchar',
  32. length: 20,
  33. nullable: false,
  34. default: '',
  35. comment: '联系电话'
  36. })
  37. contactPhone!: string;
  38. @Column({
  39. name: 'contact_email',
  40. type: 'varchar',
  41. length: 100,
  42. nullable: true,
  43. comment: '联系邮箱'
  44. })
  45. contactEmail?: string;
  46. @Column({
  47. name: 'status',
  48. type: 'int',
  49. default: 1,
  50. comment: '状态:1-正常,0-禁用'
  51. })
  52. status!: number;
  53. @Column({
  54. name: 'create_time',
  55. type: 'timestamp',
  56. default: () => 'CURRENT_TIMESTAMP',
  57. comment: '创建时间'
  58. })
  59. createTime!: Date;
  60. @Column({
  61. name: 'update_time',
  62. type: 'timestamp',
  63. default: () => 'CURRENT_TIMESTAMP',
  64. onUpdate: 'CURRENT_TIMESTAMP',
  65. comment: '更新时间'
  66. })
  67. updateTime!: Date;
  68. }