From 0d86d93cff554f54f83927d4f8bf03ed8c847883 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期二, 29 八月 2023 17:14:54 +0800 Subject: [PATCH] fix&字段完善 --- model/purchase/response/purchase.go | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/model/purchase/response/purchase.go b/model/purchase/response/purchase.go index dad6b28..2588e67 100644 --- a/model/purchase/response/purchase.go +++ b/model/purchase/response/purchase.go @@ -1,8 +1,28 @@ package response -import "srm/model/purchase" +import ( + "github.com/shopspring/decimal" + "srm/model/purchase" +) type PurchaseResponse struct { - Purchase purchase.Purchase `json:"purchase"` - ProductList []*purchase.PurchaseProducts `json:"productList"` + Purchase purchase.Purchase `json:"purchase"` + ProductList []*PurchaseProducts `json:"productList"` +} + +type PurchaseProducts struct { + PurchaseId int `json:"purchaseId" form:"purchaseType" gorm:"type:int(11);not null;default 0;comment:閲囪喘绫诲瀷id"` // 閲囪喘id + ProductId int `json:"productId" form:"supplierId" gorm:"type:int(11);not null;default 0;comment:渚涘簲鍟唅d"` // 浜у搧id + Amount decimal.Decimal `json:"amount" form:"amount" gorm:"type:decimal(12,2);not null;default 0;comment:閲囪喘鏁伴噺"` // 閲囪喘鏁伴噺 + Price decimal.Decimal `json:"price" form:"price" gorm:"type:decimal(12,2);not null;default 0.00;comment:閲囪喘鍗曚环"` // 閲囪喘鍗曚环 + Total decimal.Decimal `json:"total" form:"total" gorm:"type:decimal(12,2);not null;default 0.00;comment:閲囪喘鎬讳环"` // 閲囪喘鎬讳环 + Name string `json:"name" form:"name" gorm:"column:name;comment:鍚嶇О;size:255;"` + Number string `json:"number" form:"number" gorm:"column:number;comment:缂栫爜;size:255;"` + 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;"` } -- Gitblit v1.8.0