[Update] Define method #5

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

View File

@ -12,6 +12,10 @@ const (
SubjectRequestUserUpsert = "selly.request.user.upsert"
SubjectPullUserUpsert = "selly.pull.user.upsert"
SubjectRequestUserSearch = "selly.request.user.search"
SubjectRequestKeywordUpsert = "selly.request.keyword.upsert"
SubjectPullKeywordUpsert = "selly.pull.keyword.upsert"
SubjectRequestKeywordSearch = "selly.request.keyword.search"
)
const (

View File

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

View File

@ -33,3 +33,13 @@ func (Request) OrderSearch(query ESQuery) (*Response, error) {
func (Request) OrderUpsert(payload Payload) (*Response, error) {
return requestNats(SubjectRequestOrderUpsert, toBytes(payload))
}
// KeywordSearch ...
func (Request) KeywordSearch(query ESQuery) (*Response, error) {
return requestNats(SubjectRequestKeywordSearch, toBytes(query))
}
// KeywordUpsert ...
func (Request) KeywordUpsert(payload Payload) (*Response, error) {
return requestNats(SubjectRequestKeywordUpsert, toBytes(payload))
}