Documentation ¶
Index ¶
- type Button
- func (btn *Button) SetClickButton(name, key string)
- func (btn *Button) SetLocationSelectButton(name, key string)
- func (btn *Button) SetMediaIDButton(name, mediaID string)
- func (btn *Button) SetMiniprogramButton(name, url, appID, pagePath string)
- func (btn *Button) SetPicPhotoOrAlbumButton(name, key string)
- func (btn *Button) SetPicSysPhotoButton(name, key string)
- func (btn *Button) SetPicWeixinButton(name, key string)
- func (btn *Button) SetScanCodePushButton(name, key string)
- func (btn *Button) SetScanCodeWaitMsgButton(name, key string)
- func (btn *Button) SetSubButton(name string, subButtons []*Button)
- func (btn *Button) SetViewButton(name, url string)
- func (btn *Button) SetViewLimitedButton(name, mediaID string)
- type ButtonNew
- type MatchRule
- type Menu
- func (menu *Menu) AddConditional(buttons []*Button, matchRule *MatchRule) error
- func (menu *Menu) AddConditionalByJSON(jsonInfo string) error
- func (menu *Menu) DeleteConditional(menuID int64) error
- func (menu *Menu) DeleteMenu() error
- func (menu *Menu) GetCurrentSelfMenuInfo() (resSelfMenuInfo ResSelfMenuInfo, err error)
- func (menu *Menu) GetMenu() (resMenu ResMenu, err error)
- func (menu *Menu) MenuTryMatch(userID string) (buttons []Button, err error)
- func (menu *Menu) SetMenu(buttons []*Button) error
- func (menu *Menu) SetMenuByJSON(jsonInfo string) error
- type ResMenu
- type ResSelfMenuInfo
- type SelfMenuButton
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Button ¶
type Button struct { Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Key string `json:"key,omitempty"` URL string `json:"url,omitempty"` MediaID string `json:"media_id,omitempty"` AppID string `json:"appid,omitempty"` PagePath string `json:"pagepath,omitempty"` SubButtons []*Button `json:"sub_button,omitempty"` }
Button 菜单按钮
func (*Button) SetClickButton ¶
SetClickButton btn 为click类型
func (*Button) SetLocationSelectButton ¶
SetLocationSelectButton 设置 弹出地理位置选择器 类型按钮
func (*Button) SetMediaIDButton ¶
SetMediaIDButton 设置 下发消息(除文本消息) 类型按钮
func (*Button) SetMiniprogramButton ¶
SetMiniprogramButton 设置 跳转小程序 类型按钮 (公众号后台必须已经关联小程序)
func (*Button) SetPicPhotoOrAlbumButton ¶
SetPicPhotoOrAlbumButton 设置弹出拍照或者相册发图类型按钮
func (*Button) SetPicSysPhotoButton ¶
SetPicSysPhotoButton 设置弹出系统拍照发图按钮
func (*Button) SetPicWeixinButton ¶
SetPicWeixinButton 设置弹出微信相册发图器类型按钮
func (*Button) SetScanCodePushButton ¶
SetScanCodePushButton 扫码推事件
func (*Button) SetScanCodeWaitMsgButton ¶
SetScanCodeWaitMsgButton 设置 扫码推事件且弹出"消息接收中"提示框
func (*Button) SetSubButton ¶
SetSubButton 设置二级菜单
func (*Button) SetViewButton ¶
SetViewButton view类型
func (*Button) SetViewLimitedButton ¶
SetViewLimitedButton 设置 跳转图文消息URL 类型按钮
type ButtonNew ¶
type ButtonNew struct { Title string `json:"title"` Author string `json:"author"` Digest string `json:"digest"` ShowCover int32 `json:"show_cover"` CoverURL string `json:"cover_url"` ContentURL string `json:"content_url"` SourceURL string `json:"source_url"` }
ButtonNew 图文消息菜单
type MatchRule ¶
type MatchRule struct { GroupID string `json:"group_id,omitempty"` Sex string `json:"sex,omitempty"` Country string `json:"country,omitempty"` Province string `json:"province,omitempty"` City string `json:"city,omitempty"` ClientPlatformType string `json:"client_platform_type,omitempty"` Language string `json:"language,omitempty"` }
MatchRule 个性化菜单规则
type Menu ¶
Menu struct
func (*Menu) AddConditional ¶
AddConditional 添加个性化菜单
func (*Menu) AddConditionalByJSON ¶
AddConditionalByJSON 添加个性化菜单
func (*Menu) DeleteConditional ¶
DeleteConditional 删除个性化菜单
func (*Menu) GetCurrentSelfMenuInfo ¶
func (menu *Menu) GetCurrentSelfMenuInfo() (resSelfMenuInfo ResSelfMenuInfo, err error)
GetCurrentSelfMenuInfo 获取自定义菜单配置接口
func (*Menu) MenuTryMatch ¶
MenuTryMatch 菜单匹配
func (*Menu) SetMenuByJSON ¶
SetMenuByJSON 设置按钮
type ResMenu ¶
type ResMenu struct { util.CommonError Menu struct { Button []Button `json:"button"` MenuID int64 `json:"menuid"` } `json:"menu"` }
ResMenu 查询菜单的返回数据
type ResSelfMenuInfo ¶
type ResSelfMenuInfo struct { util.CommonError IsMenuOpen int32 `json:"is_menu_open"` SelfMenuInfo struct { Button []SelfMenuButton `json:"button"` } `json:"selfmenu_info"` }
ResSelfMenuInfo 自定义菜单配置返回结果
type SelfMenuButton ¶
type SelfMenuButton struct { Type string `json:"type"` Name string `json:"name"` Key string `json:"key"` URL string `json:"url,omitempty"` Value string `json:"value,omitempty"` SubButton struct { List []SelfMenuButton `json:"list"` } `json:"sub_button,omitempty"` NewsInfo struct { List []ButtonNew `json:"list"` } `json:"news_info,omitempty"` }
SelfMenuButton 自定义菜单配置详情