Compare commits

...

6 Commits

3 changed files with 20 additions and 9 deletions

7
const.go Normal file
View File

@ -0,0 +1,7 @@
package notification
const (
SortOrderDesc = "-order"
SortOrderAsc = "order"
SortDefault = "-lastPushAt"
)

View File

@ -10,14 +10,17 @@ type Config struct {
// PushRequest ...
type PushRequest struct {
Title string `json:"title"`
Body string `json:"body"`
Data string `json:"data"`
Users []string `json:"users"`
Label string `json:"label,omitempty"`
Category string `json:"category,omitempty"`
Sound *Sound `json:"sound,omitempty"`
Link string `json:"link"` // for webpush
Title string `json:"title"`
Body string `json:"body"`
Data string `json:"data"`
Users []string `json:"users"`
Label string `json:"label,omitempty"`
Category string `json:"category,omitempty"`
Sound *Sound `json:"sound,omitempty"`
Link string `json:"link"` // for webpush
Order int `json:"order"` // for sort
DisplayUntil int64 `json:"displayUntil"` // time.Unix
SaveNotification bool `json:"saveNotification"`
}
// Sound ...
@ -45,6 +48,7 @@ type Query struct {
Status string `json:"status"`
Page int64 `json:"page,omitempty"`
Limit int64 `json:"limit,omitempty"`
Sort string `json:"sort,omitempty"` // SortDefault, SortOrderDesc, SortOrderAsc
}
type query struct {

View File

@ -9,7 +9,7 @@ import (
)
// version specify current version of client
const version = "1.0.3"
const version = "1.0.4"
const (
SendByTopic = "topic"