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.
190 lines
8.2 KiB
190 lines
8.2 KiB
package workwechat
|
|
|
|
//消息推送 touser,toparty,totag这三个参数在实际应用中必有一个不为空
|
|
/*
|
|
发送文本消息
|
|
*/
|
|
type SentMessage struct {
|
|
MessageMain
|
|
TemplateCard TemplateCardMsgCont `json:"template_card"` //模板卡片消息 参数
|
|
}
|
|
|
|
//发送简化消息
|
|
type SentMiniMessage struct {
|
|
MessageMain
|
|
TemplateCard TemplateCardMsgContMini `json:"template_card"` //模板卡片消息 参数
|
|
}
|
|
|
|
//简化消息主题
|
|
type TemplateCardMsgContMini struct {
|
|
TemplatePublic
|
|
ActionMenu ActionMenuCont `json:"action_menu"` //卡片右上角更多操作按钮
|
|
QuoteArea QuoteAreaCont `json:"quote_area"` //引用文献样式
|
|
HorizontalContentList []HorizontalContentListCont `json:"horizontal_content_list"` //二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6
|
|
CardAction CardActionCont `json:"card_action"` //整体卡片的点击跳转事件,text_notice必填本字段
|
|
JumpList []JumpListCont `json:"jump_list"` //跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3
|
|
}
|
|
|
|
//发送简化消息
|
|
type SentSmallMessage struct {
|
|
MessageMain
|
|
TemplateCard TemplateCardMsgContSmall `json:"template_card"` //模板卡片消息 参数
|
|
}
|
|
|
|
//简化消息主题
|
|
type TemplateCardMsgContSmall struct {
|
|
CardType string `json:"card_type"` //模板卡片类型 text_notice:文本卡片;news_notice:图文卡片;button_interaction:按钮卡片,multiple_interaction:多项选择,vote_interaction:投票
|
|
Source SourceCont `json:"source"` //卡片来源样式信息,不需要来源样式可不填写
|
|
// MainTitle MainTitleCont `json:"main_title"` //一级标题
|
|
TaskId string `json:"task_id"` //任务id,同一个应用任务id不能重复,只能由数字、字母和“_-@”组成,最长128字节,填了action_menu字段的话本字段必填
|
|
QuoteArea QuoteAreaCont `json:"quote_area"` //引用文献样式
|
|
HorizontalContentList []HorizontalContentListCont `json:"horizontal_content_list"` //二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6
|
|
CardAction CardActionCont `json:"card_action"` //整体卡片的点击跳转事件,text_notice必填本字段
|
|
JumpList []JumpListCont `json:"jump_list"` //跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3
|
|
}
|
|
|
|
/*
|
|
更新文本信息
|
|
*/
|
|
type UpdateMessage struct {
|
|
UpdatePublic
|
|
TemplateCard UpdateTemplateCardMsgCont `json:"template_card"` //模板卡片消息 参数
|
|
|
|
}
|
|
|
|
//更新文本信息模板
|
|
type UpdateTemplateCardMsgCont struct {
|
|
UpdateTemplateCardPublic
|
|
UpdateTextImgButton
|
|
subTitleText
|
|
EmphasisContent EmphasisContentInfo `json:"emphasis_content"` //关键数据样式
|
|
JumpList []JumpListCont `json:"jump_list"` //跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3
|
|
}
|
|
|
|
//发送文本信息
|
|
type TemplateCardMsgCont struct {
|
|
TemplateCardCont
|
|
ActionMenu ActionMenuCont `json:"action_menu"` //卡片右上角更多操作按钮
|
|
EmphasisContent EmphasisContentInfo `json:"emphasis_content"` //关键数据样式
|
|
subTitleText //二级普通文本,建议不超过160个字,(支持id转译)
|
|
JumpList []JumpListCont `json:"jump_list"` //跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3
|
|
}
|
|
|
|
/*
|
|
发送图文信息
|
|
*/
|
|
type SentImagesMessage struct {
|
|
MessageMain
|
|
TemplateCard TemplateCardImgCont `json:"template_card"` //模板卡片消息 参数
|
|
}
|
|
|
|
//发送图文主体
|
|
type TemplateCardImgCont struct {
|
|
TemplateCardCont
|
|
action_menu ActionMenuCont `json:"action_menu"` //卡片右上角更多操作按钮
|
|
ImageTextArea ImageTextAreaCont `json:"image_text_area"` //左图右文样式,news_notice类型的卡片,card_image和image_text_area两者必填一个字段,不可都不填
|
|
CardImage CardImageCont `json:"card_image"` //图片样式,news_notice类型的卡片,card_image和image_text_area两者必填一个字段,不可都不填
|
|
VerticalContentList []VerticalContentListCont `json:"vertical_content_list"` //卡片二级垂直内容,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过4
|
|
JumpList JumpListCont `json:"jump_list"` //跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3
|
|
}
|
|
|
|
/*
|
|
更新图文信息
|
|
*/
|
|
type UpdateMessageImg struct {
|
|
UpdatePublic
|
|
TemplateCard UpdateTemplateCardMsgContImg `json:"template_card"` //模板卡片消息 参数
|
|
}
|
|
|
|
//更新图文信息模板
|
|
type UpdateTemplateCardMsgContImg struct {
|
|
UpdateTemplateCardPublic
|
|
UpdateTextImgButton
|
|
ImageTextArea ImageTextAreaCont `json:"image_text_area"`
|
|
CardImage CardImageCont `json:"card_image"`
|
|
VerticalContentList []VerticalContentListCont `json:"vertical_content_list"`
|
|
JumpList []JumpListCont `json:"jump_list"` //跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3
|
|
}
|
|
|
|
/*
|
|
发送按钮信息
|
|
*/
|
|
type SentButtonMessage struct {
|
|
MessageMain
|
|
TemplateCard TemplateCardButCont `json:"template_card"` //模板卡片消息 参数
|
|
}
|
|
|
|
//发送按钮主体
|
|
type TemplateCardButCont struct {
|
|
TemplateCardCont
|
|
action_menu ActionMenuCont `json:"action_menu"` //卡片右上角更多操作按钮
|
|
subTitleText
|
|
ButtonSelection ButtonSelectionCont `json:"button_selection"` //按钮型卡片的下拉框样式
|
|
ButtonList []ButtonListCont `json:"button_list"` //按钮列表,列表长度不超过6
|
|
}
|
|
|
|
/*
|
|
发送多项选择信息
|
|
*/
|
|
type SentMultipleMessage struct {
|
|
MessageMain
|
|
TemplateCard TemplateCardMultiple `json:"template_card"` //模板卡片消息 参数
|
|
}
|
|
|
|
//发送多项选择主体
|
|
type TemplateCardMultiple struct {
|
|
TemplatePublic
|
|
action_menu ActionMenuCont `json:"action_menu"` //卡片右上角更多操作按钮
|
|
SelectList []SelectListCont `json:"select_list"` //下拉式的选择器列表,multiple_interaction类型的卡片该字段不可为空,一个消息最多支持 3 个选择器
|
|
SubmitButton SubmitButtonCont `json:"submit_button"` //提交按钮样式
|
|
}
|
|
|
|
/*
|
|
更多选项文信息
|
|
*/
|
|
type UpdateMessageMult struct {
|
|
UpdatePublic
|
|
TemplateCard UpdateTemplateCardMsgContMult `json:"template_card"` //模板卡片消息 参数
|
|
}
|
|
|
|
//更多选项文信息模板
|
|
type UpdateTemplateCardMsgContMult struct {
|
|
UpdateTemplateCardPublic
|
|
SelectList []SelectListCont `json:"select_list"` //下拉式的选择器列表,multiple_interaction类型的卡片该字段不可为空,一个消息最多支持 3 个选择器
|
|
SubmitButton SubmitButtonCont `json:"submit_button"` //提交按钮样式
|
|
ReplaceTextInfo
|
|
}
|
|
|
|
/*
|
|
发送投票选择信息
|
|
*/
|
|
type SentVoteMessage struct {
|
|
MessageMain
|
|
TemplateCard TemplateCardVote `json:"template_card"` //模板卡片消息 参数
|
|
}
|
|
|
|
//发送投票选择主体
|
|
type TemplateCardVote struct {
|
|
TemplatePublic
|
|
CheckBox CheckBoxCont `json:"checkbox"` //
|
|
SubmitButton SubmitButtonCont `json:"submit_button"` //提交按钮样式
|
|
}
|
|
|
|
/*
|
|
更新投票项文信息
|
|
*/
|
|
type UpdateMessageVote struct {
|
|
UpdatePublic
|
|
TemplateCard UpdateTemplateCardMsgContVote `json:"template_card"` //模板卡片消息 参数
|
|
}
|
|
|
|
//更新投票项文信息模板
|
|
type UpdateTemplateCardMsgContVote struct {
|
|
UpdateTemplateCardPublic
|
|
CheckBox CheckBoxCont `json:"checkbox"` //
|
|
SubmitButton SubmitButtonCont `json:"submit_button"` //提交按钮样式
|
|
}
|
|
|
|
//文本参数主体
|
|
type msgTextCont struct {
|
|
}
|
|
|