Merge pull request #13 from Selly-Modules/update-struct-query
Update struct query
This commit is contained in:
commit
3c3d09940c
|
@ -6,6 +6,11 @@ const (
|
||||||
SubjectRequestProductSkuSearch = "selly.request.product_sku.search"
|
SubjectRequestProductSkuSearch = "selly.request.product_sku.search"
|
||||||
SubjectRequestProductSkuCreateIndex = "selly.request.product_sku.create_index"
|
SubjectRequestProductSkuCreateIndex = "selly.request.product_sku.create_index"
|
||||||
|
|
||||||
|
SubjectRequestShopProductUpsert = "selly.request.shop_product.upsert"
|
||||||
|
SubjectPullShopProductUpsert = "selly.pull.shop_product.upsert"
|
||||||
|
SubjectRequestShopProductSearch = "selly.request.shop_product.search"
|
||||||
|
SubjectRequestShopProductCreateIndex = "selly.request.shop_product.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"
|
||||||
|
|
5
pull.go
5
pull.go
|
@ -28,3 +28,8 @@ func (Pull) KeywordUpsert(payload Payload) (bool, error) {
|
||||||
func (Pull) ProductSkuUpsert(payload Payload) (bool, error) {
|
func (Pull) ProductSkuUpsert(payload Payload) (bool, error) {
|
||||||
return publishWithJetStream(JetStreamSearchService, SubjectPullProductSkuUpsert, toBytes(payload))
|
return publishWithJetStream(JetStreamSearchService, SubjectPullProductSkuUpsert, toBytes(payload))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProductShopUpsert ...
|
||||||
|
func (Pull) ProductShopUpsert(payload Payload) (bool, error) {
|
||||||
|
return publishWithJetStream(JetStreamSearchService, SubjectPullShopProductUpsert, toBytes(payload))
|
||||||
|
}
|
||||||
|
|
15
request.go
15
request.go
|
@ -4,6 +4,21 @@ package elasticsearch
|
||||||
type Request struct {
|
type Request struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProductShopSearch ...
|
||||||
|
func (Request) ProductShopSearch(query ESQuery) (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestShopProductSearch, toBytes(query))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProductShopUpsert ...
|
||||||
|
func (Request) ProductShopUpsert(payload Payload) (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestShopProductUpsert, toBytes(payload))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProductShopCreateIndex ...
|
||||||
|
func (Request) ProductShopCreateIndex() (*Response, error) {
|
||||||
|
return requestNats(SubjectRequestShopProductCreateIndex, toBytes(Payload{}))
|
||||||
|
}
|
||||||
|
|
||||||
// ProductSkuSearch ...
|
// ProductSkuSearch ...
|
||||||
func (Request) ProductSkuSearch(query ESQuery) (*Response, error) {
|
func (Request) ProductSkuSearch(query ESQuery) (*Response, error) {
|
||||||
return requestNats(SubjectRequestProductSkuSearch, toBytes(query))
|
return requestNats(SubjectRequestProductSkuSearch, toBytes(query))
|
||||||
|
|
|
@ -43,6 +43,8 @@ type ESQuery struct {
|
||||||
Keyword string
|
Keyword string
|
||||||
ProvinceCode int
|
ProvinceCode int
|
||||||
Active string
|
Active string
|
||||||
|
Display string
|
||||||
|
ShopID string
|
||||||
IsOutOfStock string
|
IsOutOfStock string
|
||||||
CanIssueInvoice string
|
CanIssueInvoice string
|
||||||
PendingInactive string
|
PendingInactive string
|
||||||
|
|
Loading…
Reference in New Issue