|
|
|
@ -119,6 +119,24 @@ func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImg, err erro
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SkusImg struct {
|
|
|
|
|
Id uint `json:"id"`
|
|
|
|
|
SkuId uint `json:"skuId"`
|
|
|
|
|
Path string `json:"path"`
|
|
|
|
|
ReplacePath string `json:"replacePath"`
|
|
|
|
|
Sort uint `json:"sort"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetSkusImgs @Title 批量获取预览图
|
|
|
|
|
func (s *sku) GetSkusImgs(ctx context.Context, skuId uint) (reply []SkusImg, err error) {
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
err = xClient.Call(ctx, "GetSkusImgs", skuId, &reply)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SkuSpecification struct {
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Attributes []SkuAttribute `json:"attributes"`
|
|
|
|
@ -188,3 +206,19 @@ func (s *sku) Adopt(ctx context.Context, skuIds []uint) (reply []AdoptItem, err
|
|
|
|
|
err = xClient.Call(ctx, "Adopt", skuIds, &reply)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ArgsSkuReplaceImg struct {
|
|
|
|
|
SkuId uint // 商品id
|
|
|
|
|
ImgId uint // 图片id
|
|
|
|
|
ImgPath string // 图片路径
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ReplaceImg @Title 替换图片
|
|
|
|
|
func (s *sku) ReplaceImg(ctx context.Context, args ArgsSkuReplaceImg) error {
|
|
|
|
|
reply := 0
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
return xClient.Call(ctx, "ReplaceImg", args, &reply)
|
|
|
|
|
}
|
|
|
|
|