From de92d9368b7c3fc1142eacebffac9a9d5237035a Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 31 Aug 2022 10:16:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=B9=E9=87=8F=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=BA=9F=E5=BC=83=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/goods.go | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/supplier/goods.go b/supplier/goods.go index 1fc0b2a..fadfe08 100644 --- a/supplier/goods.go +++ b/supplier/goods.go @@ -7,12 +7,6 @@ import ( "github.com/shopspring/decimal" ) -const ( - SkuStatusNone = 1 // 待处理 - SkuStatusAdopt = 2 // 同步入库 - SkuStatusReject = 3 // 废弃商品 -) - type goods struct { } type GoodsSearch struct { @@ -133,22 +127,29 @@ func (g *goods) GetImgs(ctx context.Context, goodsId uint) (reply []string, err return } -// DownShelves @Title 获取商品主图 -func (g *goods) DownShelves(ctx context.Context, goodsIds []uint) (err error) { +type AdoptItem struct { + Id uint `json:"id"` + GoodsNum string `json:"goodsNum"` + Name string `json:"name"` + Error string `json:"error"` +} + +// Adopt @Title 批量入库 +func (g *goods) Adopt(ctx context.Context, goodsIds []uint) (reply []AdoptItem, err error) { xClient, err := client.GetClient(g) if err != nil { return } - reply := 0 - return xClient.Call(ctx, "DownShelves", goodsIds, &reply) + err = xClient.Call(ctx, "Adopt", goodsIds, &reply) + return } -// OnShelves @Title 获取商品主图 -func (g *goods) OnShelves(ctx context.Context, goodsIds []uint) (err error) { +// Discard @Title 批量废弃 +func (g *goods) Discard(ctx context.Context, goodsIds []uint) (reply []AdoptItem, err error) { xClient, err := client.GetClient(g) if err != nil { return } - reply := 0 - return xClient.Call(ctx, "OnShelves", goodsIds, &reply) + err = xClient.Call(ctx, "Discard", goodsIds, &reply) + return }