forked from yoone/API
55 lines
1.2 KiB
TypeScript
55 lines
1.2 KiB
TypeScript
import { ApiProperty } from '@midwayjs/swagger';
|
|
import {
|
|
Column,
|
|
CreateDateColumn,
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
UpdateDateColumn,
|
|
} from 'typeorm';
|
|
|
|
@Entity('template')
|
|
export class Template {
|
|
@ApiProperty({ type: 'number' })
|
|
@PrimaryGeneratedColumn()
|
|
id: number;
|
|
|
|
@ApiProperty({ type: 'string' })
|
|
@Column({ unique: true })
|
|
name: string;
|
|
|
|
@ApiProperty({ type: 'string' })
|
|
@Column('text')
|
|
value: string;
|
|
|
|
@ApiProperty({ nullable: true ,name:"描述"})
|
|
@Column('text',{nullable: true,comment: "描述"})
|
|
description?: string;
|
|
|
|
@ApiProperty({ type: 'string', nullable: true, description: '测试数据JSON' })
|
|
@Column('text', { nullable: true, comment: '测试数据JSON' })
|
|
testData?: string;
|
|
|
|
@ApiProperty({
|
|
example: true,
|
|
description: '是否可删除',
|
|
required: true,
|
|
})
|
|
@Column({ default: true })
|
|
deletable: boolean;
|
|
@ApiProperty({
|
|
example: '2022-12-12 11:11:11',
|
|
description: '创建时间',
|
|
required: true,
|
|
})
|
|
@CreateDateColumn()
|
|
createdAt: Date;
|
|
|
|
@ApiProperty({
|
|
example: '2022-12-12 11:11:11',
|
|
description: '更新时间',
|
|
required: true,
|
|
})
|
|
@UpdateDateColumn()
|
|
updatedAt: Date;
|
|
}
|