From b162c6d421ca85475d52e28803c1de40000071c1 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 23 Feb 2023 09:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/skuTag.go | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/supply/skuTag.go b/supply/skuTag.go index cd99988..30cf199 100644 --- a/supply/skuTag.go +++ b/supply/skuTag.go @@ -3,16 +3,17 @@ package supply import ( "context" "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" ) type skuTag struct { } type ArgsSkuTagAdds struct { SkuIds []uint // skuIds - TagIds []uint // tagIds + TagId uint // tagId } -// Adds @Title 添加标签 +// Adds @Title 添加商品 func (s *skuTag) Adds(ctx context.Context, args ArgsSkuTagAdds) error { reply := 0 xClient, err := client.GetClient(s) @@ -23,16 +24,42 @@ func (s *skuTag) Adds(ctx context.Context, args ArgsSkuTagAdds) error { } type ArgsSkuTagDel struct { - SkuId uint // skuId - TagIds []uint // tagIds + SkuIds []uint // skuIds + TagId []uint // tagId } -// Del @Title 删除标签 -func (s *skuTag) Del(ctx context.Context, args ArgsSkuTagDel) error { +// Dels @Title 删除商品 +func (s *skuTag) Dels(ctx context.Context, args ArgsSkuTagDel) error { reply := 0 xClient, err := client.GetClient(s) if err != nil { return err } - return xClient.Call(ctx, "Del", args, &reply) + return xClient.Call(ctx, "Dels", args, &reply) +} + +type ArgsTagSkuLists struct { + TagId uint + Page bean.Page +} + +type TagSkuItem struct { + Id uint `json:"id"` + SkuId uint `json:"skuId"` + SkuName string `json:"skuName"` +} + +type ReplyTagSkuLists struct { + Total int64 `json:"total"` + Lists []TagSkuItem `json:"lists"` +} + +// SkuLists @Title 标签商品列表 +func (s *skuTag) SkuLists(ctx context.Context, args ArgsTagSkuLists) (reply ReplyTagSkuLists, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "SkuLists", args, &reply) + return }