作者 yangfu

推送服务 增加透传模板

... ... @@ -12,6 +12,6 @@ const (
MsgType 消息类型 -> 决定发送的模板样式
*/
const (
SystemNotification = iota + 1 //系统消息
Transmission
SystemTransmission = iota + 1 //系统消息
SystemNotification //系统通知
)
... ...
... ... @@ -154,7 +154,7 @@ func (notify *GetuiNotification) Message(method string) interface{} {
}
m = t
break
case push.Transmission:
case push.SystemTransmission:
t := NewTransmissionTemplate(notify.Options)
if method == saveListBody {
t.ClientId = ""
... ...
... ... @@ -25,7 +25,7 @@ func TestGetui(t *testing.T) {
//push.PushType(push.PushToList),
//push.ClientIds([]string{"b5fff5f6b0af551da5f381fa47991828"}),
push.MsgType(push.Transmission), //push.SystemNotification
push.MsgType(push.SystemTransmission), //push.SystemNotification
push.Title("测试 hello"),
push.Content("hello content"),
... ... @@ -62,7 +62,7 @@ func TestGetuiPrd(t *testing.T) {
push.PushType(push.PushToList),
push.ClientIds([]string{"502f4fd7ba5df15ac6b3d5c561efd9ca"}),
push.MsgType(push.Transmission),
push.MsgType(push.SystemTransmission),
push.Title("hello"),
push.Content("hello content"),
... ...
... ... @@ -104,7 +104,7 @@ func resolveMsgType(msgType int) string {
switch msgType {
case push.SystemNotification:
return "notification"
case push.Transmission:
case push.SystemTransmission:
return "transmission"
}
return "notification"
... ...
... ... @@ -51,7 +51,6 @@ func Notification(header *protocol.RequestHeader, request *protocol.PushInfoRequ
if v, ok := request.Ext["transData"]; ok {
options = append(options, push.TransmissionContent(utils.JsonAssertString(v)))
}
fc(request.ClientId)
fc(request.DeviceToken)
switch len(clientIds) {
... ...