2021-11-10 15:24:59 +08:00
|
|
|
package requestBody
|
|
|
|
|
|
2021-11-12 17:25:17 +08:00
|
|
|
import "Open_IM/pkg/common/config"
|
2021-11-12 16:09:21 +08:00
|
|
|
|
2021-11-10 15:24:59 +08:00
|
|
|
type Notification struct {
|
2021-11-12 18:15:28 +08:00
|
|
|
Alert string `json:"alert,omitempty"`
|
|
|
|
|
Android Android `json:"android,omitempty"`
|
|
|
|
|
IOS Ios `json:"ios,omitempty"`
|
2021-11-10 15:24:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Android struct {
|
2021-11-12 18:15:28 +08:00
|
|
|
Alert string `json:"alert,omitempty"`
|
2021-11-12 17:59:37 +08:00
|
|
|
Intent struct {
|
|
|
|
|
URL string `json:"url,omitempty"`
|
|
|
|
|
} `json:"intent,omitempty"`
|
2021-11-10 15:24:59 +08:00
|
|
|
}
|
|
|
|
|
type Ios struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (n *Notification) SetAlert(alert string) {
|
|
|
|
|
n.Alert = alert
|
2021-11-12 18:15:28 +08:00
|
|
|
n.Android.Alert = alert
|
2021-11-10 15:24:59 +08:00
|
|
|
}
|
2021-11-12 16:09:21 +08:00
|
|
|
func (n *Notification) SetAndroidIntent() {
|
2021-11-12 17:59:37 +08:00
|
|
|
n.Android.Intent.URL = config.Config.Push.Jpns.PushIntent
|
2021-11-12 16:09:21 +08:00
|
|
|
}
|