From 34c61ccfcc7d2ab95cd27969f54ed0a0eb460190 Mon Sep 17 00:00:00 2001 From: trunglt251292 Date: Tue, 20 Sep 2022 10:56:45 +0700 Subject: [PATCH 1/2] [Update] --- client/news.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/news.go b/client/news.go index 162162d..4167c0a 100644 --- a/client/news.go +++ b/client/news.go @@ -8,8 +8,16 @@ import ( "github.com/Selly-Modules/natsio/subject" ) +// News ... +type News struct{} + +// GetNews ... +func GetNews() News { + return News{} +} + // GetProductNoticesByInventory ... -func (w Warehouse) GetProductNoticesByInventory(p model.GetProductNoticesByInventoryRequest) (*model.GetProductNoticesByInventoryResponse, error) { +func (n News) GetProductNoticesByInventory(p model.GetProductNoticesByInventoryRequest) (*model.GetProductNoticesByInventoryResponse, error) { msg, err := natsio.GetServer().Request(subject.News.GetProductNoticesByInventory, bsonToBytes(p)) if err != nil { return nil, err From 4452be147432ae722cf941b3b7b223ee0af0d7c0 Mon Sep 17 00:00:00 2001 From: trunglt251292 Date: Tue, 20 Sep 2022 13:49:58 +0700 Subject: [PATCH 2/2] [Update] Add subjects --- subject/news.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subject/news.go b/subject/news.go index 3e96d25..bfec6cf 100644 --- a/subject/news.go +++ b/subject/news.go @@ -3,7 +3,7 @@ package subject import "fmt" func getNewsValue(val string) string { - return fmt.Sprintf("%s.%s", prefixes.Order, val) + return fmt.Sprintf("%s.%s", prefixes.News, val) } var News = struct {