From e232f8d9d56fc092f83e1b6c9a450e72f5049d6a Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 16 Sep 2022 16:52:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A1=A5=E9=BD=90=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/sku/sale.go | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) 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 +} From 083217cca174350570e436c5ebb99ddaea4eaa47 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 16 Sep 2022 17:41:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/sku/type.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 }