Compare commits
7 Commits
v1.0.3-alp
...
master
Author | SHA1 | Date |
---|---|---|
|
b1a0b41a2b | |
|
1c35dfb76a | |
|
5a37fba851 | |
|
58c1ec0f8e | |
|
9a5bdda1d9 | |
|
615aa4e963 | |
|
43af89bf21 |
|
@ -0,0 +1,7 @@
|
||||||
|
package notification
|
||||||
|
|
||||||
|
const (
|
||||||
|
SortOrderDesc = "-order"
|
||||||
|
SortOrderAsc = "order"
|
||||||
|
SortDefault = "-lastPushAt"
|
||||||
|
)
|
21
model.go
21
model.go
|
@ -10,14 +10,17 @@ type Config struct {
|
||||||
|
|
||||||
// PushRequest ...
|
// PushRequest ...
|
||||||
type PushRequest struct {
|
type PushRequest struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
Data string `json:"data"`
|
Data string `json:"data"`
|
||||||
Users []string `json:"users"`
|
Users []string `json:"users"`
|
||||||
Label string `json:"label,omitempty"`
|
Label string `json:"label,omitempty"`
|
||||||
Category string `json:"category,omitempty"`
|
Category string `json:"category,omitempty"`
|
||||||
Sound *Sound `json:"sound,omitempty"`
|
Sound *Sound `json:"sound,omitempty"`
|
||||||
Link string `json:"link"` // for webpush
|
Link string `json:"link"` // for webpush
|
||||||
|
Order int `json:"order"` // for sort
|
||||||
|
DisplayUntil int64 `json:"displayUntil"` // time.Unix
|
||||||
|
SaveNotification bool `json:"saveNotification"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sound ...
|
// Sound ...
|
||||||
|
@ -42,8 +45,10 @@ type pushRequest struct {
|
||||||
type Query struct {
|
type Query struct {
|
||||||
User string `json:"user"`
|
User string `json:"user"`
|
||||||
Category string `json:"category,omitempty"`
|
Category string `json:"category,omitempty"`
|
||||||
|
Status string `json:"status"`
|
||||||
Page int64 `json:"page,omitempty"`
|
Page int64 `json:"page,omitempty"`
|
||||||
Limit int64 `json:"limit,omitempty"`
|
Limit int64 `json:"limit,omitempty"`
|
||||||
|
Sort string `json:"sort,omitempty"` // SortDefault, SortOrderDesc, SortOrderAsc
|
||||||
}
|
}
|
||||||
|
|
||||||
type query struct {
|
type query struct {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// version specify current version of client
|
// version specify current version of client
|
||||||
const version = "1.0.3"
|
const version = "1.0.4"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
SendByTopic = "topic"
|
SendByTopic = "topic"
|
||||||
|
|
Loading…
Reference in New Issue