master
2022-03-08 ea91d26a2c90e8f70b6433b32a78aa840e501c58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { EntityModel } from '@midwayjs/orm';
import { BaseEntity, CoolEntityCrud } from '@cool-midway/core';
import { Column } from 'typeorm';
 
/**
 * 实体类crud demo
 */
@CoolEntityCrud()
@EntityModel('t_user')
export class DemoUserEntity extends BaseEntity {
  @Column({ comment: '头像' })
  headImg: string;
 
  @Column({ comment: '姓名' })
  name: string;
 
  @Column({ comment: '年龄' })
  age: number;
 
  @Column({ comment: '出生日期' })
  birthDate: Date;
 
  @Column({
    type: 'tinyint',
    comment: '性别 0-未知 1-男 2-女',
    default: 0,
  })
  type: number;
 
  @Column({ comment: '介绍', nullable: true })
  introduce: string;
}