merchant.mt.entity.ts 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';
  2. @Entity('merchants_mt')
  3. export class MerchantMt {
  4. @PrimaryGeneratedColumn({ unsigned: true })
  5. id!: number;
  6. @Column({ name: 'tenant_id', type: 'int', unsigned: true, nullable: false, comment: '租户ID' })
  7. tenantId!: number;
  8. @Column({ name: 'name', type: 'varchar', length: 255, nullable: true, comment: '商户名称' })
  9. name!: string | null;
  10. @Column({ name: 'username', type: 'varchar', length: 20, unique: true, comment: '用户名' })
  11. username!: string;
  12. @Column({ name: 'password', type: 'varchar', length: 255, comment: '密码' })
  13. password!: string;
  14. @Column({ name: 'phone', type: 'char', length: 11, nullable: true, comment: '手机号码' })
  15. phone!: string | null;
  16. @Column({ name: 'realname', type: 'varchar', length: 20, nullable: true, comment: '姓名' })
  17. realname!: string | null;
  18. @Column({ name: 'login_num', type: 'int', unsigned: true, default: 0, comment: '登录次数' })
  19. loginNum!: number;
  20. @Column({ name: 'login_time', type: 'int', unsigned: true, default: 0, comment: '登录时间' })
  21. loginTime!: number;
  22. @Column({ name: 'login_ip', type: 'varchar', length: 15, nullable: true, comment: '登录IP' })
  23. loginIp!: string | null;
  24. @Column({ name: 'last_login_time', type: 'int', unsigned: true, default: 0, comment: '上次登录时间' })
  25. lastLoginTime!: number;
  26. @Column({ name: 'last_login_ip', type: 'varchar', length: 15, nullable: true, comment: '上次登录IP' })
  27. lastLoginIp!: string | null;
  28. @Column({ name: 'state', type: 'smallint', unsigned: true, default: 2, comment: '状态 1启用 2禁用' })
  29. state!: number;
  30. @Column({ name: 'rsa_public_key', type: 'varchar', length: 2000, nullable: true, comment: '公钥' })
  31. rsaPublicKey!: string | null;
  32. @Column({ name: 'aes_key', type: 'varchar', length: 32, nullable: true, comment: 'aes秘钥' })
  33. aesKey!: string | null;
  34. @CreateDateColumn({ name: 'created_at', type: 'timestamp', comment: '创建时间' })
  35. createdAt!: Date;
  36. @UpdateDateColumn({ name: 'updated_at', type: 'timestamp', comment: '更新时间' })
  37. updatedAt!: Date;
  38. @Column({ name: 'created_by', type: 'int', unsigned: true, nullable: true, comment: '创建用户ID' })
  39. createdBy!: number | null;
  40. @Column({ name: 'updated_by', type: 'int', unsigned: true, nullable: true, comment: '更新用户ID' })
  41. updatedBy!: number | null;
  42. }