From e27dfb1b3f58e7a2786cabfbf38211194e95896b Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 6 May 2024 09:40:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/order.go | 4 +--- supply/channel/sku.go | 25 +++++++++++++++++++++++-- supply/sku.go | 2 ++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/supply/channel/order.go b/supply/channel/order.go index 51932b8..9bee41a 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -196,9 +196,9 @@ type ArgsOrderLists struct { } type OrderItem struct { - OrderId uint `json:"orderId"` OrderSn string `json:"orderSn"` RootOrderSn string `json:"rootOrderSn"` + ChannelOrderSn string `json:"channelOrderSn"` ReceiverName string `json:"receiverName"` ReceiverMobile string `json:"receiverMobile"` Address string `json:"address"` @@ -218,7 +218,6 @@ type OrderItem struct { } type OrderSku struct { - Id uint `json:"id"` SkuId uint `json:"skuId"` Name string `json:"name"` Price decimal.Decimal `json:"price"` @@ -275,7 +274,6 @@ type OrderReceiver struct { UserIp string `json:"userIp"` } type OrderDetailSku struct { - Id uint `json:"id"` Quantity uint `json:"quantity"` SkuId uint `json:"skuId"` Price decimal.Decimal `json:"price"` diff --git a/supply/channel/sku.go b/supply/channel/sku.go index 6a6fd8c..80fe199 100644 --- a/supply/channel/sku.go +++ b/supply/channel/sku.go @@ -6,6 +6,7 @@ import ( "git.oa00.com/supply-chain/service/lib/bean" "github.com/shopspring/decimal" "github.com/smallnest/rpcx/share" + "time" ) type sku struct { @@ -58,11 +59,13 @@ type SkuItem struct { CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` Highlight SkuItemHighlight `json:"highlight"` + Tag []string `json:"tag"` } type ReplySkuList struct { - Lists []SkuItem `json:"lists"` - Total int64 `json:"total"` + Lists []SkuItem `json:"lists"` + Total int64 `json:"total"` + ScrollId string `json:"scrollId"` } // Lists @Title 商品列表 @@ -98,12 +101,14 @@ type SkuEsSearch struct { Source uint // 所属供应商 ThirdCategoryIds []uint // 三级分类Ids TagIds []uint // 标签Ids + Tag []string // 标签 OrderType uint // 排序类型 OrderSort uint // 排序顺序 } type SkuEsConfig struct { Highlight bool + Scroll time.Duration } type ArgsSkuListsEs struct { Search SkuEsSearch @@ -121,6 +126,21 @@ func (s *sku) ListsEs(ctx context.Context, channelId string, args ArgsSkuListsEs return } +type ArgsSkuListsEsScroll struct { + Scroll time.Duration // 缓存时间 + ScrollId string // 滚动标记id +} + +// ListsEsScroll @Title es商品列表 目前最大10000条数据,超出不显示 +func (s *sku) ListsEsScroll(ctx context.Context, channelId string, args ArgsSkuListsEsScroll) (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}), "ListsEsScroll", args, &reply) + return +} + type ArgsSkuDetails struct { SkuIds []uint // sku数组 } @@ -154,6 +174,7 @@ type SkuDetailItem struct { Imgs []SkuImg `json:"imgs"` Specifications []SkuSpecification `json:"specifications"` GroupSkuIds []uint `json:"groupSkuIds"` + Tag []string `json:"tag"` } type SkuImg struct { Path string `json:"path"` diff --git a/supply/sku.go b/supply/sku.go index 9260789..c9e6a64 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -61,6 +61,7 @@ type ArgsSkuAdd struct { Content string // 商品详情 Imgs []SkuImg // 商品图片 第一张主图 Specifications []SkuSpecification // 商品参数信息 + Tag []string // 标签 } type SkuImg struct { @@ -367,6 +368,7 @@ type ArgsSkuChangeData struct { Source source // 商品来源 Imgs []string // 商品图片 第一张主图 Specifications []SkuSpecification // 商品参数信息 + Tag []string // 标签 } // ChangeData @Title 更新商品信息