This commit is contained in:
ap 2021-12-07 15:45:46 +08:00
parent 4a1b0ee8c6
commit 5e542723a4
3 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,32 @@
import { EntityModel } from '@midwayjs/orm';
import { BaseEntity, CoolEntityCrud } from '@cool-midway/core';
import { Column } from 'typeorm';
/**
* crud demo
*/
@CoolEntityCrud()
@EntityModel('demo_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;
}

View File

@ -20,6 +20,8 @@ export default (appInfo: EggAppInfo) => {
charset: 'utf8mb4',
// 驱动
driver: require('mysql2'),
// 设置时区
timezone: '+8:00',
};
config.logger = {

View File

@ -20,6 +20,8 @@ export default (appInfo: EggAppInfo) => {
charset: 'utf8mb4',
// 驱动
driver: require('mysql2'),
// 设置时区
timezone: '+8:00',
};
config.logger = {