wangzhibo
6 天以前 7dcc2997614f849258091f5d66e648317a40d323
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 { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';
 
/**
 * 规格
 */
@Entity('goods_spec')
export class GoodsSpecEntity extends BaseEntity {
  @Index()
  @Column({ comment: '商品ID' })
  goodsId: number;
 
  @Column({ comment: '名称' })
  name: string;
 
  @Column({
    comment: '价格',
    type: 'decimal',
    precision: 12,
    scale: 2,
  })
  price: number;
 
  @Column({ comment: '库存', default: 0 })
  stock: number;
 
  @Column({ comment: '排序', default: 0, nullable: true })
  sortNum: number;
 
  @Column({ comment: '图片', type: 'json', nullable: true })
  images: string[];
}