update format.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
a83b5f4438
commit
6c15026b64
|
@ -1,10 +1,10 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
_ "github.com/google/go-gcm"
|
||||||
apns "github.com/sideshow/apns2"
|
apns "github.com/sideshow/apns2"
|
||||||
"github.com/sideshow/apns2/certificate"
|
"github.com/sideshow/apns2/certificate"
|
||||||
"github.com/sideshow/apns2/payload"
|
"github.com/sideshow/apns2/payload"
|
||||||
_ "github.com/google/go-gcm"
|
|
||||||
"log"
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -27,11 +27,11 @@ type alert struct {
|
||||||
|
|
||||||
type RequestPushNotification struct {
|
type RequestPushNotification struct {
|
||||||
// Common
|
// Common
|
||||||
Tokens []string `json:"tokens" binding:"required"`
|
Tokens []string `json:"tokens" binding:"required"`
|
||||||
Platform int `json:"platform" binding:"required"`
|
Platform int `json:"platform" binding:"required"`
|
||||||
Message string `json:"message" binding:"required"`
|
Message string `json:"message" binding:"required"`
|
||||||
Priority string `json:"priority,omitempty"`
|
Priority string `json:"priority,omitempty"`
|
||||||
ContentAvailable bool `json:"content_available,omitempty"`
|
ContentAvailable bool `json:"content_available,omitempty"`
|
||||||
|
|
||||||
// Android
|
// Android
|
||||||
CollapseKey string `json:"collapse_key,omitempty"`
|
CollapseKey string `json:"collapse_key,omitempty"`
|
||||||
|
@ -39,16 +39,16 @@ type RequestPushNotification struct {
|
||||||
TimeToLive int `json:"time_to_live,omitempty"`
|
TimeToLive int `json:"time_to_live,omitempty"`
|
||||||
|
|
||||||
// iOS
|
// iOS
|
||||||
ApnsID string `json:"apns_id,omitempty"`
|
ApnsID string `json:"apns_id,omitempty"`
|
||||||
Topic string `json:"topic,omitempty"`
|
Topic string `json:"topic,omitempty"`
|
||||||
Badge int `json:"badge,omitempty"`
|
Badge int `json:"badge,omitempty"`
|
||||||
Sound string `json:"sound,omitempty"`
|
Sound string `json:"sound,omitempty"`
|
||||||
Expiry int `json:"expiry,omitempty"`
|
Expiry int `json:"expiry,omitempty"`
|
||||||
Retry int `json:"retry,omitempty"`
|
Retry int `json:"retry,omitempty"`
|
||||||
Category string `json:"category,omitempty"`
|
Category string `json:"category,omitempty"`
|
||||||
URLArgs []string `json:"url-args,omitempty"`
|
URLArgs []string `json:"url-args,omitempty"`
|
||||||
Extend []ExtendJSON `json:"extend,omitempty"`
|
Extend []ExtendJSON `json:"extend,omitempty"`
|
||||||
Alert alert `json:"alert,omitempty"`
|
Alert alert `json:"alert,omitempty"`
|
||||||
// meta
|
// meta
|
||||||
IDs []uint64 `json:"seq_id,omitempty"`
|
IDs []uint64 `json:"seq_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
func PrintGoPushVersion() {
|
func PrintGoPushVersion() {
|
||||||
|
|
Loading…
Reference in New Issue