dddd
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.
 
 
 
 
 

373 lines
15 KiB

package commonus
//消息类型
type SendPublic struct {
Touser string `json:"touser" form:"touser"`
ToParty string `json:"toparty" form:"toparty"`
ToTag string `json:"totag" form:"totag"`
MsgType string `json:"msgtype" form:"msgtype"`
AgentId int64 `json:"agentid" form:"agentid"`
EnableDuplicateCheck int `json:"enable_duplicate_check" form:"enable_duplicate_check"`
DuplicateCheckInterval int `json:"duplicate_check_interval" form:"duplicate_check_interval"`
}
//文本消息
type SendText struct {
SendPublic
Safe int `json:"safe" form:"safe"`
EnableIdTrans int `json:"enable_id_trans" form:"enable_id_trans"`
Text SendTextStruct `json:"text" form:"text"`
}
type SendTextStruct struct {
Content string `json:"content" form:"content"`
}
//markdown消息
type SendMarkDown struct {
SendPublic
Text SendTextStruct `json:"markdown" form:"markdown"`
}
//发送图文信息
type SendImgCont struct {
SendPublic
EnableIdTrans int `json:"enable_id_trans" form:"enable_id_trans"`
News SendNewsStruct `json:"news" form:"news"`
}
//图文具体内容
type SendNewsStruct struct {
Articles []ArticlesStruct `json:"articles" form:"articles"`
}
type ArticlesStruct struct {
Title string `json:"title" form:"title"`
Description string `json:"description" form:"description"`
URL string `json:"url" form:"url"`
Picurl string `json:"picurl" form:"picurl"`
Appid string `json:"appid" form:"appid"`
Pagepath string `json:"pagepath" form:"pagepath"`
}
//图片类型
type SendPicture struct {
SendPublic
Images MediaIdStruct `json:"image" form:"image"`
Safe int `json:"safe" form:"safe"`
}
type MediaIdStruct struct {
MediaId string `json:"media_id" form:"media_id"`
}
//语音信息
type VoiceMsg struct {
SendPublic
Voice MediaIdStruct `json:"image" form:"voice"`
}
//视频消息
type VideoStruct struct {
SendPublic
Safe int `json:"safe" form:"safe"`
Video VideoListStruct `json:"image" form:"video"`
}
type VideoListStruct struct {
MediaIdStruct
Title string `json:"title" form:"title"`
Description string `json:"description" form:"description"`
}
//文件消息
type FileStruct struct {
SendPublic
Safe int `json:"safe" form:"safe"`
File MediaIdStruct `json:"file" form:"file"`
}
//文本卡片消息
type TextcardStruct struct {
SendPublic
EnableIdTrans int `json:"enable_id_trans" form:"enable_id_trans"`
Textcard TextcardCont `json:"textcard" form:"textcard"`
}
type TextcardCont struct {
Title string `json:"title" form:"title"`
Description string `json:"description" form:"description"`
URL string `json:"url" form:"url"`
Btntxt string `json:"btntxt" form:"btntxt"`
}
//图文消息
type NewsImages struct {
SendPublic
EnableIdTrans int `json:"enable_id_trans" form:"enable_id_trans"`
Mpnews SendNewsStructs `json:"mpnews" form:"mpnews"`
Safe int `json:"safe" form:"safe"`
}
type SendNewsStructs struct {
Articles []ArticlesStructs `json:"articles" form:"articles"`
}
type ArticlesStructs struct {
Title string `json:"title" form:"title"`
ThumbMediaId string `json:"thumb_media_id" form:"thumb_media_id"`
Author string `json:"author" form:"author"`
ContentSourceUrl string `json:"content_source_url" form:"content_source_url"`
Content string `json:"content" form:"content"`
Digest string `json:"digest" form:"digest"`
}
//模板卡片消息
//文本通知型
type TextNotice struct {
SendPublic
TemplateCard TemplatecardStruct `json:"template_card"`
EnableIdTrans int `json:"enable_id_trans" form:"enable_id_trans"`
}
type TemplatecardStruct struct {
CardType string `json:"card_type"`
Source SourceStruct `json:"source"`
ActionMenu ActionMenuStruct `json:"action_menu"`
TaskId string `json:"task_id"`
MainTitle MainTitleStruct `json:"main_title"`
QuoteArea QuoteAreaStruct `json:"quote_area"`
EmphasisContent EmphasisContentStruct `json:"emphasis_content"` //关键数据样式
SubTitleText string `json:"sub_title_text"` //二级普通文本,建议不超过160个字,
HorizontalContentList []HorizontalContentListStruct `json:"horizontal_content_list"` //二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6
JumpList []JumpListStruct `json:"jump_list"` //跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3
CardAction CardActionStruct `json:"card_action"` //整体卡片的点击跳转事件,text_notice必填本字段
}
//更多操作界面的描述
type DescStruct struct {
Desc string `json:"desc"` //操作描述
}
//卡片来源样式信息,不需要来源样式可不填写
type SourceStruct struct {
IconUrl string `json:"icon_url"`
DescStruct
DescColor int `json:"desc_color"`
}
//卡片右上角更多操作按钮
type ActionMenuStruct struct {
DescStruct
ActionList []ActionListStruct `json:"action_list"`
}
//操作列表,列表长度取值范围为 [1, 3]
type ActionListStruct struct {
Text string `json:"text"` //操作的描述文案
Key string `json:"key"` //操作key值,用户点击后,会产生回调事件将本参数作为EventKey返回,回调事件会带上该key值,最长支持1024字节,不可重复
}
//一级标题,建议不超过36个字,文本通知型卡片本字段非必填,但不可本字段和sub_title_text都不填,(支持id转译)
type MainTitleStruct struct {
Title string `json:"title"` //操作的描述文案
DescStruct
}
//引用文献样式
type QuoteAreaStruct struct {
Type int `json:"type"`
Url string `json:"url"`
Title string `json:"title"`
QuoteText string `json:"quote_text"`
Appid string `json:"appid" form:"appid"`
Pagepath string `json:"pagepath" form:"pagepath"`
}
//关键数据样式
type EmphasisContentStruct struct {
MainTitleStruct
}
//二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6
type HorizontalContentListStruct struct {
Type int `json:"type"`
KeyName string `json:"keyname"`
Value string `json:"value"`
Url string `json:"url"`
MediaId string `json:"media_id"`
UserId string `json:"userid"`
}
//跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3
type JumpListStruct struct {
Type int `json:"type"`
Title string `json:"title"`
Url string `json:"url"`
Appid string `json:"appid"`
Pagepath string `json:"pagepath"`
}
//整体卡片的点击跳转事件,text_notice必填本字段
type CardActionStruct struct {
Type int `json:"type"`
Url string `json:"url"`
Appid string `json:"appid"`
Pagepath string `json:"pagepath"`
}
//图文展示型-模板卡片
type ImageTextTemplate struct {
SendPublic
TemplateCard ImgTxtTemplatecardStruct `json:"template_card"`
EnableIdTrans int `json:"enable_id_trans" form:"enable_id_trans"`
}
//图文展示
type ImgTxtTemplatecardStruct struct {
CardType string `json:"card_type"`
Source SourceStruct `json:"source"`
ActionMenu ActionMenuStruct `json:"action_menu"`
TaskId string `json:"task_id"`
MainTitle MainTitleStruct `json:"main_title"`
QuoteArea QuoteAreaStruct `json:"quote_area"`
ImageTextArea ImageTextAreaStruct `json:"image_text_area"` //左图右文样式,news_notice类型的卡片,card_image和image_text_area两者必填一个字段,不可都不填
CardImage CardImageStruct `json:"card_image"` //图片样式,news_notice类型的卡片,card_image和image_text_area两者必填一个字段,不可都不填
VerticalContentList []VerticalContentListStr `json:"vertical_content_list"` //卡片二级垂直内容,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过4
HorizontalContentList []HorizontalContentListStruct `json:"horizontal_content_list"` //二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6
JumpList []JumpListStruct `json:"jump_list"` //跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3
CardAction CardActionStruct `json:"card_action"` //整体卡片的点击跳转事件,text_notice必填本字段
}
//左图右文样式,news_notice类型的卡片,card_image和image_text_area两者必填一个字段,不可都不填
type ImageTextAreaStruct struct {
Type int `json:"type"`
Title string `json:"title"`
Url string `json:"url"`
Desc string `json:"desc"`
ImageUrl string `json:"image_url"`
}
//图片样式,news_notice类型的卡片,card_image和image_text_area两者必填一个字段,不可都不填
type CardImageStruct struct {
Url string `json:"url"`
AspectRatio float32 `json:"aspect_ratio"`
}
//卡片二级垂直内容,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过4
type VerticalContentListStr struct {
MainTitleStruct
}
//按钮交互型-----模板卡片
type ButtonTemplateAll struct {
SendPublic
TemplateCard ButtonTemplateStructAll `json:"template_card"`
EnableIdTrans int `json:"enable_id_trans" form:"enable_id_trans"`
}
type ButtonTemplate struct {
SendPublic
TemplateCard ButtonTemplateStruct `json:"template_card"`
EnableIdTrans int `json:"enable_id_trans" form:"enable_id_trans"`
}
//按钮交互模板
type ButtonTemplateStructAll struct {
CurrencyButtonTemplateAll
TaskId string `json:"task_id"`
}
type ButtonTemplateStruct struct {
CurrencyButtonTemplateStruct
TaskId string `json:"task_id"`
}
//下拉式选择器
type ButtonSelectionStr struct {
QuestionKey string `json:"question_key"`
Title string `json:"title"`
SelectedId string `json:"selected_id"`
OptionList []OptionListStructes `json:"option_list"` //选项列表,下拉选项不超过 10 个,最少1个
}
//选项列表,下拉选项不超过 10 个,最少1个
type OptionListStructes struct {
Id string `json:"id"`
Text string `json:"text"`
IsChecked bool `json:"is_checked"`
}
//按钮列表,列表长度不超过6
type ButtonListStruct struct {
Type int `json:"type"`
Text string `json:"text"`
Style int `json:"style"`
Key string `json:"key"`
Url string `json:"url"`
}
//投票选择型---模板卡片
type VoteTemplate struct {
SendPublic
TemplateCard VoteTemplateStruct `json:"template_card"`
EnableIdTrans int `json:"enable_id_trans" form:"enable_id_trans"`
}
//投票模型
type VoteTemplateStruct struct {
CardType string `json:"card_type"`
Source SourceStruct `json:"source"`
MainTitle MainTitleStruct `json:"main_title"`
TaskId string `json:"task_id"`
CheckBox CheckBoxStruct `json:"checkbox"` //选择题样式
SubmitButton SubmitButtonStr `json:"submit_button"` //提交按钮样式
}
//选择题样式
type CheckBoxStruct struct {
QuestionKey string `json:"question_key"`
OptionList []OptionListStructes `json:"option_list"` //选项列表,下拉选项不超过 10 个,最少1个
Mode int `json:"mode"`
}
//提交按钮样式
type SubmitButtonStr struct {
ActionListStruct
}
//多项选择型 --- 模板卡片
type MultipleChoiceTemplate struct {
SendPublic
TemplateCard MultipleChoiceTemplateStruct `json:"template_card"`
EnableIdTrans int `json:"enable_id_trans" form:"enable_id_trans"`
}
//多项选择型
type MultipleChoiceTemplateStruct struct {
CardType string `json:"card_type"`
Source SourceStruct `json:"source"`
MainTitle MainTitleStruct `json:"main_title"`
TaskId string `json:"task_id"`
SelectList []ButtonSelectionStr `json:"select_list"`
SubmitButton SubmitButtonStr `json:"submit_button"` //提交按钮样式
}
//通用按钮模板
type CurrencyButtonTemplateAll struct {
CardType string `json:"card_type"`
Source SourceStruct `json:"source"`
ActionMenu ActionMenuStruct `json:"action_menu"`
MainTitle MainTitleStruct `json:"main_title"`
QuoteArea QuoteAreaStruct `json:"quote_area"`
SubTitleText string `json:"sub_title_text"` //二级普通文本,建议不超过160个字,
HorizontalContentList []HorizontalContentListStruct `json:"horizontal_content_list"` //二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6
CardAction CardActionStruct `json:"card_action"` //整体卡片的点击跳转事件,text_notice必填本字段
ButtonSelection ButtonSelectionStr `json:"button_selection"`
ButtonList []ButtonListStruct `json:"button_list"` //按钮列表,列表长度不超过6
}
type CurrencyButtonTemplateStruct struct {
CardType string `json:"card_type"`
Source SourceStruct `json:"source"`
MainTitle MainTitleStruct `json:"main_title"`
QuoteArea QuoteAreaStruct `json:"quote_area"`
SubTitleText string `json:"sub_title_text"` //二级普通文本,建议不超过160个字,
HorizontalContentList []HorizontalContentListStruct `json:"horizontal_content_list"` //二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6
CardAction CardActionStruct `json:"card_action"` //整体卡片的点击跳转事件,text_notice必填本字段
ButtonList []ButtonListStruct `json:"button_list"` //按钮列表,列表长度不超过6
}