-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotification_model.go
69 lines (58 loc) · 1.79 KB
/
notification_model.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
61
62
63
64
65
66
67
68
69
package dingtalk
type SendWorkerNotificationParams struct {
ToAllUser string `json:"to_all_user,omitempty"`
AgentID string `json:"agent_id"`
DeptIDList string `json:"dept_id_list,omitempty"`
UseridList string `json:"userid_list,omitempty"`
MSG interface{} `json:"msg"`
}
type SendWorkerNotificationRes struct {
Errcode int64 `json:"errcode"`
TaskID int64 `json:"task_id"`
RequestID string `json:"request_id"`
}
type GetWorkerNotificationResultParams struct {
AgentID int64 `json:"agent_id"`
TaskID int64 `json:"task_id"`
}
type GetWorkerNotificationResultRes struct {
Errcode int64 `json:"errcode"`
SendResult SendResult `json:"send_result"`
RequestID string `json:"request_id"`
}
type SendResult struct {
FailedUserIDList []interface{} `json:"failed_user_id_list"`
ForbiddenList []interface{} `json:"forbidden_list"`
InvalidDeptIDList []interface{} `json:"invalid_dept_id_list"`
InvalidUserIDList []interface{} `json:"invalid_user_id_list"`
ReadUserIDList []string `json:"read_user_id_list"`
UnreadUserIDList []interface{} `json:"unread_user_id_list"`
}
// 文本类型消息结构体
type TextMessage struct {
Msgtype string `json:"msgtype"`
Text Text `json:"text"`
}
type Text struct {
Content string `json:"content"`
}
// Markdown类型消息结构体
type MarkdownMessage struct {
Msgtype string `json:"msgtype"`
Markdown Markdown `json:"markdown"`
}
type Markdown struct {
Title string `json:"title"`
Text string `json:"text"`
}
// Link类型消息结构体
type LinkMessage struct {
Msgtype string `json:"msgtype"`
Link Link `json:"link"`
}
type Link struct {
MessageURL string `json:"messageUrl"`
PicURL string `json:"picUrl"`
Title string `json:"title"`
Text string `json:"text"`
}