[Update] Define method #5

Merged
trunglt251292 merged 10 commits from v1 into master 2022-03-24 09:49:54 +00:00
2 changed files with 9 additions and 9 deletions
Showing only changes of commit 5e7a5ee2c7 - Show all commits

View File

@ -5,16 +5,16 @@ type Pull struct {
} }
// ProductUpsert ... // ProductUpsert ...
func (r Pull) ProductUpsert(query UpdateDataPayload) (bool, error) { func (Pull) ProductUpsert(query UpdateDataPayload) (bool, error) {
return publishWithJetStream(JetStreamSearchService, SubjectPullProductUpsert, toBytes(query)) return publishWithJetStream(JetStreamSearchService, SubjectPullProductUpsert, toBytes(query))
} }
// UserUpsert ... // UserUpsert ...
func (r Pull) UserUpsert(query UpdateDataPayload) (bool, error) { func (Pull) UserUpsert(query UpdateDataPayload) (bool, error) {
return publishWithJetStream(JetStreamSearchService, SubjectPullUserUpsert, toBytes(query)) return publishWithJetStream(JetStreamSearchService, SubjectPullUserUpsert, toBytes(query))
} }
// OrderUpsert ... // OrderUpsert ...
func (r Pull) OrderUpsert(query UpdateDataPayload) (bool, error) { func (Pull) OrderUpsert(query UpdateDataPayload) (bool, error) {
return publishWithJetStream(JetStreamSearchService, SubjectPullOrderUpsert, toBytes(query)) return publishWithJetStream(JetStreamSearchService, SubjectPullOrderUpsert, toBytes(query))
} }

View File

@ -5,31 +5,31 @@ type Request struct {
} }
// ProductSearch ... // ProductSearch ...
func (r Request) ProductSearch(query ESQuery) (*Response, error) { func (Request) ProductSearch(query ESQuery) (*Response, error) {
return requestNats(SubjectRequestProductSearch, toBytes(query)) return requestNats(SubjectRequestProductSearch, toBytes(query))
} }
// ProductUpsert ... // ProductUpsert ...
func (r Request) ProductUpsert(query UpdateDataPayload) (*Response, error) { func (Request) ProductUpsert(query UpdateDataPayload) (*Response, error) {
return requestNats(SubjectRequestProductUpsert, toBytes(query)) return requestNats(SubjectRequestProductUpsert, toBytes(query))
} }
// UserSearch ... // UserSearch ...
func (r Request) UserSearch(query ESQuery) (*Response, error) { func (Request) UserSearch(query ESQuery) (*Response, error) {
return requestNats(SubjectRequestUserSearch, toBytes(query)) return requestNats(SubjectRequestUserSearch, toBytes(query))
} }
// UserUpsert ... // UserUpsert ...
func (r Request) UserUpsert(query UpdateDataPayload) (*Response, error) { func (Request) UserUpsert(query UpdateDataPayload) (*Response, error) {
return requestNats(SubjectRequestUserUpsert, toBytes(query)) return requestNats(SubjectRequestUserUpsert, toBytes(query))
} }
// OrderSearch ... // OrderSearch ...
func (r Request) OrderSearch(query ESQuery) (*Response, error) { func (Request) OrderSearch(query ESQuery) (*Response, error) {
return requestNats(SubjectRequestOrderSearch, toBytes(query)) return requestNats(SubjectRequestOrderSearch, toBytes(query))
} }
// OrderUpsert ... // OrderUpsert ...
func (r Request) OrderUpsert(query UpdateDataPayload) (*Response, error) { func (Request) OrderUpsert(query UpdateDataPayload) (*Response, error) {
return requestNats(SubjectRequestOrderUpsert, toBytes(query)) return requestNats(SubjectRequestOrderUpsert, toBytes(query))
} }