import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, } from 'typeorm'; import { ApiProperty } from '@nestjs/swagger'; @Entity() export class LogRec { @ApiProperty({ description: '主键id,不用传值', type: 'int' }) @PrimaryGeneratedColumn() id: number; @ApiProperty({ description: '主内容', type: 'string' }) @Column('text', { comment: '内容' }) content: string; @ApiProperty({ description: '用户id', type: 'number' }) @Column('int', { nullable: true, comment: '用户id' }) userId: number; @ApiProperty({ description: '操作时间,不用传值,自动生成', type: 'timestamp', }) @Column('timestamp', { nullable: true, comment: '操作时间,不用传值,自动生成', }) @CreateDateColumn({ type: 'timestamp' }) creat_time: Date; @ApiProperty({ description: '类型', type: 'string' }) @Column('varchar', { nullable: true, comment: '类型' }) type: string; }