作者 yangfu

推送服务 增加透传模板

@@ -12,6 +12,6 @@ const ( @@ -12,6 +12,6 @@ const (
12 MsgType 消息类型 -> 决定发送的模板样式 12 MsgType 消息类型 -> 决定发送的模板样式
13 */ 13 */
14 const ( 14 const (
15 - SystemNotification = iota + 1 //系统消息  
16 - Transmission 15 + SystemTransmission = iota + 1 //系统消息
  16 + SystemNotification //系统通知
17 ) 17 )
@@ -154,7 +154,7 @@ func (notify *GetuiNotification) Message(method string) interface{} { @@ -154,7 +154,7 @@ func (notify *GetuiNotification) Message(method string) interface{} {
154 } 154 }
155 m = t 155 m = t
156 break 156 break
157 - case push.Transmission: 157 + case push.SystemTransmission:
158 t := NewTransmissionTemplate(notify.Options) 158 t := NewTransmissionTemplate(notify.Options)
159 if method == saveListBody { 159 if method == saveListBody {
160 t.ClientId = "" 160 t.ClientId = ""
@@ -25,7 +25,7 @@ func TestGetui(t *testing.T) { @@ -25,7 +25,7 @@ func TestGetui(t *testing.T) {
25 //push.PushType(push.PushToList), 25 //push.PushType(push.PushToList),
26 //push.ClientIds([]string{"b5fff5f6b0af551da5f381fa47991828"}), 26 //push.ClientIds([]string{"b5fff5f6b0af551da5f381fa47991828"}),
27 27
28 - push.MsgType(push.Transmission), //push.SystemNotification 28 + push.MsgType(push.SystemTransmission), //push.SystemNotification
29 push.Title("测试 hello"), 29 push.Title("测试 hello"),
30 push.Content("hello content"), 30 push.Content("hello content"),
31 31
@@ -62,7 +62,7 @@ func TestGetuiPrd(t *testing.T) { @@ -62,7 +62,7 @@ func TestGetuiPrd(t *testing.T) {
62 push.PushType(push.PushToList), 62 push.PushType(push.PushToList),
63 push.ClientIds([]string{"502f4fd7ba5df15ac6b3d5c561efd9ca"}), 63 push.ClientIds([]string{"502f4fd7ba5df15ac6b3d5c561efd9ca"}),
64 64
65 - push.MsgType(push.Transmission), 65 + push.MsgType(push.SystemTransmission),
66 push.Title("hello"), 66 push.Title("hello"),
67 push.Content("hello content"), 67 push.Content("hello content"),
68 68
@@ -104,7 +104,7 @@ func resolveMsgType(msgType int) string { @@ -104,7 +104,7 @@ func resolveMsgType(msgType int) string {
104 switch msgType { 104 switch msgType {
105 case push.SystemNotification: 105 case push.SystemNotification:
106 return "notification" 106 return "notification"
107 - case push.Transmission: 107 + case push.SystemTransmission:
108 return "transmission" 108 return "transmission"
109 } 109 }
110 return "notification" 110 return "notification"
@@ -51,7 +51,6 @@ func Notification(header *protocol.RequestHeader, request *protocol.PushInfoRequ @@ -51,7 +51,6 @@ func Notification(header *protocol.RequestHeader, request *protocol.PushInfoRequ
51 if v, ok := request.Ext["transData"]; ok { 51 if v, ok := request.Ext["transData"]; ok {
52 options = append(options, push.TransmissionContent(utils.JsonAssertString(v))) 52 options = append(options, push.TransmissionContent(utils.JsonAssertString(v)))
53 } 53 }
54 -  
55 fc(request.ClientId) 54 fc(request.ClientId)
56 fc(request.DeviceToken) 55 fc(request.DeviceToken)
57 switch len(clientIds) { 56 switch len(clientIds) {