agent

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMenu

func CreateMenu(agentID int64, params *ParamsMenuCreate) wx.Action

CreateMenu 创建菜单

func DeleteMenu

func DeleteMenu(agentID int64) wx.Action

DeleteMenu 删除菜单

func GetAgent

func GetAgent(agentID int64, result *ResultAgentGet) wx.Action

GetAgent 获取指定的应用详情

func GetMenu

func GetMenu(agentID int64, result *ResultMenuGet) wx.Action

GetMenu 获取菜单

func GetWorkbenchTemplate

func GetWorkbenchTemplate(agentID int64, result *ResultWorkbenchTemplateGet) wx.Action

GetWorkbenchTemplate 获取应用在工作台展示的模版

func ListAgent

func ListAgent(result *ResultAgentList) wx.Action

ListAgent 获取access_token对应的应用列表

func SetAgent

func SetAgent(params *ParamsAgentSet) wx.Action

SetAgent 设置应用

func SetWorkbenchImageData

func SetWorkbenchImageData(agentID int64, userID string, image *WorkbenchImage) wx.Action

SetWorkbenchImageData 设置应用在用户工作台展示的数据(图片型)

func SetWorkbenchImageTemplate

func SetWorkbenchImageTemplate(agentID int64, image *WorkbenchImage, replaceUserData bool) wx.Action

SetWorkbenchImageTemplate 设置应用在工作台展示的模版(图片型)

func SetWorkbenchKeyData

func SetWorkbenchKeyData(agentID int64, userID string, keydata *WorkbenchKeyData) wx.Action

SetWorkbenchKeyData 设置应用在用户工作台展示的数据(关键数据型)

func SetWorkbenchKeyDataTemplate

func SetWorkbenchKeyDataTemplate(agentID int64, keydata *WorkbenchKeyData, replaceUserData bool) wx.Action

SetWorkbenchKeyDataTemplate 设置应用在工作台展示的模版(关键数据型)

func SetWorkbenchListData

func SetWorkbenchListData(agentID int64, userID string, list *WorkbenchList) wx.Action

SetWorkbenchListData 设置应用在用户工作台展示的数据(列表型)

func SetWorkbenchListTemplate

func SetWorkbenchListTemplate(agentID int64, list *WorkbenchList, replaceUserData bool) wx.Action

SetWorkbenchListTemplate 设置应用在工作台展示的模版(列表型)

func SetWorkbenchNormalTemplate

func SetWorkbenchNormalTemplate(agentID int64, replaceUserData bool) wx.Action

SetWorkbenchNormalTemplate 设置应用在工作台展示的模版(从自定义模式切换为普通宫格或者列表展示模式)

func SetWorkbenchWebViewData

func SetWorkbenchWebViewData(agentID int64, userID string, webview *WorkbenchWebView) wx.Action

SetWorkbenchWebViewData 设置应用在用户工作台展示的数据(webview型)

func SetWorkbenchWebViewTemplate

func SetWorkbenchWebViewTemplate(agentID int64, webview *WorkbenchWebView, replaceUserData bool) wx.Action

SetWorkbenchWebViewTemplate 设置应用在工作台展示的模版(webview型)

Types

type AgentListData

type AgentListData struct {
	AgentID       int64  `json:"agentid"`
	Name          string `json:"name"`
	SquareLogoURL string `json:"square_logo_url"`
}

type AllowPartys

type AllowPartys struct {
	PartyID []int64 `json:"partyid"`
}

type AllowTags

type AllowTags struct {
	TagID []int64 `json:"tagid"`
}

type AllowUser

type AllowUser struct {
	UserID string `json:"userid"`
}

type AllowUserInfos

type AllowUserInfos struct {
	User []AllowUser `json:"user"`
}

type Button

type Button struct {
	Type      ButtonType `json:"type,omitempty"`       // 菜单的响应动作类型,view表示网页类型,click表示点击类型,miniprogram表示小程序类型
	Name      string     `json:"name,omitempty"`       // 菜单标题,不超过16个字节,子菜单不超过60个字节
	Key       string     `json:"key,omitempty"`        // click等点击类型必须,菜单KEY值,用于消息接口推送,不超过128字节
	URL       string     `json:"url,omitempty"`        // view、miniprogram类型必须,网页 链接,用户点击菜单可打开链接,不超过1024字节。 type为miniprogram时,不支持小程序的老版本客户端将打开本url。
	PagePath  string     `json:"pagepath,omitempty"`   // miniprogram类型必须,小程序的页面路径
	AppID     string     `json:"appid,omitempty"`      // miniprogram类型必须,小程序的appid(仅认证公众号可配置)
	SubButton []*Button  `json:"sub_button,omitempty"` // 二级菜单数组,个数应为1~5个
}

Button 菜单按钮

func ClickButton

func ClickButton(name, key string) *Button

ClickButton 点击事件按钮

func GroupButton

func GroupButton(name string, buttons ...*Button) *Button

GroupButton 组合按钮

func LocationSelectButton

func LocationSelectButton(name, key string) *Button

LocationSelectButton 发送位置按钮

func PicPhotoOrAlbumButton

func PicPhotoOrAlbumButton(name, key string) *Button

PicPhotoOrAlbumButton 拍照或者相册发图按钮

func PicSysPhotoButton

func PicSysPhotoButton(name, key string) *Button

PicSysPhotoButton 系统拍照发图按钮

func PicWeixinButton

func PicWeixinButton(name, key string) *Button

PicWeixinButton 微信相册发图按钮

func ScanCodePushButton

func ScanCodePushButton(name, key string) *Button

ScanCodePushButton 扫码推事件按钮

func ScanCodeWaitMsgButton

func ScanCodeWaitMsgButton(name, key string) *Button

ScanCodeWaitMsgButton 扫码带提示按钮

func ViewButton

func ViewButton(name, redirectURL string) *Button

ViewButton 跳转URL按钮

func ViewMinipButton

func ViewMinipButton(name, appid, pagepath string) *Button

ViewMinipButton 小程序跳转按钮

type ButtonType

type ButtonType string

ButtonType 菜单按钮类型

const (
	ButtonClick           ButtonType = "click"              // 成员点击click类型按钮后,企业微信服务器会通过消息接口推送消息类型为event 的结构给开发者(参考消息接口指南),并且带上按钮中开发者填写的key值,开发者可以通过自定义的key值与成员进行交互
	ButtonView            ButtonType = "view"               // 成员点击view类型按钮后,企业微信客户端将会打开开发者在按钮中填写的网页URL,可与网页授权获取成员基本信息接口结合,获得成员基本信息
	ButtonScanCodePush    ButtonType = "scancode_push"      // 成员点击按钮后,企业微信客户端将调起扫一扫工具,完成扫码操作后显示扫描结果(如果是URL,将进入URL),且会将扫码的结果传给开发者,开发者可用于下发消息
	ButtonScanCodeWaitMsg ButtonType = "scancode_waitmsg"   // 成员点击按钮后,企业微信客户端将调起扫一扫工具,完成扫码操作后,将扫码的结果传给开发者,同时收起扫一扫工具,然后弹出“消息接收中”提示框,随后可能会收到开发者下发的消息
	ButtonPicSysPhoto     ButtonType = "pic_sysphoto"       // 弹出系统拍照发图 成员点击按钮后,企业微信客户端将调起系统相机,完成拍照操作后,会将拍摄的相片发送给开发者,并推送事件给开发者,同时收起系统相机,随后可能会收到开发者下发的消息
	ButtonPicPhotoOrAlbum ButtonType = "pic_photo_or_album" // 成员点击按钮后,企业微信客户端将弹出选择器供成员选择“拍照”或者“从手机相册选择”。成员选择后即走其他两种流程
	ButtonPicWeixin       ButtonType = "pic_weixin"         // 成员点击按钮后,企业微信客户端将调起企业微信相册,完成选择操作后,将选择的相片发送给开发者的服务器,并推送事件给开发者,同时收起相册,随后可能会收到开发者下发的消息
	ButtonLocationSelect  ButtonType = "location_select"    // 成员点击按钮后,企业微信客户端将调起地理位置选择工具,完成选择操作后,将选择的地理位置发送给开发者的服务器,同时收起位置选择工具,随后可能会收到开发者下发的消息
	ButtonViewMinip       ButtonType = "view_miniprogram"   // 成员点击按钮后,企业微信客户端将会打开开发者在按钮中配置的小程序
)

微信支持的按钮

type KeyDataItem

type KeyDataItem struct {
	Key      string `json:"key"`
	Data     string `json:"data"`
	JumpURL  string `json:"jump_url"`
	PagePath string `json:"pagepath"`
}

type ListItem

type ListItem struct {
	Title    string `json:"title"`
	JumpURL  string `json:"jump_url"`
	PagePath string `json:"pagepath"`
}

type ParamsAgentSet

type ParamsAgentSet struct {
	AgentID            int64  `json:"agentid"`
	ReportLocationFlag int    `json:"report_location_flag"`
	LogoMediaID        string `json:"logo_mediaid"`
	Name               string `json:"name"`
	Description        string `json:"description"`
	RedirectDomain     string `json:"redirect_domain"`
	ISReportEnter      int    `json:"isreportenter"`
	HomeURL            string `json:"home_url"`
}

type ParamsMenuCreate

type ParamsMenuCreate struct {
	Button []*Button `json:"button"`
}

type ParamsWorkbenchDataSet

type ParamsWorkbenchDataSet struct {
	AgentID int64             `json:"agentid"`
	UserID  string            `json:"userid"`
	Type    TplType           `json:"type"`
	KeyData *WorkbenchKeyData `json:"keydata,omitempty"`
	Image   *WorkbenchImage   `json:"image,omitempty"`
	List    *WorkbenchList    `json:"list,omitempty"`
	WebView *WorkbenchWebView `json:"webview,omitempty"`
}

type ParamsWorkbenchTemplateGet

type ParamsWorkbenchTemplateGet struct {
	AgentID int64 `json:"agentid"`
}

type ParamsWorkbenchTemplateSet

type ParamsWorkbenchTemplateSet struct {
	AgentID         int64             `json:"agentid"`
	Type            TplType           `json:"type"`
	KeyData         *WorkbenchKeyData `json:"keydata,omitempty"`
	Image           *WorkbenchImage   `json:"image,omitempty"`
	List            *WorkbenchList    `json:"list,omitempty"`
	WebView         *WorkbenchWebView `json:"webview,omitempty"`
	ReplaceUserData bool              `json:"replace_user_data"`
}

type ResultAgentGet

type ResultAgentGet struct {
	AgentID                 int64          `json:"agentid"`
	Name                    string         `json:"name"`
	SquareLogoURL           string         `json:"square_logo_url"`
	Description             string         `json:"description"`
	Close                   int            `json:"close"`
	RedirectDomain          string         `json:"redirect_domain"`
	ReportLocationFlag      int            `json:"report_location_flag"`
	ISReportenter           int            `json:"is_reportenter"`
	HomeURL                 string         `json:"home_url"`
	CustomizedPublishStatus int            `json:"customized_publish_status"`
	AllowUserInfos          AllowUserInfos `json:"allow_userinfos"`
	AllowPartys             AllowPartys    `json:"allow_partys"`
	AllowTags               AllowTags      `json:"allow_tags"`
}

type ResultAgentList

type ResultAgentList struct {
	AgentList []*AgentListData `json:"agentlist"`
}

type ResultMenuGet

type ResultMenuGet struct {
	Button []*Button `json:"button"`
}

type ResultWorkbenchTemplateGet

type ResultWorkbenchTemplateGet struct {
	Type            TplType           `json:"type"`
	KeyData         *WorkbenchKeyData `json:"keydata"`
	Image           *WorkbenchImage   `json:"image"`
	List            *WorkbenchList    `json:"list"`
	WebView         *WorkbenchWebView `json:"webview"`
	ReplaceUserData bool              `json:"replace_user_data"`
}

type TplType

type TplType string
const (
	TplNormal  TplType = "normal"
	TplKeyData TplType = "keydata"
	TplImage   TplType = "image"
	TplList    TplType = "list"
	TplWebView TplType = "webview"
)

type WorkbenchImage

type WorkbenchImage struct {
	URL      string `json:"url"`
	JumpURL  string `json:"jump_url"`
	PagePath string `json:"pagepath"`
}

type WorkbenchKeyData

type WorkbenchKeyData struct {
	Items []*KeyDataItem `json:"items"`
}

type WorkbenchList

type WorkbenchList struct {
	Items []*ListItem `json:"items"`
}

type WorkbenchWebView

type WorkbenchWebView struct {
	URL      string `json:"url"`
	JumpURL  string `json:"jump_url"`
	PagePath string `json:"pagepath"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL