Files
open-im-server/internal/push/jpush/requestBody/notification.go
T

27 lines
577 B
Go
Raw Normal View History

package requestBody
2021-11-12 17:25:17 +08:00
import "Open_IM/pkg/common/config"
2021-11-12 16:09:21 +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"`
}
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"`
}
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-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
}