-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
69 lines (57 loc) · 1.55 KB
/
types.go
File metadata and controls
69 lines (57 loc) · 1.55 KB
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
61
62
63
64
65
66
67
68
69
package dingding_go
type MessageContent struct {
Content string `json:"content"`
}
type MessageMarkdown struct {
Title string `json:"title"`
Text string `json:"text"`
}
type MessageLinked struct {
Text string `json:"text"`
Title string `json:"title"`
PicUrl string `json:"picUrl"`
MessageUrl string `json:"messageUrl"`
}
type MessageActionCard struct {
Text string `json:"text"`
Title string `json:"title"`
// default "0"
HideAvatar string `json:"hideAvatar"`
// default "1"
// 按钮排列方式 横向or竖向
BtnOrientation string `json:"btnOrientation"`
Buttons []*MessageButton `json:"btns"`
}
type MessageButton struct {
Title string `json:"title"`
ActionURL string `json:"actionURL"`
}
type MessageAt struct {
AtMobiles []string `json:"atmobiles"`
IsAtAll bool `json:"isAtAll"`
}
type MessageType string
const (
Text MessageType = "text"
MarkDown MessageType = "markdown"
Linked MessageType = "link"
ActionCard MessageType = "actionCard"
)
type TextMessage struct {
MsgType MessageType `json:"msgtype"`
At MessageAt `json:"at"`
Text MessageContent `json:"text"`
}
type MarkdownMessage struct {
MsgType MessageType `json:"msgtype"`
At MessageAt `json:"at"`
MarkdownText MessageMarkdown `json:"markdown"`
}
type LinkMessage struct {
MsgType MessageType `json:"msgtype"`
Link MessageLinked `json:"markdown"`
}
type ActionMessage struct {
MsgType MessageType `json:"msgtype"`
ActionCard MessageActionCard `json:"actionCard"`
}