mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2026-01-09 13:28:20 +00:00
完善
This commit is contained in:
parent
4a1b0ee8c6
commit
5e542723a4
32
src/app/modules/demo/entity/user.ts
Normal file
32
src/app/modules/demo/entity/user.ts
Normal 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;
|
||||
}
|
||||
@ -20,6 +20,8 @@ export default (appInfo: EggAppInfo) => {
|
||||
charset: 'utf8mb4',
|
||||
// 驱动
|
||||
driver: require('mysql2'),
|
||||
// 设置时区
|
||||
timezone: '+8:00',
|
||||
};
|
||||
|
||||
config.logger = {
|
||||
|
||||
@ -20,6 +20,8 @@ export default (appInfo: EggAppInfo) => {
|
||||
charset: 'utf8mb4',
|
||||
// 驱动
|
||||
driver: require('mysql2'),
|
||||
// 设置时区
|
||||
timezone: '+8:00',
|
||||
};
|
||||
|
||||
config.logger = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user