consultation-request.entity.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';
  2. @Entity('consultation_requests')
  3. export class ConsultationRequest {
  4. @PrimaryGeneratedColumn({ unsigned: true })
  5. id!: number;
  6. @Column({ name: 'customer_name', type: 'varchar', length: 255, comment: '客户姓名' })
  7. customerName!: string;
  8. @Column({ name: 'company_name', type: 'varchar', length: 255, nullable: true, comment: '公司名称' })
  9. companyName!: string | null;
  10. @Column({ name: 'phone', type: 'varchar', length: 20, comment: '手机号' })
  11. phone!: string;
  12. @Column({ name: 'email', type: 'varchar', length: 255, nullable: true, comment: '邮箱地址' })
  13. email!: string | null;
  14. @Column({ name: 'project_type', type: 'varchar', length: 100, comment: '项目类型' })
  15. projectType!: string;
  16. @Column({ name: 'project_description', type: 'text', comment: '项目描述' })
  17. projectDescription!: string;
  18. @Column({ name: 'budget_range', type: 'varchar', length: 100, nullable: true, comment: '预算范围' })
  19. budgetRange!: string | null;
  20. @Column({ name: 'timeline', type: 'varchar', length: 100, nullable: true, comment: '项目时间要求' })
  21. timeline!: string | null;
  22. @Column({ name: 'status', type: 'varchar', length: 20, default: 'pending', comment: '状态:pending-待处理, processing-处理中, completed-已完成' })
  23. status!: string;
  24. @Column({ name: 'is_guest', type: 'tinyint', default: 0, comment: '是否为游客提交' })
  25. isGuest!: number;
  26. @Column({ name: 'ip_address', type: 'varchar', length: 45, nullable: true, comment: '提交IP地址' })
  27. ipAddress!: string | null;
  28. @Column({ name: 'user_agent', type: 'text', nullable: true, comment: '用户代理信息' })
  29. userAgent!: string | null;
  30. @CreateDateColumn({ name: 'created_at', comment: '创建时间' })
  31. createdAt!: Date;
  32. @UpdateDateColumn({ name: 'updated_at', comment: '更新时间' })
  33. updatedAt!: Date;
  34. }