silver-user-profile.entity.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';
  2. export enum Gender {
  3. MALE = 1,
  4. FEMALE = 2,
  5. OTHER = 3
  6. }
  7. export enum CertificationStatus {
  8. UNCERTIFIED = 0,
  9. PENDING = 1,
  10. CERTIFIED = 2,
  11. REJECTED = 3
  12. }
  13. export enum JobSeekingStatus {
  14. NOT_SEEKING = 0,
  15. ACTIVELY_SEEKING = 1,
  16. OPEN_TO_OPPORTUNITIES = 2
  17. }
  18. @Entity('silver_user_profiles')
  19. export class SilverUserProfile {
  20. @PrimaryGeneratedColumn({ unsigned: true })
  21. id!: number;
  22. @Column({ name: 'user_id', type: 'int', unsigned: true })
  23. userId!: number;
  24. // 基本信息
  25. @Column({ name: 'real_name', type: 'varchar', length: 50 })
  26. realName!: string;
  27. @Column({ name: 'nickname', type: 'varchar', length: 50, nullable: true })
  28. nickname!: string | null;
  29. @Column({ name: 'organization', type: 'varchar', length: 255, nullable: true })
  30. organization!: string | null;
  31. @Column({ name: 'age', type: 'int', unsigned: true })
  32. age!: number;
  33. @Column({ name: 'gender', type: 'tinyint', unsigned: true })
  34. gender!: Gender;
  35. @Column({ name: 'phone', type: 'varchar', length: 20 })
  36. phone!: string;
  37. @Column({ name: 'email', type: 'varchar', length: 255, nullable: true })
  38. email!: string | null;
  39. @Column({ name: 'avatar_url', type: 'varchar', length: 500, nullable: true })
  40. avatarUrl!: string | null;
  41. @Column({ name: 'personal_intro', type: 'text', nullable: true })
  42. personalIntro!: string | null;
  43. @Column({ name: 'personal_skills', type: 'text', nullable: true })
  44. personalSkills!: string | null;
  45. @Column({ name: 'personal_experience', type: 'text', nullable: true })
  46. personalExperience!: string | null;
  47. // 认证信息
  48. @Column({ name: 'certification_status', type: 'tinyint', default: CertificationStatus.UNCERTIFIED })
  49. certificationStatus!: CertificationStatus;
  50. @Column({ name: 'certification_info', type: 'text', nullable: true })
  51. certificationInfo!: string | null;
  52. // 求职需求
  53. @Column({ name: 'job_seeking_status', type: 'tinyint', default: JobSeekingStatus.NOT_SEEKING })
  54. jobSeekingStatus!: JobSeekingStatus;
  55. @Column({ name: 'job_seeking_requirements', type: 'text', nullable: true })
  56. jobSeekingRequirements!: string | null;
  57. // 统计信息
  58. @Column({ name: 'total_points', type: 'int', unsigned: true, default: 0 })
  59. totalPoints!: number;
  60. @Column({ name: 'resume_count', type: 'int', unsigned: true, default: 0 })
  61. resumeCount!: number;
  62. @Column({ name: 'application_count', type: 'int', unsigned: true, default: 0 })
  63. applicationCount!: number;
  64. @Column({ name: 'time_bank_hours', type: 'decimal', precision: 10, scale: 2, default: 0 })
  65. timeBankHours!: number;
  66. @Column({ name: 'knowledge_contributions', type: 'int', unsigned: true, default: 0 })
  67. knowledgeContributions!: number;
  68. @CreateDateColumn({ name: 'created_at' })
  69. createdAt!: Date;
  70. @UpdateDateColumn({ name: 'updated_at' })
  71. updatedAt!: Date;
  72. @Column({ name: 'created_by', type: 'int', nullable: true })
  73. createdBy!: number | null;
  74. @Column({ name: 'updated_by', type: 'int', nullable: true })
  75. updatedBy!: number | null;
  76. }