-
Notifications
You must be signed in to change notification settings - Fork 15
/
message.go
60 lines (50 loc) · 1.39 KB
/
message.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package dingrobot
const (
msgTypeText = "text"
msgTypeLink = "link"
msgTypeMarkdown = "markdown"
msgTypeActionCard = "actionCard"
)
type textMessage struct {
MsgType string `json:"msgtype"`
Text textParams `json:"text"`
At atParams `json:"at"`
}
type textParams struct {
Content string `json:"content"`
}
type atParams struct {
AtMobiles []string `json:"atMobiles,omitempty"`
IsAtAll bool `json:"isAtAll,omitempty"`
}
type linkMessage struct {
MsgType string `json:"msgtype"`
Link linkParams `json:"link"`
}
type linkParams struct {
Title string `json:"title"`
Text string `json:"text"`
MessageURL string `json:"messageUrl"`
PicURL string `json:"picUrl,omitempty"`
}
type markdownMessage struct {
MsgType string `json:"msgtype"`
Markdown markdownParams `json:"markdown"`
At atParams `json:"at"`
}
type markdownParams struct {
Title string `json:"title"`
Text string `json:"text"`
}
type actionCardMessage struct {
MsgType string `json:"msgtype"`
ActionCard actionCardParams `json:"actionCard"`
}
type actionCardParams struct {
Title string `json:"title"`
Text string `json:"text"`
SingleTitle string `json:"singleTitle"`
SingleURL string `json:"singleURL"`
BtnOrientation string `json:"btnOrientation,omitempty"`
HideAvatar string `json:"hideAvatar,omitempty"`
}