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 +}