system-config.entity.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
  2. @Entity('system_config')
  3. export class SystemConfig {
  4. @PrimaryGeneratedColumn({ name: 'id', type: 'int', unsigned: true })
  5. id!: number;
  6. @Column({ name: 'config_key', type: 'varchar', length: 255, comment: '配置键' })
  7. configKey!: string;
  8. @Column({ name: 'config_value', type: 'text', comment: '配置值' })
  9. configValue!: string;
  10. @Column({ name: 'description', type: 'text', nullable: true, comment: '配置描述' })
  11. description!: string | null;
  12. @Column({ name: 'created_by', type: 'int', unsigned: true, nullable: true, comment: '创建用户ID' })
  13. createdBy!: number | null;
  14. @Column({ name: 'updated_by', type: 'int', unsigned: true, nullable: true, comment: '更新用户ID' })
  15. updatedBy!: number | null;
  16. @Column({ name: 'created_at', type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
  17. createdAt!: Date;
  18. @Column({
  19. name: 'updated_at',
  20. type: 'timestamp',
  21. default: () => 'CURRENT_TIMESTAMP',
  22. onUpdate: 'CURRENT_TIMESTAMP'
  23. })
  24. updatedAt!: Date;
  25. }