实体类
import { EntityModel } from '@midwayjs/orm';
import { BaseEntity } from '@cool-midway/core';
import { Column } from 'typeorm';
/**
* 描述
*/
@EntityModel('dzh_portal_goods')
export class DzhPortalGoodsEntity extends BaseEntity {
@Column({ comment: '会员id', default: 0, nullable: true })
uid: number;
@Column({ comment: '栏目id', nullable: true })
cateId: number;
@Column({ comment: '商品名称' })
goodName: string;
@Column({ type: 'simple-json', comment: '字段对象' })
fieldsArrJons: { name: "John", nickname: "Malkovich" };
}
报错
解决,simple-json类型换json
@Column({ type: 'json', comment: '字段对象' })
fieldsArrJons:string;