From d6a7b4655c22eecf475529f0c53c3d4719b73e0e Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 30 Aug 2022 17:43:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/goods.go | 55 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/supplier/goods.go b/supplier/goods.go index 2f89753..c2c3867 100644 --- a/supplier/goods.go +++ b/supplier/goods.go @@ -78,21 +78,60 @@ type ArgsGoodsInfo struct { SkuId uint } +//type ReplyGoodsInfo struct { +// Id uint +// Name string +// GoodsNum string +// BrandId uint +// BrandName string +// CategoryId uint +//} + type ReplyGoodsInfo struct { - Id uint - Name string - GoodsNum string - BrandId uint - BrandName string - CategoryId uint + Id uint `json:"id"` + Name string `json:"name"` + SupplierId uint `json:"supplierId"` + CategoryId uint `json:"categoryId"` + BrandId uint `json:"brandId"` + Imgs []string `json:"imgs"` + Content string `json:"content"` + Attributes []GoodsAttributeGroup `json:"attributes"` + Skus []SkuItem `json:"skus"` + Status uint `json:"status"` +} + +type GoodsAttributeGroup struct { + Name string `json:"name"` + Item []GoodsAttributeItem `json:"item"` +} + +type GoodsAttributeItem struct { + Name string `json:"name"` + Value string `json:"value"` +} + +type SkuSpecItem struct { + Name string `json:"name"` + Value string `json:"value"` +} + +type SkuItem struct { + Color string `json:"color"` + Size string `json:"size"` + SupplyPrice decimal.Decimal `json:"supplyPrice"` + MarketPrice decimal.Decimal `json:"marketPrice"` + UpcCode string `json:"upcCode"` + UintId uint `json:"uintId"` + TaxCategoryId uint `json:"taxCategoryId"` + Tax decimal.Decimal `json:"tax"` } // Info @Title 商品详情 -func (g *goods) Info(ctx context.Context, skuId uint) (reply uint, err error) { +func (g *goods) Info(ctx context.Context, goodsId uint) (reply ReplyGoodsInfo, err error) { xClient, err := client.GetClient(g) if err != nil { return } - err = xClient.Call(ctx, "Info", skuId, &reply) + err = xClient.Call(ctx, "Info", goodsId, &reply) return }