From 4b1c825e77bc102cfb5c4794ca53e943107fe964 Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 10 Aug 2022 13:53:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/sku.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/supply/sku.go b/supply/sku.go index ccd360e..f6e5a15 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -60,6 +60,7 @@ type ArgsSkuAdd struct { } type SkuImg struct { + Id uint `json:"id"` Path string `json:"path"` } @@ -224,3 +225,28 @@ func (s *sku) DownShelves(ctx context.Context, args ArgsSkuDownShelves) error { } return xClient.Call(ctx, "DownShelves", args, &reply) } + +// GetImgs @Title 获取预览图 +func (s *sku) GetImgs(ctx context.Context, skuId uint) error { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + return xClient.Call(ctx, "GetImgs", skuId, &reply) +} + +type ArgsReplaceImg struct { + Id uint + ReplacePath string +} + +// ReplaceImg @Title 替换图片 +func (s *sku) ReplaceImg(ctx context.Context, args ArgsReplaceImg) (reply []SkuImg, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "ReplaceImg", args, &reply) + return +}