作者 yangfu

1.推送修改

@@ -25,6 +25,7 @@ func Notification(header *protocol.RequestHeader, request *protocol.PushInfoRequ @@ -25,6 +25,7 @@ func Notification(header *protocol.RequestHeader, request *protocol.PushInfoRequ
25 Ext: request.Ext, 25 Ext: request.Ext,
26 } 26 }
27 ) 27 )
  28 + rsp = &protocol.PushInfoResponse{}
28 if appInfo, err = repApp.FindOne(map[string]interface{}{"project_key": request.ProjectKey}); err != nil { 29 if appInfo, err = repApp.FindOne(map[string]interface{}{"project_key": request.ProjectKey}); err != nil {
29 log.Error(err) 30 log.Error(err)
30 err = protocol.NewCustomMessage(1, fmt.Sprintf("project_key:%v not found", request.ProjectKey)) 31 err = protocol.NewCustomMessage(1, fmt.Sprintf("project_key:%v not found", request.ProjectKey))
@@ -36,7 +37,7 @@ func Notification(header *protocol.RequestHeader, request *protocol.PushInfoRequ @@ -36,7 +37,7 @@ func Notification(header *protocol.RequestHeader, request *protocol.PushInfoRequ
36 return 37 return
37 } 38 }
38 if len(deviceList) == 0 { 39 if len(deviceList) == 0 {
39 - err = protocol.NewSuccessWithMessage(fmt.Sprintf("接受者:%v 未查询到注册的设备信息!", request.Receivers)) 40 + err = protocol.NewSuccessWithMessage(fmt.Sprintf("接收人:%v 未查询到注册的设备信息!", request.Receivers))
40 return 41 return
41 } 42 }
42 for i := range deviceList { 43 for i := range deviceList {
@@ -35,12 +35,14 @@ type UpdateDeviceRequest struct { @@ -35,12 +35,14 @@ type UpdateDeviceRequest struct {
35 type UpdateDeviceResponse struct { 35 type UpdateDeviceResponse struct {
36 } 36 }
37 37
  38 +//设备信息
38 type Device struct { 39 type Device struct {
39 Uid int64 40 Uid int64
40 ClientId string 41 ClientId string
41 DeviceToken string 42 DeviceToken string
42 } 43 }
43 44
  45 +//应用信息
44 type AppInfo struct { 46 type AppInfo struct {
45 Id int 47 Id int
46 AppKey string 48 AppKey string
@@ -10,7 +10,6 @@ const ( @@ -10,7 +10,6 @@ const (
10 10
11 /*Image */ 11 /*Image */
12 type FileRequest struct { 12 type FileRequest struct {
13 - //Xxx string`json:"xxx" valid:"Required"`  
14 Files []*multipart.FileHeader 13 Files []*multipart.FileHeader
15 FileType string 14 FileType string
16 } 15 }