/
open_api_message.go
105 lines (86 loc) · 2.48 KB
/
open_api_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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package dingtalk
type MessageSendToConversationResponse struct {
OpenAPIResponse
Receiver string
}
type MessageSendRequest struct {
Sender string `json:"sender"`
Cid string `json:"cid"`
MsgType string `json:"msgtype"`
}
type MessageSendActionCardRequest struct {
MessageSendRequest
ActionCard *MessageSendActionCard `json:"action_card"`
}
type MessageSendActionCard struct {
Title string `json:"title"`
Markdown string `json:"markdown"`
SingleTitle string `json:"single_title,omitempty"`
SingleUrl string `json:"single_url,omitempty"`
BtnOrientation string `json:"btn_orientation,omitempty"`
BtnJSONList interface{} `json:"btn_json_list,omitempty"`
AgentId string `json:"agentid,omitempty"`
}
type MessageSendTextRequest struct {
MessageSendRequest
Text *MessageSendText `json:"text"`
}
type MessageSendText struct {
Content string `json:"content"`
}
type MessageSendImageRequest struct {
MessageSendRequest
Image *MessageSendImage `json:"image"`
}
type MessageSendImage struct {
MediaId string `json:"media_id"`
}
type MessageSendVoiceRequest struct {
MessageSendRequest
Voice *MessageSendVoice `json:"voice"`
}
type MessageSendVoice struct {
MediaId string `json:"media_id"`
Duration string `json:"duration"`
}
type MessageSendFileRequest struct {
MessageSendRequest
File *MessageSendFile `json:"file"`
}
type MessageSendFile struct {
MediaId string `json:"media_id"`
}
type MessageSendLinkRequest struct {
MessageSendRequest
Link *MessageSendLink `json:"link"`
}
type MessageSendLink struct {
Title string `json:"title"`
Text string `json:"text"`
PicUrl string `json:"pic_url"`
MessageUrl string `json:"message_url"`
}
type MessageSendOARequest struct {
MessageSendRequest
Oa *MessageSendOA `json:"oa"`
}
type MessageSendOA struct {
MessageUrl string `json:"message_url"`
PcMessageUrl string `json:"pc_message_url,omitempty"`
Head interface{} `json:"head"`
Body interface{} `json:"body"`
}
type MessageSendMarkdownRequest struct {
MessageSendRequest
Markdown *MessageSendMarkdown `json:"markdown"`
}
type MessageSendMarkdown struct {
Title string `json:"title"`
Text string `json:"text"`
}
// 发送普通消息
func (dtc *DingTalkClient) MessageSendToConversation(info interface{}) (MessageSendToConversationResponse, error) {
var data MessageSendToConversationResponse
err := dtc.httpRPC("message/send_to_conversation", nil, info, &data)
return data, err
}