[Update] product sku #11

Merged
trunglt251292 merged 1 commits from add-index-sku into master 2022-04-28 08:57:35 +00:00
4 changed files with 27 additions and 0 deletions
Showing only changes of commit 3c44b21812 - Show all commits

View File

@ -1,6 +1,11 @@
package elasticsearch package elasticsearch
const ( 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" SubjectRequestProductUpsert = "selly.request.product.upsert"
SubjectPullProductUpsert = "selly.pull.product.upsert" SubjectPullProductUpsert = "selly.pull.product.upsert"
SubjectRequestProductSearch = "selly.request.product.search" 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) { func (Pull) KeywordUpsert(payload Payload) (bool, error) {
return publishWithJetStream(JetStreamSearchService, SubjectPullKeywordUpsert, toBytes(payload)) 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 { 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 ... // ProductSearch ...
func (Request) ProductSearch(query ESQuery) (*Response, error) { func (Request) ProductSearch(query ESQuery) (*Response, error) {
return requestNats(SubjectRequestProductSearch, toBytes(query)) return requestNats(SubjectRequestProductSearch, toBytes(query))

View File

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