You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
709 B
33 lines
709 B
package jpush |
|
|
|
// Message . |
|
type Message struct { |
|
Content string `json:"msg_content"` |
|
Title string `json:"title,omitempty"` |
|
ContentType string `json:"content_type,omitempty"` |
|
Extras map[string]interface{} `json:"extras,omitempty"` |
|
} |
|
|
|
// SetContent . |
|
func (m *Message) SetContent(c string) { |
|
m.Content = c |
|
|
|
} |
|
|
|
// SetTitle . |
|
func (m *Message) SetTitle(title string) { |
|
m.Title = title |
|
} |
|
|
|
// SetContentType . |
|
func (m *Message) SetContentType(t string) { |
|
m.ContentType = t |
|
} |
|
|
|
// AddExtras . |
|
func (m *Message) AddExtras(key string, value interface{}) { |
|
if m.Extras == nil { |
|
m.Extras = make(map[string]interface{}) |
|
} |
|
m.Extras[key] = value |
|
}
|
|
|