diff --git a/customer/sku/sale.go b/customer/sku/sale.go index c4983c3..61b16a8 100644 --- a/customer/sku/sale.go +++ b/customer/sku/sale.go @@ -1,5 +1,11 @@ package sku +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" +) + type sale struct { } @@ -8,6 +14,26 @@ type SaleHandleItem struct { Error string `json:"error"` } +// Add @Title 添加 +func (s *sale) Add(ctx context.Context, skuIds []uint) (reply []SaleSkuItem, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "Add", skuIds, &reply) + return +} + +// Lists @Title 商品列表 +func (s *sale) Lists(ctx context.Context, page bean.Page) (reply ReplySaleSkuItemLists, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return ReplySaleSkuItemLists{}, err + } + err = xClient.Call(ctx, "Lists", page, &reply) + return +} + type ReplySaleSkuItemLists struct { Total int64 `json:"total"` Lists []SaleSkuItem `json:"lists"` @@ -17,3 +43,34 @@ type SaleSkuItem struct { Id uint `json:"id"` SkuId uint `json:"skuId"` } + +// Del @Title 删除商品 +func (s *sale) Del(ctx context.Context, ids []uint) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Del", ids, &reply) +} + +// SetImg @Title 设置区域导图 +func (s *sale) SetImg(ctx context.Context, path string) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "SetImg", path, &reply) +} + +// GetImg @Title 获取区域导图 +func (s *sale) GetImg(ctx context.Context) (reply string, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return "", err + } + args := 0 + err = xClient.Call(ctx, "GetImg", args, &reply) + return +} diff --git a/customer/sku/type.go b/customer/sku/type.go index d263a88..09835cd 100644 --- a/customer/sku/type.go +++ b/customer/sku/type.go @@ -49,11 +49,12 @@ type TypeItem struct { } // All @Title 全部分类 -func (s *skuType) All(ctx context.Context, id uint) (reply []TypeItem, err error) { +func (s *skuType) All(ctx context.Context) (reply []TypeItem, err error) { xClient, err := client.GetClient(s) if err != nil { return nil, err } - err = xClient.Call(ctx, "All", id, &reply) + args := 0 + err = xClient.Call(ctx, "All", args, &reply) return }