zhangqian
2023-08-29 d3a78e4c791821b298075b700e9fc14030d12ec2
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
package test
 
import (
    "srm/global"
)
 
// Product 结构体
type Product struct {
    global.GVA_MODEL
    Name             string   `json:"name" form:"name" gorm:"column:name;comment:名称;size:255;"`
    Number           string   `json:"number" form:"number" gorm:"column:number;comment:编码;size:255;"`
    SupplierId       uint     `json:"supplierId" form:"supplierId" gorm:"column:supplier_id;comment:供应商id;size:255;"`
    Supplier         Supplier `json:"supplier" form:"supplier" gorm:"foreignKey:SupplierId;references:ID;comment:供应商"`
    Unit             string   `json:"unit" form:"unit" gorm:"column:unit;comment:计量单位;size:255;"`
    PurchasePrice    *float64 `json:"purchasePrice" form:"purchasePrice" gorm:"column:purchase_price;comment:采购价格;"`
    DeliveryTime     *int     `json:"deliveryTime" form:"deliveryTime" gorm:"column:delivery_time;comment:;size:11;"`
    ShippingDuration *int     `json:"shippingDuration" form:"shippingDuration" gorm:"column:shipping_duration;comment:物流时长;size:11;"`
    Specifications   string   `json:"specifications" form:"specifications" gorm:"column:specifications;comment:规格;size:255;"`
    ModelNumber      string   `json:"modelNumber" form:"modelNumber" gorm:"column:model_number;comment:型号;size:255;"`
    ProductType      string   `json:"productType" form:"productType" gorm:"column:product_type;comment:产品类别;size:255;"`
    MinimumStock     *int     `json:"minimumStock" form:"minimumStock" gorm:"column:minimum_stock;comment:最低库存;"`
    MaximumStock     *int     `json:"maximumStock" form:"maximumStock" gorm:"column:maximum_stock;comment:最高库存;"`
    Remark           string   `json:"remark" form:"remark" gorm:"column:remark;comment:备注;size:255;"`
}
 
// TableName Product 表名
func (Product) TableName() string {
    return "Product"
}