[Update] product sku

This commit is contained in:
trunglt251292 2022-04-28 10:59:43 +07:00
parent e02715e8e1
commit 3c44b21812
4 changed files with 27 additions and 0 deletions

View File

@ -1,6 +1,11 @@
package elasticsearch
const (
SubjectRequestProductSkuUpsert = "selly.request.product_sku.upsert"
SubjectPullProductSkuUpsert = "selly.pull.product_sku.upsert"
SubjectRequestProductSkuSearch = "selly.request.product_sku.search"
SubjectRequestProductSkuCreateIndex = "selly.request.product_sku.create_index"
SubjectRequestProductUpsert = "selly.request.product.upsert"
SubjectPullProductUpsert = "selly.pull.product.upsert"
SubjectRequestProductSearch = "selly.request.product.search"

View File

@ -23,3 +23,8 @@ func (Pull) OrderUpsert(payload Payload) (bool, error) {
func (Pull) KeywordUpsert(payload Payload) (bool, error) {
return publishWithJetStream(JetStreamSearchService, SubjectPullKeywordUpsert, toBytes(payload))
}
// ProductSkuUpsert ...
func (Pull) ProductSkuUpsert(payload Payload) (bool, error) {
return publishWithJetStream(JetStreamSearchService, SubjectPullProductSkuUpsert, toBytes(payload))
}

View File

@ -4,6 +4,21 @@ package elasticsearch
type Request struct {
}
// ProductSkuSearch ...
func (Request) ProductSkuSearch(query ESQuery) (*Response, error) {
return requestNats(SubjectRequestProductSkuSearch, toBytes(query))
}
// ProductSkuUpsert ...
func (Request) ProductSkuUpsert(payload Payload) (*Response, error) {
return requestNats(SubjectRequestProductSkuUpsert, toBytes(payload))
}
// ProductSkuCreateIndex ...
func (Request) ProductSkuCreateIndex() (*Response, error) {
return requestNats(SubjectRequestProductSkuCreateIndex, toBytes(Payload{}))
}
// ProductSearch ...
func (Request) ProductSearch(query ESQuery) (*Response, error) {
return requestNats(SubjectRequestProductSearch, toBytes(query))

View File

@ -93,6 +93,8 @@ type ESQuery struct {
Invitee string
Segments []string
IsOrderMerchant bool
ImportHistory string
IsSetup string
}
// ESSort