From f80f89e79396a477b721814ac8be0e19922d4928 Mon Sep 17 00:00:00 2001 From: Nguyen Minh Date: Fri, 23 Sep 2022 11:17:03 +0700 Subject: [PATCH] jestream --- jestream/config.go | 8 -------- jestream/notification.go | 8 -------- .../model/selly.go | 8 ++++---- js/subject/config.go | 10 ++++++++++ js/subject/selly.go | 19 +++++++++++++++++++ 5 files changed, 33 insertions(+), 20 deletions(-) delete mode 100644 jestream/config.go delete mode 100644 jestream/notification.go rename model/notification_request.go => js/model/selly.go (68%) create mode 100644 js/subject/config.go create mode 100644 js/subject/selly.go diff --git a/jestream/config.go b/jestream/config.go deleted file mode 100644 index 41d28bb..0000000 --- a/jestream/config.go +++ /dev/null @@ -1,8 +0,0 @@ -package jestream - -// StreamConfig ... -var StreamConfig = struct { - Notification string -}{ - Notification: "Service_Notification", -} diff --git a/jestream/notification.go b/jestream/notification.go deleted file mode 100644 index fe48a8b..0000000 --- a/jestream/notification.go +++ /dev/null @@ -1,8 +0,0 @@ -package jestream - -// SubjectNotification ... -var SubjectNotification = struct { - PushNotifications string -}{ - PushNotifications: "selly.pull.notification.push_notifications", -} diff --git a/model/notification_request.go b/js/model/selly.go similarity index 68% rename from model/notification_request.go rename to js/model/selly.go index ed2c36c..053a3be 100644 --- a/model/notification_request.go +++ b/js/model/selly.go @@ -1,10 +1,10 @@ -package model +package jsmodel -// PayloadPushNotification ... -type PayloadPushNotification struct { +// PushNotification ... +type PushNotification struct { User string `json:"user"` Type string `json:"type"` - TargetId string `json:"targetId"` + TargetID string `json:"targetId"` IsFromAdmin bool `json:"isFromAdmin"` Category string `json:"category"` Options struct { diff --git a/js/subject/config.go b/js/subject/config.go new file mode 100644 index 0000000..3f77205 --- /dev/null +++ b/js/subject/config.go @@ -0,0 +1,10 @@ +package jssubject + +var root = "js" + +// prefixes ... +var prefixes = struct { + Selly string +}{ + Selly: "selly", +} diff --git a/js/subject/selly.go b/js/subject/selly.go new file mode 100644 index 0000000..e6a344b --- /dev/null +++ b/js/subject/selly.go @@ -0,0 +1,19 @@ +package jssubject + +import ( + "fmt" +) + +// getSellyValue ... +func getSellyValue(val string) string { + return fmt.Sprintf("%s.%s.%s", root, prefixes.Selly, val) +} + +// Selly ... +var Selly = struct { + Stream string + PushNotification string +}{ + Stream: prefixes.Selly, + PushNotification: getSellyValue("push_notifications"), +}