From 166b9f6dce7bae72bdeff94e66240f9d7082d68e Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 10 Oct 2022 13:59:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/sku.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/supply/channel/sku.go b/supply/channel/sku.go index 4eaa6b4..5914407 100644 --- a/supply/channel/sku.go +++ b/supply/channel/sku.go @@ -32,6 +32,7 @@ type SkuItem struct { ThirdCategoryId uint `json:"thirdCategoryId"` ThirdCategoryName string `json:"thirdCategoryName"` Price decimal.Decimal `json:"price"` + Discount decimal.Decimal `json:"discount"` GuidePrice decimal.Decimal `json:"guidePrice"` ImgUrl string `json:"imgUrl"` Profit decimal.Decimal `json:"profit"` @@ -62,6 +63,37 @@ func (s *sku) Lists(ctx context.Context, channelId string, args ArgsSkuList) (re return } +type SkuEsSearch struct { + Status uint // 1=上架 2=下架 + SkuName string // 商品名称 + BrandId uint // 品牌id + BrandName string // 品牌名称 全词匹配 + FirstCategoryId uint // 一级分类id + FirstCategoryName string // 一级分类名称 全词匹配 + SecondCategoryId uint // 二级分类id + SecondCategoryName string // 二级分类名称 全词匹配 + ThirdCategoryId uint // 三级分类id + ThirdCategoryName string // 三级分类名称 全词匹配 + MaxPrice decimal.Decimal // 最高金额 + MinPrice decimal.Decimal // 最低金额 + MinDiscount decimal.Decimal // 最低折扣 + MaxDiscount decimal.Decimal // 最高折扣 +} +type ArgsSkuListsEs struct { + Search SkuEsSearch + Page bean.Page +} + +// ListsEs @Title es商品列表 目前最大10000条数据,超出不显示 +func (s *sku) ListsEs(ctx context.Context, channelId string, args ArgsSkuListsEs) (reply ReplySkuList, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "ListsEs", args, &reply) + return +} + type ArgsSkuDetails struct { SkuIds []uint // sku数组 }