V1 #7

Merged
trunglt251292 merged 5 commits from v1 into master 2022-04-18 07:41:39 +00:00
2 changed files with 34 additions and 17 deletions
Showing only changes of commit eb2d9fe754 - Show all commits

View File

@ -4,20 +4,22 @@ const (
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"
SubjectRequestProductCreateIndex = "selly.request.product.create_index"
SubjectRequestOrderUpsert = "selly.request.order.upsert" SubjectRequestOrderUpsert = "selly.request.order.upsert"
SubjectPullOrderUpsert = "selly.pull.order.upsert" SubjectPullOrderUpsert = "selly.pull.order.upsert"
SubjectRequestOrderSearch = "selly.request.order.search" SubjectRequestOrderSearch = "selly.request.order.search"
SubjectRequestOrderCreateIndex = "selly.request.order.create_index"
SubjectRequestUserUpsert = "selly.request.user.upsert"
SubjectPullUserUpsert = "selly.pull.user.upsert"
SubjectRequestUserSearch = "selly.request.user.search"
SubjectRequestKeywordUpsert = "selly.request.keyword.upsert" SubjectRequestKeywordUpsert = "selly.request.keyword.upsert"
SubjectPullKeywordUpsert = "selly.pull.keyword.upsert" SubjectPullKeywordUpsert = "selly.pull.keyword.upsert"
SubjectRequestKeywordSearch = "selly.request.keyword.search" SubjectRequestKeywordSearch = "selly.request.keyword.search"
SubjectRequestKeywordCreateIndex = "selly.request.order.create_index"
SubjectRequestCreateIndex = "selly.request.es.create_index" SubjectRequestUserUpsert = "selly.request.user.upsert"
SubjectPullUserUpsert = "selly.pull.user.upsert"
SubjectRequestUserSearch = "selly.request.user.search"
SubjectRequestUserCreateIndex = "selly.request.user.create_index"
) )
const ( const (

View File

@ -14,6 +14,11 @@ func (Request) ProductUpsert(payload Payload) (*Response, error) {
return requestNats(SubjectRequestProductUpsert, toBytes(payload)) return requestNats(SubjectRequestProductUpsert, toBytes(payload))
} }
// ProductCreateIndex ...
func (Request) ProductCreateIndex() (*Response, error) {
return requestNats(SubjectRequestProductCreateIndex, toBytes(Payload{}))
}
// UserSearch ... // UserSearch ...
func (Request) UserSearch(query ESQuery) (*Response, error) { func (Request) UserSearch(query ESQuery) (*Response, error) {
return requestNats(SubjectRequestUserSearch, toBytes(query)) return requestNats(SubjectRequestUserSearch, toBytes(query))
@ -24,6 +29,11 @@ func (Request) UserUpsert(payload Payload) (*Response, error) {
return requestNats(SubjectRequestUserUpsert, toBytes(payload)) return requestNats(SubjectRequestUserUpsert, toBytes(payload))
} }
// UserCreateIndex ...
func (Request) UserCreateIndex() (*Response, error) {
return requestNats(SubjectRequestUserCreateIndex, toBytes(Payload{}))
}
// OrderSearch ... // OrderSearch ...
func (Request) OrderSearch(query ESQuery) (*Response, error) { func (Request) OrderSearch(query ESQuery) (*Response, error) {
return requestNats(SubjectRequestOrderSearch, toBytes(query)) return requestNats(SubjectRequestOrderSearch, toBytes(query))
@ -34,6 +44,11 @@ func (Request) OrderUpsert(payload Payload) (*Response, error) {
return requestNats(SubjectRequestOrderUpsert, toBytes(payload)) return requestNats(SubjectRequestOrderUpsert, toBytes(payload))
} }
// OrderCreateIndex ...
func (Request) OrderCreateIndex() (*Response, error) {
return requestNats(SubjectRequestOrderCreateIndex, toBytes(Payload{}))
}
// KeywordSearch ... // KeywordSearch ...
func (Request) KeywordSearch(query ESQuery) (*Response, error) { func (Request) KeywordSearch(query ESQuery) (*Response, error) {
return requestNats(SubjectRequestKeywordSearch, toBytes(query)) return requestNats(SubjectRequestKeywordSearch, toBytes(query))
@ -44,7 +59,7 @@ func (Request) KeywordUpsert(payload Payload) (*Response, error) {
return requestNats(SubjectRequestKeywordUpsert, toBytes(payload)) return requestNats(SubjectRequestKeywordUpsert, toBytes(payload))
} }
// CreateIndex ... // KeywordCreateIndex ...
func (Request) CreateIndex(payload Payload) (*Response, error) { func (Request) KeywordCreateIndex() (*Response, error) {
return requestNats(SubjectRequestCreateIndex, toBytes(payload)) return requestNats(SubjectRequestKeywordCreateIndex, toBytes(Payload{}))
} }