From 547b3b8dd911df5bb2664e8374d4a96b6874ef7b Mon Sep 17 00:00:00 2001 From: Nguyen Minh Date: Fri, 23 Sep 2022 14:47:00 +0700 Subject: [PATCH] update js stream --- js/consumer/selly.go | 8 ++++++++ js/model/selly.go | 21 ++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 js/consumer/selly.go diff --git a/js/consumer/selly.go b/js/consumer/selly.go new file mode 100644 index 0000000..380927c --- /dev/null +++ b/js/consumer/selly.go @@ -0,0 +1,8 @@ +package jsconsumer + +// Selly ... +var Selly = struct { + PushNotification string +}{ + PushNotification: "PULL_PUSH_NOTIFICATION", +} diff --git a/js/model/selly.go b/js/model/selly.go index 053a3be..ab8d021 100644 --- a/js/model/selly.go +++ b/js/model/selly.go @@ -2,13 +2,16 @@ package jsmodel // PushNotification ... type PushNotification struct { - User string `json:"user"` - Type string `json:"type"` - TargetID string `json:"targetId"` - IsFromAdmin bool `json:"isFromAdmin"` - Category string `json:"category"` - Options struct { - Title string `json:"title"` - Content string `json:"content"` - } `json:"options"` + User string `json:"user"` + Type string `json:"type"` + TargetID string `json:"targetId"` + IsFromAdmin bool `json:"isFromAdmin"` + Category string `json:"category"` + Options NotificationOptions `json:"options"` +} + +// NotificationOptions ... +type NotificationOptions struct { + Title string `json:"title"` + Content string `json:"content"` }