offia

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const MaxUserListCount = 10000

MaxUserListCount 关注列表的最大数目

Variables

This section is empty.

Functions

func AICrop

func AICrop(imgPath string, result *ResultAICrop) wx.Action

AICrop 智能接口 - 图片智能裁切

func AICropByURL

func AICropByURL(imgURL string, result *ResultAICrop) wx.Action

AICropByURL 智能接口 - 图片智能裁切

func AddDraft

func AddDraft(params *ParamsDraftAdd, result *ResultDraftAdd) wx.Action

AddDraft 草稿箱 - 新建草稿

func AddMaterial

func AddMaterial(mediaType MediaType, mediaPath string, result *ResultMaterialAdd) wx.Action

AddMaterial 素材管理 - 新增其他类型永久素材(支持图片、音频、缩略图)

func AddMaterialByURL

func AddMaterialByURL(mediaType MediaType, filename, url string, result *ResultMaterialAdd) wx.Action

AddMaterialByURL 素材管理 - 新增其他类型永久素材(支持图片、音频、缩略图)

func AddNews

func AddNews(articles []*NewsArticle, result *ResultMaterialAdd) wx.Action

AddNews 素材管理 - 新增永久图文素材(公众号的素材库保存总数量有上限:图文消息素材、图片素材上限为100000,其他类型为1000)

func AddSubscribeTemplate

func AddSubscribeTemplate(params *ParamsSubscribeTemplAdd, result *ResultSubscribeTemplAdd) wx.Action

AddSubscribeTemplate 订阅通知 - 选用模板

func AddTemplate

func AddTemplate(templIDShort string, result *ResultTemplAdd) wx.Action

AddTemplate 基础消息能力 - 模板消息 - 获得模板ID

func BatchBlackUsers

func BatchBlackUsers(openids ...string) wx.Action

BatchBlackUsers 用户管理 - 拉黑用户

func BatchGetDraft

func BatchGetDraft(offset, count, nocontent int, result *ResultDraftBatchGet) wx.Action

BatchGetDraft 草稿箱 - 获取草稿列表

func BatchGetPublish

func BatchGetPublish(offset, count, nocontent int, result *ResultPublishBatchGet) wx.Action

BatchGetPublish 发布能力 - 获取成功发布列表

func BatchGetUserInfo

func BatchGetUserInfo(users []*ParamsUserInfo, result *ResultBatchUserInfo) wx.Action

BatchGetUserInfo 用户管理 - 批量获取用户基本信息

func BatchTaggingUsers

func BatchTaggingUsers(tagID int64, openids ...string) wx.Action

BatchTaggingUsers 用户管理 - 用户标签管理 - 批量为用户打标签

func BatchUnBlackUsers

func BatchUnBlackUsers(openids ...string) wx.Action

BatchUnBlackUsers 用户管理 - 取消拉黑用户

func BatchUnTaggingUsers

func BatchUnTaggingUsers(tagID int64, openids ...string) wx.Action

BatchUnTaggingUsers 用户管理 - 用户标签管理 - 批量为用户取消标签

func CheckOAuthToken

func CheckOAuthToken(openid string) wx.Action

CheckOAuthToken 检验授权凭证(access_token)是否有效

func CreateConditionalMenu

func CreateConditionalMenu(matchRule *MenuMatchRule, buttons ...*MenuButton) wx.Action

CreateConditionalMenu 自定义菜单 - 创建个性化菜单

func CreateMenu

func CreateMenu(buttons ...*MenuButton) wx.Action

CreateMenu 自定义菜单 - 创建自定义菜单

func CreateQRCode

func CreateQRCode(params *ParamsQRCodeCreate, result *ResultQRCodeCreate) wx.Action

CreateQRCode 帐号管理 - 生成带参数的二维码(expireSeconds:二维码有效时间,最大不超过2592000秒(即30天),不填,则默认有效期为30秒。)

func CreateTag

func CreateTag(name string, result *ResultTagCreate) wx.Action

CreateTag 用户管理 - 用户标签管理 - 创建标签

func DelPrivateTemplate

func DelPrivateTemplate(templID string) wx.Action

DelPrivateTemplate 基础消息能力 - 模板消息 - 删除模板

func DeleteConditionalMenu

func DeleteConditionalMenu(menuID string) wx.Action

DeleteConditionalMenu 自定义菜单 - 删除个性化菜单

func DeleteDraft

func DeleteDraft(mediaID string) wx.Action

DeleteDraft 草稿箱 - 删除草稿

func DeleteMaterial

func DeleteMaterial(mediaID string) wx.Action

DeleteMaterial 素材管理 - 删除永久素材

func DeleteMenu

func DeleteMenu() wx.Action

DeleteMenu 自定义菜单 - 删除自定义菜单

func DeletePublish

func DeletePublish(articleID string, index int) wx.Action

DeletePublish 发布能力 - 删除发布

func DeleteSubscribeTemplate

func DeleteSubscribeTemplate(priTmplID string) wx.Action

DeleteSubscribeTemplate 订阅通知 - 删除模板

func DeleteTag

func DeleteTag(id int64) wx.Action

DeleteTag 用户管理 - 用户标签管理 - 删除标签

func GetAllPrivateTemplate

func GetAllPrivateTemplate(result *ResultAllPrivateTemplate) wx.Action

GetAllPrivateTemplate 基础消息能力 - 模板消息 - 获取模板列表

func GetApiTicket

func GetApiTicket(ticketType TicketType, result *ResultApiTicket) wx.Action

GetApiTicket 获取 JSApi ticket (注意:使用普通access_token)

func GetDraft

func GetDraft(mediaID string, result *ResultDraftGet) wx.Action

GetDraft 草稿箱 - 获取草稿

func GetDraftCount

func GetDraftCount(result *ResultDraftCount) wx.Action

GetDraftCount 草稿箱 - 获取草稿总数

func GetIndustry

func GetIndustry(result *ResultIndustryGet) wx.Action

GetIndustry 基础消息能力 - 模板消息 - 获取设置的行业信息

func GetMaterialCount

func GetMaterialCount(result *ResultMaterialCount) wx.Action

GetMaterialCount 素材管理 - 获取素材总数

func GetMenu

func GetMenu(result *ResultMenuGet) wx.Action

GetMenu 自定义菜单 - 获取自定义菜单配置

func GetNewsMaterial

func GetNewsMaterial(mediaID string, result *ResultNewsMaterialGet) wx.Action

GetNewsMaterial 素材管理 - 获取永久素材(图文)

func GetOAuthUser

func GetOAuthUser(openid string, result *ResultOAuthUser) wx.Action

GetOAuthUser 获取授权用户信息(注意:使用网页授权的access_token)

func GetOtherMaterial

func GetOtherMaterial(mediaID string, result *ResultOtherMaterialGet) wx.Action

GetOtherMaterial 素材管理 - 获取永久素材(其他类型的素材消息,返回的直接为素材的内容)

func GetPubTemplateKeywords

func GetPubTemplateKeywords(tid string, result *ResultPubTemplKeywords) wx.Action

GetPubTemplateKeywords 订阅通知 - 获取模板中的关键词

func GetPubTemplateTitles

func GetPubTemplateTitles(ids string, start, limit int, result *ResultPubTemplTitles) wx.Action

GetPubTemplateTitles 订阅通知 - 获取类目下的公共模板

func GetPublish

func GetPublish(publishID string, result *ResultPublishGet) wx.Action

GetPublish 发布能力 - 发布状态轮询 开发者可以尝试通过下面的发布状态轮询接口获知发布情况。

func GetPublishArticle

func GetPublishArticle(articleID string, result *ResultPublishArticle) wx.Action

GetPublishArticle 发布能力 - 通过 article_id 获取已发布文章

func GetSubscribeCategory

func GetSubscribeCategory(result *ResultSubscribeCategory) wx.Action

GetSubscribeCategory 订阅通知 - 获取公众号类目

func GetTagUsers

func GetTagUsers(tagID int64, nextOpenID string, result *ResultTagUsers) wx.Action

GetTagUsers 用户管理 - 用户标签管理 - 获取标签下粉丝列表

func GetTags

func GetTags(result *ResultTagsGet) wx.Action

GetTags 用户管理 - 用户标签管理 - 获取公众号已创建的标签

func GetUserInfo

func GetUserInfo(openid, lang string, result *UserInfo) wx.Action

GetUserInfo 用户管理 - 获取用户基本信息(包括UnionID机制)

func GetUserTags

func GetUserTags(openid string, result *ResultUserTags) wx.Action

GetUserTags 用户管理 - 用户标签管理 - 获取用户身上的标签列表

func GetVideoMaterial

func GetVideoMaterial(mediaID string, result *ResultVideoMaterialGet) wx.Action

GetVideoMaterial 素材管理 - 获取永久素材(视频消息)

func ListBlackUsers

func ListBlackUsers(beginOpenID string, result *ResultBlackList) wx.Action

ListBlackUsers 用户管理 - 获取公众号的黑名单列表

func ListMaterialNews

func ListMaterialNews(offset, count int, result *ResultMaterialNewsList) wx.Action

ListMaterialNews 素材管理 - 获取素材列表(永久图文消息)

func ListMatertial

func ListMatertial(mediaType MediaType, offset, count int, result *ResultMaterialList) wx.Action

ListMatertial 素材管理 - 获取素材列表(其他类型:图片、语音、视频)

func ListSubscribeTemplate

func ListSubscribeTemplate(result *ResultSubscribeTemplList) wx.Action

ListSubscribeTemplate 订阅通知 - 获取私有模板列表

func ListUser

func ListUser(nextOpenID string, result *ResultUserList) wx.Action

ListUser 用户管理 - 获取用户列表

func OCRBankCard

func OCRBankCard(mode OCRMode, imgPath string, result *ResultBankCardOCR) wx.Action

OCRBankCard 智能接口 - 银行卡识别

func OCRBankCardByURL

func OCRBankCardByURL(mode OCRMode, imgURL string, result *ResultBankCardOCR) wx.Action

OCRBankCardByURL 智能接口 - 银行卡识别

func OCRBusinessLicense

func OCRBusinessLicense(mode OCRMode, imgPath string, result *ResultBusinessLicenseOCR) wx.Action

OCRBusinessLicense 智能接口 - 营业执照识别

func OCRBusinessLicenseByURL

func OCRBusinessLicenseByURL(mode OCRMode, imgURL string, result *ResultBusinessLicenseOCR) wx.Action

OCRBusinessLicenseByURL 智能接口 - 营业执照识别

func OCRComm

func OCRComm(mode OCRMode, imgPath string, result *ResultCommOCR) wx.Action

OCRComm 智能接口 - 通用印刷体识别

func OCRCommByURL

func OCRCommByURL(mode OCRMode, imgURL string, result *ResultCommOCR) wx.Action

OCRCommByURL 智能接口 - 通用印刷体识别

func OCRDriverLicense

func OCRDriverLicense(mode OCRMode, imgPath string, result *ResultDriverLicenseOCR) wx.Action

OCRDriverLicense 智能接口 - 驾照识别

func OCRDriverLicenseByURL

func OCRDriverLicenseByURL(mode OCRMode, imgURL string, result *ResultDriverLicenseOCR) wx.Action

OCRDriverLicenseByURL 智能接口 - 驾照识别

func OCRIDCardBack

func OCRIDCardBack(mode OCRMode, imgPath string, result *ResultIDCardBackOCR) wx.Action

OCRIDCardBack 智能接口 - 身份证背面识别

func OCRIDCardBackByURL

func OCRIDCardBackByURL(mode OCRMode, imgURL string, result *ResultIDCardBackOCR) wx.Action

OCRIDCardBackByURL 智能接口 - 身份证背面识别

func OCRIDCardFront

func OCRIDCardFront(mode OCRMode, imgPath string, result *ResultIDCardFrontOCR) wx.Action

OCRIDCardFront 智能接口 - 身份证前面识别

func OCRIDCardFrontByURL

func OCRIDCardFrontByURL(mode OCRMode, imgURL string, result *ResultIDCardFrontOCR) wx.Action

OCRIDCardFrontByURL 智能接口 - 身份证前面识别

func OCRPlateNumber

func OCRPlateNumber(mode OCRMode, imgPath string, result *ResultPlateNumberOCR) wx.Action

OCRPlateNumber 智能接口 - 车牌号识别

func OCRPlateNumberByURL

func OCRPlateNumberByURL(mode OCRMode, imgURL string, result *ResultPlateNumberOCR) wx.Action

OCRPlateNumberByURL 智能接口 - 车牌号识别

func OCRVehicleLicense

func OCRVehicleLicense(mode OCRMode, imgPath string, result *ResultVehicleLicenseOCR) wx.Action

OCRVehicleLicense 智能接口 - 行驶证识别

func OCRVehicleLicenseByURL

func OCRVehicleLicenseByURL(mode OCRMode, imgURL string, result *ResultVehicleLicenseOCR) wx.Action

OCRVehicleLicenseByURL 智能接口 - 行驶证识别

func ReplyImage

func ReplyImage(mediaID string) event.Reply

ReplyImage 回复图片消息

func ReplyMusic

func ReplyMusic(music *XMLMusic) event.Reply

ReplyMusic 回复音乐消息

func ReplyNews

func ReplyNews(articles ...*XMLNewsArticle) event.Reply

ReplyNews 回复图文消息

func ReplyText

func ReplyText(content string) event.Reply

ReplyText 回复文本消息

func ReplyVideo

func ReplyVideo(mediaID, title, description string) event.Reply

ReplyVideo 回复视频消息

func ReplyVoice

func ReplyVoice(mediaID string) event.Reply

ReplyVoice 回复语音消息

func ScanQRCode

func ScanQRCode(imgPath string, result *ResultQRCodeScan) wx.Action

ScanQRCode 智能接口 - 条码/二维码识别

func ScanQRCodeByURL

func ScanQRCodeByURL(imgURL string, result *ResultQRCodeScan) wx.Action

ScanQRCodeByURL 智能接口 - 条码/二维码识别

func SendSubscribeMinipMsg

func SendSubscribeMinipMsg(templateID, openid string, minip *MsgMinip, data MsgTemplData) wx.Action

SendSubscribeMinipMsg 订阅通知 - 发送订阅通知(小程序跳转)

func SendSubscribePageMsg

func SendSubscribePageMsg(templateID, openid, page string, data MsgTemplData) wx.Action

SendSubscribePageMsg 订阅通知 - 发送订阅通知(网页跳转)

func SendTemplateMsg

func SendTemplateMsg(msg *TemplateMsg) wx.Action

SendTemplateMsg 基础消息能力 - 模板消息 - 发送模板消息

func SetIndustry

func SetIndustry(id1, id2 string) wx.Action

SetIndustry 基础消息能力 - 模板消息 - 设置所属行业

func SetUserRemark

func SetUserRemark(openid, remark string) wx.Action

SetUserRemark 用户管理 - 设置用户备注名(该接口暂时开放给微信认证的服务号)

func ShortURL

func ShortURL(longURL string, result *ResultShortURL) wx.Action

ShortURL 帐号管理 - 长链接转短链接(长链接支持http://、https://、weixin://wxpay格式的url)

func ShowQRCode

func ShowQRCode(ctx context.Context, ticket string) (string, error)

ShowQRCode 通过 ticket 换取二维码 (base64)

func SubmitPublish

func SubmitPublish(mediaID string, result *ResultPublishSubmit) wx.Action

SubmitPublish 发布能力 - 发布图文 开发者需要先将图文素材以草稿的形式保存(见“草稿箱/新建草稿”,如需从已保存的草稿中选择,见“草稿箱/获取草稿列表”),选择要发布的草稿 media_id 进行发布

func SubscribeTemplate

func SubscribeTemplate(params *ParamsTemplateSubscribe) wx.Action

SubscribeTemplateSubscribe 基础消息能力 - 公众号一次性订阅消息

func SuperreSolution

func SuperreSolution(imgPath string, result *ResultSuperreSolution) wx.Action

SuperreSolution 智能接口 - 图片高清化

func SuperreSolutionByURL

func SuperreSolutionByURL(imgURL string, result *ResultSuperreSolution) wx.Action

SuperreSolutionByURL 智能接口 - 图片高清化

func TransferToKF

func TransferToKF(kfAccount ...string) event.Reply

TransferToKF 消息转发到客服

func TryMatchMenu

func TryMatchMenu(userID string, result *ResultMenuMatch) wx.Action

TryMatchMenu 自定义菜单 - 测试匹配个性化菜单(user_id可以是粉丝的OpenID,也可以是粉丝的微信号)

func UpdateDraft

func UpdateDraft(mediaID string, index int, article *DraftArticle) wx.Action

UpdateDraft 草稿箱 - 修改草稿

func UpdateNews

func UpdateNews(mediaID, index string, article *NewsArticle) wx.Action

UpdateNews 素材管理 - 编辑永久图文素材

func UpdateTag

func UpdateTag(id int64, name string) wx.Action

UpdateTag 用户管理 - 用户标签管理 - 编辑标签

func UploadImg

func UploadImg(imgPath string, result *ResultMaterialAdd) wx.Action

UploadImg 素材管理 - 上传图文消息内的图片(不受公众号的素材库中图片数量的100000个的限制,图片仅支持jpg/png格式,大小必须在1MB以下)

func UploadImgByURL

func UploadImgByURL(filename, url string, result *ResultMaterialAdd) wx.Action

UploadImgByURL 素材管理 - 上传图文消息内的图片(不受公众号的素材库中图片数量的100000个的限制,图片仅支持jpg/png格式,大小必须在1MB以下)

func UploadMedia

func UploadMedia(mediaType MediaType, mediaPath string, result *ResultMediaUpload) wx.Action

UploadMedia 素材管理 - 上传临时素材

func UploadMediaByURL

func UploadMediaByURL(mediaType MediaType, filename, url string, result *ResultMediaUpload) wx.Action

UploadMediaByURL 素材管理 - 上传临时素材

func UploadVideo

func UploadVideo(videoPath, title, description string, result *ResultMaterialAdd) wx.Action

UploadVideo 素材管理 - 上传视频永久素材

func UploadVideoByURL

func UploadVideoByURL(filename, videoURL, title, description string, result *ResultMaterialAdd) wx.Action

UploadVideoByURL 素材管理 - 上传视频永久素材

Types

type AccessToken

type AccessToken struct {
	Token     string `json:"access_token"`
	ExpiresIn int64  `json:"expires_in"`
}

AccessToken 公众号普通AccessToken

type AuthScope

type AuthScope string

AuthScope 应用授权作用域

const (
	ScopeSnsapiBase AuthScope = "snsapi_base"     // 静默授权使用,不弹出授权页面,直接跳转,只能获取用户openid
	ScopeSnsapiUser AuthScope = "snsapi_userinfo" // 弹出授权页面,可通过openid拿到昵称、性别、所在地。并且,即使在未关注的情况下,只要用户授权,也能获取其信息
)

公众号支持的应用授权作用域

type CommOCRItem

type CommOCRItem struct {
	Text string        `json:"text"`
	Pos  ImagePosition `json:"pos"`
}

CommOCRItem 通用印刷体内容项

type ConditionalMenu

type ConditionalMenu struct {
	Button    []*MenuButton `json:"button"`    // 菜单按钮
	MatchRule MenuMatchRule `json:"matchrule"` // 菜单匹配规则
	MenuID    int64         `json:"menuid"`    // 菜单ID
}

ConditionalMenu 个性化菜单

type CropPosition

type CropPosition struct {
	CropLeft   int `json:"crop_left"`
	CropTop    int `json:"crop_top"`
	CropRight  int `json:"crop_right"`
	CropBottom int `json:"crop_bottom"`
}

CropPosition 裁切位置

type DraftArticle

type DraftArticle struct {
	Title              string `json:"title"`
	Author             string `json:"author,omitempty"`
	Digest             string `json:"digest,omitempty"`
	Content            string `json:"content"`
	ContentSourceURL   string `json:"content_source_url,omitempty"`
	ThumbMediaID       string `json:"thumb_media_id"`
	ShowCoverPic       int    `json:"show_cover_pic,omitempty"`
	NeedOpenComment    int    `json:"need_open_comment,omitempty"`
	OnlyFansCanComment int    `json:"only_fans_can_comment,omitempty"`
	URL                string `json:"url,omitempty"`
}

type DraftContent

type DraftContent struct {
	NewsItem []*DraftArticle `json:"news_item"`
}

type DraftDetail

type DraftDetail struct {
	ArticleID  string        `json:"article_id"`
	Content    *DraftContent `json:"content"`
	UpdateTime int64         `json:"update_time"`
}

type ImagePosition

type ImagePosition struct {
	LeftTop     Position `json:"left_top"`
	RightTop    Position `json:"right_top"`
	RightBottom Position `json:"right_bottom"`
	LeftBottom  Position `json:"left_bottom"`
}

ImagePosition 图片位置

type ImageSize

type ImageSize struct {
	W int `json:"w"`
	H int `json:"h"`
}

ImageSize 图片尺寸

type IndustryInfo

type IndustryInfo struct {
	FirstClass  string `json:"first_class"`
	SecondClass string `json:"second_class"`
}

type JSApiSign

type JSApiSign struct {
	Signature string `json:"signature"`
	NonceStr  string `json:"noncestr"`
	Timestamp int64  `json:"timestamp"`
}

JSApiSign JSApi签名

type MaterialListItem

type MaterialListItem struct {
	MediaID    string `json:"media_id"`
	Name       string `json:"name"`
	UpdateTime int64  `json:"update_time"`
	URL        string `json:"url"`
}

type MaterialNewsItem

type MaterialNewsItem struct {
	Title            string `json:"title"`
	ThumbMediaID     string `json:"thumb_media_id"`
	ShowCoverPic     int    `json:"show_cover_pic"`
	Author           string `json:"author"`
	Digest           string `json:"digest"`
	Content          string `json:"content"`
	URL              string `json:"url"`
	ContentSourceURL string `json:"content_source_url"`
}

type MaterialNewsListContent

type MaterialNewsListContent struct {
	NewsItem []*MaterialNewsItem `json:"news_item"`
}

type MaterialNewsListItem

type MaterialNewsListItem struct {
	MediaID    string                   `json:"media_id"`
	UpdateTime int64                    `json:"update_time"`
	Content    *MaterialNewsListContent `json:"content"`
}

type MediaType

type MediaType string

MediaType 素材类型

const (
	MediaImage MediaType = "image" // 图片
	MediaVoice MediaType = "voice" // 音频
	MediaVideo MediaType = "video" // 视频
	MediaThumb MediaType = "thumb" // 缩略图
)

微信支持的素材类型

type Menu struct {
	Button []*MenuButton `json:"button"` // 菜单按钮
	MenuID int64         `json:"menuid"` // 菜单ID(有个性化菜单时返回)
}

Menu 普通菜单

type MenuButton struct {
	Type      MenuButtonType `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。
	AppID     string         `json:"appid,omitempty"`      // miniprogram类型必须,小程序的appid(仅认证公众号可配置)
	PagePath  string         `json:"pagepath,omitempty"`   // miniprogram类型必须,小程序的页面路径
	MediaID   string         `json:"media_id,omitempty"`   // media_id类型和view_limited类型必须,调用新增永久素材接口返回的合法media_id
	ArticleID string         `json:"article_id,omitempty"` // article_id类型和article_view_limited类型必须
	SubButton []*MenuButton  `json:"sub_button,omitempty"` // 二级菜单数组,个数应为1~5个
}

MenuButton 菜单按钮

func ArticleButton

func ArticleButton(name, articleID string) *MenuButton

ArticleButton 图文消息按钮

func ArticleViewLimitedButton

func ArticleViewLimitedButton(name, articleID string) *MenuButton

ArticleViewLimitedButton 图文消息按钮

func ClickButton

func ClickButton(name, key string) *MenuButton

ClickButton 点击事件按钮

func GroupButton

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

GroupButton 组合按钮

func LocationSelectButton

func LocationSelectButton(name, key string) *MenuButton

LocationSelectButton 发送位置按钮

func MediaButton

func MediaButton(name, mediaID string) *MenuButton

MediaButton 素材按钮

func MinipButton

func MinipButton(name, appid, pagepath, redirectURL string) *MenuButton

MinipButton 小程序跳转按钮

func PicPhotoOrAlbumButton

func PicPhotoOrAlbumButton(name, key string) *MenuButton

PicPhotoOrAlbum 拍照或者相册发图按钮

func PicSysPhotoButton

func PicSysPhotoButton(name, key string) *MenuButton

PicSysPhotoButton 系统拍照发图按钮

func PicWeixinButton

func PicWeixinButton(name, key string) *MenuButton

PicWeixinButton 微信相册发图按钮

func ScanCodePushButton

func ScanCodePushButton(name, key string) *MenuButton

ScanCodePushButton 扫码推事件按钮

func ScanCodeWaitMsgButton

func ScanCodeWaitMsgButton(name, key string) *MenuButton

ScanCodeWaitMsgButton 扫码带提示按钮

func ViewButton

func ViewButton(name, redirectURL string) *MenuButton

ViewButton 跳转URL按钮

func ViewLimitedButton

func ViewLimitedButton(name, mediaID string) *MenuButton

ViewLimitedButton 图文消息按钮

type MenuButtonType string

MenuButtonType 菜单按钮类型

const (
	ButtonClick              MenuButtonType = "click"                // 点击推事件用户点击click类型按钮后,微信服务器会通过消息接口推送消息类型为event的结构给开发者(参考消息接口指南),并且带上按钮中开发者填写的key值,开发者可以通过自定义的key值与用户进行交互。
	ButtonView               MenuButtonType = "view"                 // 跳转URL用户点击view类型按钮后,微信客户端将会打开开发者在按钮中填写的网页URL,可与网页授权获取用户基本信息接口结合,获得用户基本信息。
	ButtonScanCodePush       MenuButtonType = "scancode_push"        // 扫码推事件用户点击按钮后,微信客户端将调起扫一扫工具,完成扫码操作后显示扫描结果(如果是URL,将进入URL),且会将扫码的结果传给开发者,开发者可以下发消息。
	ButtonScanCodeWaitMsg    MenuButtonType = "scancode_waitmsg"     // 扫码推事件且弹出“消息接收中”提示框用户点击按钮后,微信客户端将调起扫一扫工具,完成扫码操作后,将扫码的结果传给开发者,同时收起扫一扫工具,然后弹出“消息接收中”提示框,随后可能会收到开发者下发的消息。
	ButtonPicSysPhoto        MenuButtonType = "pic_sysphoto"         // 弹出系统拍照发图用户点击按钮后,微信客户端将调起系统相机,完成拍照操作后,会将拍摄的相片发送给开发者,并推送事件给开发者,同时收起系统相机,随后可能会收到开发者下发的消息。
	ButtonPicPhotoOrAlbum    MenuButtonType = "pic_photo_or_album"   // 弹出拍照或者相册发图用户点击按钮后,微信客户端将弹出选择器供用户选择“拍照”或者“从手机相册选择”。用户选择后即走其他两种流程。
	ButtonPicWeixin          MenuButtonType = "pic_weixin"           // 弹出微信相册发图器用户点击按钮后,微信客户端将调起微信相册,完成选择操作后,将选择的相片发送给开发者的服务器,并推送事件给开发者,同时收起相册,随后可能会收到开发者下发的消息。
	ButtonLocationSelect     MenuButtonType = "location_select"      // 弹出地理位置选择器用户点击按钮后,微信客户端将调起地理位置选择工具,完成选择操作后,将选择的地理位置发送给开发者的服务器,同时收起位置选择工具,随后可能会收到开发者下发的消息。
	ButtonMedia              MenuButtonType = "media_id"             // 下发消息(除文本消息)用户点击 media_id 类型按钮后,微信服务器会将开发者填写的永久素材id对应的素材下发给用户,永久素材类型可以是图片、音频、视频、图文消息。请注意:永久素材id必须是在“素材管理/新增永久素材”接口上传后获得的合法id。
	ButtonViewLimited        MenuButtonType = "view_limited"         // 跳转图文消息URL用户点击view_limited类型按钮后,微信客户端将打开开发者在按钮中填写的永久素材id对应的图文消息URL,永久素材类型只支持图文消息。请注意:永久素材id必须是在“素材管理/新增永久素材”接口上传后获得的合法id。
	ButtonArticle            MenuButtonType = "article_id"           // 用户点击 article_id 类型按钮后,微信客户端将会以卡片形式,下发开发者在按钮中填写的图文消息。
	ButtonArticleViewLimited MenuButtonType = "article_view_limited" // 类似 view_limited,但不使用 media_id 而使用 article_id。
	ButtonMinip              MenuButtonType = "miniprogram"          // 小程序页面跳转,不支持小程序的老版本客户端将打开指定的URL。
)

微信支持的按钮 注意: 草稿接口灰度完成后,将不再支持图文信息类型的 media_id 和 view_limited,有需要的,请使用 article_id 和 article_view_limited 代替

type MenuMatchRule struct {
	TagID              string `json:"tag_id,omitempty"`               // 用户标签的id,可通过用户标签管理接口获取,不填则不做匹配
	ClientPlatformType string `json:"client_platform_type,omitempty"` // 客户端版本,当前只具体到系统型号:IOS(1), Android(2),Others(3),不填则不做匹配
}

MenuMatchRule 菜单匹配规则

type MsgMinip

type MsgMinip struct {
	AppID    string `json:"appid"`              // 所需跳转到的小程序appid(该小程序appid必须与发模板消息的公众号是绑定关联关系,暂不支持小游戏)
	PagePath string `json:"pagepath,omitempty"` // 所需跳转到小程序的具体页面路径,支持带参数,(示例index?foo=bar),要求该小程序已发布,暂不支持小游戏
}

MsgMinip 跳转小程序

type MsgTemplData

type MsgTemplData map[string]*MsgTemplValue

MsgTemplData 消息模板内容

type MsgTemplValue

type MsgTemplValue struct {
	Value string `json:"value"`
	Color string `json:"color,omitempty"`
}

type NewsArticle

type NewsArticle struct {
	Title              string `json:"title"`
	ThumbMediaID       string `json:"thumb_media_id"`
	Author             string `json:"author"`
	Digest             string `json:"digest"`
	ShowCoverPic       int    `json:"show_cover_pic"`
	Content            string `json:"content"`
	ContentSourceURL   string `json:"content_source_url"`
	NeedOpenComment    int    `json:"need_open_comment,omitempty"`
	OnlyFansCanComment int    `json:"only_fans_can_comment,omitempty"`
}

NewsArticle 文章素材

type OAuthToken

type OAuthToken struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ExpiresIn    int64  `json:"expires_in"`
	OpenID       string `json:"openid"`
	Scope        string `json:"scope"`
}

OAuthToken 公众号网页授权Token

type OCRMode

type OCRMode string

OCRMode 识别模式

var (
	OCRPhoto OCRMode = "photo" // 拍照模式
	OCRScan  OCRMode = "scan"  // 扫描模式
)

微信支持的识别模式

type OCRPosition

type OCRPosition struct {
	Pos ImagePosition `json:"pos"`
}

OCRPosition 识别位置

type Offia

type Offia struct {
	// contains filtered or unexported fields
}

Offia 微信公众号

func New

func New(appid, appsecret string, options ...Option) *Offia

New returns new Offia

func (*Offia) AccessToken

func (oa *Offia) AccessToken(ctx context.Context, options ...wx.HTTPOption) (*AccessToken, error)

AccessToken 获取普通AccessToken

func (*Offia) AppID

func (oa *Offia) AppID() string

AppID returns appid

func (*Offia) AppSecret

func (oa *Offia) AppSecret() string

AppSecret returns app secret

func (*Offia) Code2OAuthToken

func (oa *Offia) Code2OAuthToken(ctx context.Context, code string, options ...wx.HTTPOption) (*OAuthToken, error)

Code2OAuthToken 获取网页授权Token

func (*Offia) DecryptEventMessage

func (oa *Offia) DecryptEventMessage(encrypt string) (wx.WXML, error)

DecryptEventMessage 事件消息解密

func (*Offia) Do

func (oa *Offia) Do(ctx context.Context, accessToken string, action wx.Action, options ...wx.HTTPOption) error

Do exec action

func (*Offia) JSApiSign

func (oa *Offia) JSApiSign(ticket, url string) *JSApiSign

JSApiSign 生成 JSApi 签名

func (*Offia) OAuth2URL

func (oa *Offia) OAuth2URL(scope AuthScope, redirectURL, state string) string

OAuth2URL 生成网页授权URL(请使用 URLEncode 对 redirectURL 进行处理) [参考](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html)

func (*Offia) RefreshOAuthToken

func (oa *Offia) RefreshOAuthToken(ctx context.Context, refreshToken string, options ...wx.HTTPOption) (*OAuthToken, error)

RefreshOAuthToken 刷新网页授权AccessToken

func (*Offia) Reply

func (oa *Offia) Reply(openid string, reply event.Reply) (*event.ReplyMessage, error)

Reply 消息回复

func (*Offia) SubscribeMsgAuthURL

func (oa *Offia) SubscribeMsgAuthURL(scene, templateID, redirectURL, reserved string) string

SubscribeMsgAuthURL 公众号一次性订阅消息授权URL(请使用 URLEncode 对 redirectURL 进行处理) [参考](https://developers.weixin.qq.com/doc/offiaccount/Message_Management/One-time_subscription_info.html)

func (*Offia) VerifyEventSign

func (oa *Offia) VerifyEventSign(signature string, items ...string) bool

VerifyEventSign 验证消息事件签名 验证消息来自微信服务器,使用:signature、timestamp、nonce(若验证成功,请原样返回echostr参数内容) 验证事件消息签名,使用:msg_signature、timestamp、nonce、msg_encrypt [参考](https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html)

type Option

type Option func(oa *Offia)

Option 公众号配置项

func WithClient

func WithClient(c *http.Client) Option

WithClient 设置 HTTP Client

func WithMockClient

func WithMockClient(c wx.HTTPClient) Option

WithMockClient 设置 Mock Client

func WithNonce

func WithNonce(f func() string) Option

WithNonce 设置 Nonce(加密随机串)

func WithOriginID

func WithOriginID(id string) Option

WithOriginID 设置原始ID(开发者微信号)

func WithServerConfig

func WithServerConfig(token, aeskey string) Option

WithServerConfig 设置服务器配置 [参考](https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html)

type ParamsBatchBlackUsers

type ParamsBatchBlackUsers struct {
	OpenIDList []string `json:"openid_list"`
}

type ParamsBatchTagging

type ParamsBatchTagging struct {
	TagID      int64    `json:"tagid"`
	OpenIDList []string `json:"openid_list"`
}

type ParamsBatchUnBlackUsers

type ParamsBatchUnBlackUsers struct {
	OpenIDList []string `json:"openid_list"`
}

type ParamsBatchUnTagging

type ParamsBatchUnTagging struct {
	TagID      int64    `json:"tagid"`
	OpenIDList []string `json:"openid_list"`
}

type ParamsBatchUserInfo

type ParamsBatchUserInfo struct {
	UserList []*ParamsUserInfo `json:"user_list"`
}

type ParamsBlackList

type ParamsBlackList struct {
	BeginOpenID string `json:"begin_openid"`
}

type ParamsConditionalMenuCreate

type ParamsConditionalMenuCreate struct {
	Button    []*MenuButton  `json:"button"`
	MatchRule *MenuMatchRule `json:"matchrule"`
}

type ParamsConditionalMenuDelete

type ParamsConditionalMenuDelete struct {
	MenuID string `json:"menuid"`
}

type ParamsDraftAdd

type ParamsDraftAdd struct {
	Articles []*DraftArticle `json:"articles"`
}

type ParamsDraftBatchGet

type ParamsDraftBatchGet struct {
	Offset    int `json:"offset"`
	Count     int `json:"count"`
	NoContent int `json:"no_content,omitempty"`
}

type ParamsDraftDelete

type ParamsDraftDelete struct {
	MediaID string `json:"media_id"`
}

type ParamsDraftGet

type ParamsDraftGet struct {
	MediaID string `json:"media_id"`
}

type ParamsDraftUpdate

type ParamsDraftUpdate struct {
	MediaID  string        `json:"media_id"`
	Index    int           `json:"index"`
	Articles *DraftArticle `json:"articles"`
}

type ParamsIndustrySet

type ParamsIndustrySet struct {
	IndustryID1 string `json:"industry_id1"`
	IndustryID2 string `json:"industry_id2"`
}

type ParamsMaterialGet

type ParamsMaterialGet struct {
	MediaID string `json:"media_id"`
}

type ParamsMaterialList

type ParamsMaterialList struct {
	Type   MediaType `json:"type"`
	Offset int       `json:"offset"`
	Count  int       `json:"count"`
}

type ParamsMenuCreate

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

type ParamsMenuMatch

type ParamsMenuMatch struct {
	UserID string `json:"user_id"`
}

type ParamsNewsAdd

type ParamsNewsAdd struct {
	Articles []*NewsArticle `json:"articles"`
}

type ParamsNewsUpdate

type ParamsNewsUpdate struct {
	MediaID  string       `json:"media_id"`
	Index    string       `json:"index"`
	Articles *NewsArticle `json:"articles"`
}

type ParamsPrivateTemplateDel

type ParamsPrivateTemplateDel struct {
	TemplateID string `json:"template_id"`
}

type ParamsPublishArticle

type ParamsPublishArticle struct {
	ArticleID string `json:"article_id"`
}

type ParamsPublishBatchGet

type ParamsPublishBatchGet struct {
	Offset    int `json:"offset"`
	Count     int `json:"count"`
	NoContent int `json:"no_content,omitempty"`
}

type ParamsPublishDelete

type ParamsPublishDelete struct {
	ArticleID string `json:"article_id"`
	Index     int    `json:"index"`
}

type ParamsPublishGet

type ParamsPublishGet struct {
	PublishID string `json:"publish_id"`
}

type ParamsPublishSubmit

type ParamsPublishSubmit struct {
	MediaID string `json:"media_id"`
}

type ParamsQRCodeCreate

type ParamsQRCodeCreate struct {
	ActionName    QRCodeAction      `json:"action_name"`
	ActionInfo    *QRCodeActionInfo `json:"action_info"`
	ExpireSeconds int               `json:"expire_seconds,omitempty"`
}

type ParamsShortURL

type ParamsShortURL struct {
	Action  string `json:"action"`
	LongURL string `json:"long_url"`
}

type ParamsSubscribeTemplAdd

type ParamsSubscribeTemplAdd struct {
	TID       string `json:"tid"`
	KidList   []int  `json:"kidList"`
	SceneDesc string `json:"sceneDesc"`
}

type ParamsSubscribeTemplDelete

type ParamsSubscribeTemplDelete struct {
	PriTmplID string `json:"priTmplId"`
}

type ParamsTag

type ParamsTag struct {
	ID   int64  `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type ParamsTagOpt

type ParamsTagOpt struct {
	Tag *ParamsTag `json:"tag"`
}

type ParamsTagUsers

type ParamsTagUsers struct {
	TagID      int64  `json:"tagid"`
	NextOpenID string `json:"next_openid"`
}

type ParamsTemplAdd

type ParamsTemplAdd struct {
	TemplateIDShort string `json:"template_id_short"`
}

type ParamsTemplateSubscribe

type ParamsTemplateSubscribe struct {
	ToUser     string       `json:"touser"`                // 接收者openid
	Scene      string       `json:"scene"`                 // 订阅场景值
	Title      string       `json:"title"`                 // 消息标题,15字以内
	TemplateID string       `json:"template_id"`           // 模板ID
	URL        string       `json:"url,omitempty"`         // 点击消息跳转的链接,需要有ICP备案
	Minip      *MsgMinip    `json:"miniprogram,omitempty"` // 跳小程序所需数据,不需跳小程序可不用传该数据
	Data       MsgTemplData `json:"data"`                  // 消息正文,value为消息内容文本(200字以内),没有固定格式,可用\n换行,color为整段消息内容的字体颜色(目前仅支持整段消息为一种颜色)
}

type ParamsUserInfo

type ParamsUserInfo struct {
	OpenID string `json:"openid"`
	Lang   string `json:"lang,omitempty"`
}

type ParamsUserRemark

type ParamsUserRemark struct {
	OpenID string `json:"openid"`
	Remark string `json:"remark"`
}

type ParamsUserTags

type ParamsUserTags struct {
	OpenID string `json:"openid"`
}

type Position

type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
}

Position 位置信息

type PubTemplKeywords

type PubTemplKeywords struct {
	KID     int64  `json:"kid"`
	Name    string `json:"name"`
	Example string `json:"example"`
	Rule    string `json:"rule"`
}

type PubTemplTitle

type PubTemplTitle struct {
	TID        int64  `json:"tid"`
	Title      string `json:"title"`
	Type       int    `json:"type"`
	CategoryID string `json:"categoryId"`
}

type PublishArticle

type PublishArticle struct {
	Title              string `json:"title"`
	Author             string `json:"author"`
	Digest             string `json:"digest"`
	Content            string `json:"content"`
	ContentSourceURL   string `json:"content_source_url"`
	ThumbMediaID       string `json:"thumb_media_id"`
	ShowCoverPic       int    `json:"show_cover_pic"`
	NeedOpenComment    int    `json:"need_open_comment"`
	OnlyFansCanComment int    `json:"only_fans_can_comment"`
	URL                string `json:"url"`
	IsDelete           bool   `json:"is_delete"`
}

type PublishArticles

type PublishArticles struct {
	Count int            `json:"count"`
	Item  []*PublishItem `json:"item"`
}

type PublishContent

type PublishContent struct {
	NewsItem []*PublishArticle `json:"news_item"`
}

type PublishDetail

type PublishDetail struct {
	ArticleID  string          `json:"article_id"`
	Content    *PublishContent `json:"content"`
	UpdateTime int64           `json:"update_time"`
}

type PublishItem

type PublishItem struct {
	IDX        int    `json:"idx"`
	ArticleURL string `json:"article_url"`
}

type QRCodeAction

type QRCodeAction string
const (
	QRScene         QRCodeAction = "QR_SCENE"           // 临时的整型参数值
	QRStrScene      QRCodeAction = "QR_STR_SCENE"       // 临时的字符串参数值
	QRLimitScene    QRCodeAction = "QR_LIMIT_SCENE"     // 永久的整型参数值
	QRLimitStrScene QRCodeAction = "QR_LIMIT_STR_SCENE" // 永久的字符串参数值
)

type QRCodeActionInfo

type QRCodeActionInfo struct {
	Scene *QRCodeScene `json:"scene"`
}

type QRCodeScanData

type QRCodeScanData struct {
	TypeName string        `json:"type_name"`
	Data     string        `json:"data"`
	Pos      ImagePosition `json:"pos"`
}

QRCodeScanData 二维码扫描数据

type QRCodeScene

type QRCodeScene struct {
	SceneID  int    `json:"scene_id,omitempty"`
	SceneStr string `json:"scene_str,omitempty"`
}

type Reply

type Reply struct {
	XMLName      xml.Name      `xml:"xml"`
	FromUserName wx.CDATA      `xml:"FromUserName,omitempty"`
	ToUserName   wx.CDATA      `xml:"ToUserName,omitempty"`
	CreateTime   int64         `xml:"CreateTime,omitempty"`
	MsgType      wx.CDATA      `xml:"MsgType,omitempty"`
	Content      wx.CDATA      `xml:"Content,omitempty"`
	Image        *XMLMedia     `xml:"Image,omitempty"`
	Voice        *XMLMedia     `xml:"Voice,omitempty"`
	Video        *XMLVideo     `xml:"Video,omitempty"`
	Music        *XMLMusic     `xml:"Music,omitempty"`
	ArticleCount int           `xml:"ArticleCount,omitempty"`
	Articles     *XMLNews      `xml:"Articles,omitempty"`
	TransInfo    *XMLTransInfo `xml:"TransInfo,omitempty"`
}

Reply 消息回复

func (*Reply) Bytes

func (r *Reply) Bytes(from, to string) ([]byte, error)

type ResultAICrop

type ResultAICrop struct {
	Results []*CropPosition `json:"results"`
	ImgSize ImageSize       `json:"img_size"`
}

ResultAICrop 图片裁切结果

type ResultAllPrivateTemplate

type ResultAllPrivateTemplate struct {
	TemplateList []*TemplateInfo `json:"template_list"`
}

type ResultApiTicket

type ResultApiTicket struct {
	Ticket    string `json:"ticket"`
	ExpiresIn int64  `json:"expires_in"`
}

ResultApiTicket 公众号 api ticket

type ResultBankCardOCR

type ResultBankCardOCR struct {
	Number string `json:"number"`
}

ResultBankCardOCR 银行卡识别结果

type ResultBatchUserInfo

type ResultBatchUserInfo struct {
	UserInfoList []*UserInfo `json:"user_info_list"`
}

type ResultBlackList

type ResultBlackList struct {
	Total      int          `json:"total"`
	Count      int          `json:"count"`
	Data       UserListData `json:"data"`
	NextOpenID string       `json:"next_openid"`
}

type ResultBusinessLicenseOCR

type ResultBusinessLicenseOCR struct {
	RegNum              string      `json:"reg_num"`              // 注册号
	Serial              string      `json:"serial"`               // 编号
	LegalRepresentative string      `json:"legal_representative"` // 法定代表人姓名
	EnterpriseName      string      `json:"enterprise_name"`      // 企业名称
	TypeOfOrganization  string      `json:"type_of_organization"` // 组成形式
	Address             string      `json:"address"`              // 经营场所/企业住所
	TypeOfEnterprise    string      `json:"type_of_enterprise"`   // 公司类型
	BusinessScope       string      `json:"business_scope"`       // 经营范围
	RegisteredCapital   string      `json:"registered_capital"`   // 注册资本
	PaidInCapital       string      `json:"paid_in_capital"`      // 实收资本
	ValidPeriod         string      `json:"valid_period"`         // 营业期限
	RegisteredDate      string      `json:"registered_date"`      // 注册日期/成立日期
	CertPosition        OCRPosition `json:"cert_position"`        // 营业执照位置
	ImgSize             ImageSize   `json:"img_size"`             // 图片大小
}

ResultBusinessLicenseOCR 营业执照

type ResultCommOCR

type ResultCommOCR struct {
	Items   []*CommOCRItem `json:"items"`
	ImgSize ImageSize      `json:"img_size"`
}

ResultCommOCR 通用印刷体识别结果

type ResultDraftAdd

type ResultDraftAdd struct {
	MediaID string `json:"media_id"`
}

type ResultDraftBatchGet

type ResultDraftBatchGet struct {
	TotalCount int            `json:"total_count"`
	ItemCount  int            `json:"item_count"`
	Item       []*DraftDetail `json:"item"`
}

type ResultDraftCount

type ResultDraftCount struct {
	TotalCount int `json:"total_count"`
}

type ResultDraftGet

type ResultDraftGet struct {
	NewsItem []*DraftArticle `json:"news_item"`
}

type ResultDriverLicenseOCR

type ResultDriverLicenseOCR struct {
	IDNum        string `json:"id_num"`        // 证号
	Name         string `json:"name"`          // 姓名
	Sex          string `json:"sex"`           // 性别
	Nationality  string `json:"nationality"`   // 国籍
	Address      string `json:"address"`       // 住址
	BirthDate    string `json:"birth_date"`    // 出生日期
	IssueDate    string `json:"issue_date"`    // 初次领证日期
	CarClass     string `json:"car_class"`     // 准驾车型
	ValidFrom    string `json:"valid_from"`    // 有效期限起始日
	ValidTo      string `json:"valid_to"`      // 有效期限终止日
	OfficialSeal string `json:"official_seal"` // 印章文字
}

ResultDriverLicenseOCR 驾照识别结果

type ResultIDCardBackOCR

type ResultIDCardBackOCR struct {
	ValidDate string `json:"valid_date"`
}

ResultIDCardBackOCR 身份证背面识别结果

type ResultIDCardFrontOCR

type ResultIDCardFrontOCR struct {
	Name        string `json:"name"`
	ID          string `json:"id"`
	Addr        string `json:"addr"`
	Gender      string `json:"gender"`
	Nationality string `json:"nationality"`
}

ResultIDCardFrontOCR 身份证前面识别结果

type ResultIndustryGet

type ResultIndustryGet struct {
	PrimaryIndustry   *IndustryInfo `json:"primary_industry"`
	SecondaryIndustry *IndustryInfo `json:"secondary_industry"`
}

type ResultMaterialAdd

type ResultMaterialAdd struct {
	MediaID string `json:"media_id"`
	URL     string `json:"url"`
}

ResultMaterialAdd 永久素材新增结果

type ResultMaterialCount

type ResultMaterialCount struct {
	VoiceCount int `json:"voice_count"`
	VideoCount int `json:"video_count"`
	ImageCount int `json:"image_count"`
	NewsCount  int `json:"news_count"`
}

type ResultMaterialList

type ResultMaterialList struct {
	TotalCount int                 `json:"total_count"`
	ItemCount  int                 `json:"item_count"`
	Item       []*MaterialListItem `json:"item"`
}

type ResultMaterialNewsList

type ResultMaterialNewsList struct {
	TotalCount int                     `json:"total_count"`
	ItemCount  int                     `json:"item_count"`
	Item       []*MaterialNewsListItem `json:"item"`
}

type ResultMediaUpload

type ResultMediaUpload struct {
	Type      string `json:"type"`
	MediaID   string `json:"media_id"`
	CreatedAt int64  `json:"created_at"`
}

ResultMediaUpload 临时素材上传结果

type ResultMenuGet

type ResultMenuGet struct {
	Menu            Menu               `json:"menu"`            // 普通菜单
	ConditionalMenu []*ConditionalMenu `json:"conditionalmenu"` // 个性化菜单
}

type ResultMenuMatch

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

type ResultNewsMaterialGet

type ResultNewsMaterialGet struct {
	NewsItem []*MaterialNewsItem `json:"news_item"`
}

type ResultOAuthUser

type ResultOAuthUser struct {
	OpenID     string   `json:"openid"`
	UnionID    string   `json:"unionid"`
	Nickname   string   `json:"nickname"`
	Sex        int      `json:"sex"`
	Province   string   `json:"province"`
	City       string   `json:"city"`
	Country    string   `json:"country"`
	HeadImgURL string   `json:"headimgurl"`
	Privilege  []string `json:"privilege"`
}

ResultOAuthUser 授权用户信息

type ResultOtherMaterialGet

type ResultOtherMaterialGet struct {
	Buffer []byte
}

type ResultPlateNumberOCR

type ResultPlateNumberOCR struct {
	Number string `json:"number"`
}

ResultPlateNumberOCR 车牌号识别结果

type ResultPubTemplKeywords

type ResultPubTemplKeywords struct {
	Data []*PubTemplKeywords `json:"data"`
}

type ResultPubTemplTitles

type ResultPubTemplTitles struct {
	Count int              `json:"count"`
	Data  []*PubTemplTitle `json:"data"`
}

type ResultPublishArticle

type ResultPublishArticle struct {
	NewsItem []*PublishArticle `json:"news_item"`
}

type ResultPublishBatchGet

type ResultPublishBatchGet struct {
	TotalCount int              `json:"total_count"`
	ItemCount  int              `json:"item_count"`
	Item       []*PublishDetail `json:"item"`
}

type ResultPublishGet

type ResultPublishGet struct {
	PublishID     string           `json:"publish_id"`
	PublishStatus int              `json:"publish_status"`
	ArticleID     string           `json:"article_id"`
	ArticleDetail *PublishArticles `json:"article_detail"`
	FailIDX       []int            `json:"fail_idx"`
}

type ResultPublishSubmit

type ResultPublishSubmit struct {
	PublishID string `json:"publish_id"`
}

type ResultQRCodeCreate

type ResultQRCodeCreate struct {
	Ticket        string `json:"ticket"`
	ExpireSeconds int64  `json:"expire_seconds"`
	URL           string `json:"url"`
}

type ResultQRCodeScan

type ResultQRCodeScan struct {
	CodeResults []*QRCodeScanData `json:"code_results"`
	ImgSize     ImageSize         `json:"img_size"`
}

ResultQRCodeScan 二维码扫描结果

type ResultShortURL

type ResultShortURL struct {
	ShortURL string `json:"short_url"`
}

ResultShortURL 短链接

type ResultSubscribeCategory

type ResultSubscribeCategory struct {
	Data []*SubscribeCategory `json:"data"`
}

type ResultSubscribeTemplAdd

type ResultSubscribeTemplAdd struct {
	PriTmplID string `json:"priTmplId"`
}

type ResultSubscribeTemplList

type ResultSubscribeTemplList struct {
	Data []*SubscribeTemplInfo `json:"data"`
}

type ResultSuperreSolution

type ResultSuperreSolution struct {
	MediaID string `json:"media_id"`
}

ResultSuperreSolution 图片高清化结果

type ResultTagCreate

type ResultTagCreate struct {
	Tag *Tag `json:"tag"`
}

type ResultTagUsers

type ResultTagUsers struct {
	Count      int          `json:"count"`
	Data       *TagUserData `json:"data"`
	NextOpenID string       `json:"next_openid"`
}

type ResultTagsGet

type ResultTagsGet struct {
	Tags []*Tag `json:"tags"`
}

type ResultTemplAdd

type ResultTemplAdd struct {
	TemplateID string `json:"template_id"`
}

type ResultUserList

type ResultUserList struct {
	Total      int          `json:"total"`
	Count      int          `json:"count"`
	Data       UserListData `json:"data"`
	NextOpenID string       `json:"next_openid"`
}

type ResultUserTags

type ResultUserTags struct {
	TagIDList []int64 `json:"tagid_list"`
}

type ResultVehicleLicenseOCR

type ResultVehicleLicenseOCR struct {
	VehicleType       string      `json:"vhicle_type"`         // 车辆类型
	Owner             string      `json:"owner"`               // 所有人
	Addr              string      `json:"addr"`                // 住址
	UseCharacter      string      `json:"use_character"`       // 使用性质
	Model             string      `json:"model"`               // 品牌型号
	VIN               string      `json:"vin"`                 // 车辆识别代号
	EngineNum         string      `json:"engine_num"`          // 发动机号码
	RegisterDate      string      `json:"register_date"`       // 注册日期
	IssueDate         string      `json:"issue_date"`          // 发证日期
	PlateNum          string      `json:"plate_num"`           // 车牌号码
	PlateNumB         string      `json:"plate_num_b"`         // 车牌号码
	Record            string      `json:"record"`              // 号牌
	PassengersNum     string      `json:"passengers_num"`      // 核定载人数
	TotalQuality      string      `json:"total_quality"`       // 总质量
	PrepareQuality    string      `json:"prepare_quality"`     // 整备质量
	OverallSize       string      `json:"overall_size"`        // 外廓尺寸
	CardPositionFront OCRPosition `json:"card_position_front"` // 卡片正面位置(检测到卡片正面才会返回)
	CardPositionBack  OCRPosition `json:"card_position_back"`  // 卡片反面位置(检测到卡片反面才会返回)
}

ResultVehicleLicenseOCR 行驶证识别结果

type ResultVideoMaterialGet

type ResultVideoMaterialGet struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	DownURL     string `json:"down_url"`
}

type SubscribeCategory

type SubscribeCategory struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

type SubscribeMsg

type SubscribeMsg struct {
	ToUser     string       `json:"touser"`
	TemplateID string       `json:"template_id"`
	Page       string       `json:"page,omitempty"`
	Minip      *MsgMinip    `json:"miniprogram,omitempty"`
	Data       MsgTemplData `json:"data"`
}

type SubscribeScene

type SubscribeScene string

SubscribeScene 关注的渠道来源

const (
	AddSceneSearch           SubscribeScene = "ADD_SCENE_SEARCH"               // 公众号搜索
	AddSceneQRCode           SubscribeScene = "ADD_SCENE_QR_CODE"              // 扫描二维码
	AddSceneAccountMigration SubscribeScene = "ADD_SCENE_ACCOUNT_MIGRATION"    // 公众号迁移
	AddSceneProfileCard      SubscribeScene = "ADD_SCENE_PROFILE_CARD"         // 名片分享
	AddSceneProfileLink      SubscribeScene = "ADD_SCENE_PROFILE_LINK"         // 图文页内名称点击
	AddSceneProfileItem      SubscribeScene = "ADD_SCENE_PROFILE_ITEM"         // 图文页右上角菜单
	AddScenePaid             SubscribeScene = "ADD_SCENE_PAID"                 // 支付后关注
	AddSceneWechatAD         SubscribeScene = "ADD_SCENE_WECHAT_ADVERTISEMENT" // 微信广告
	AddSceneOthers           SubscribeScene = "ADD_SCENE_OTHERS"               // 其他
)

微信支持的关注的渠道来源

type SubscribeTemplInfo

type SubscribeTemplInfo struct {
	PriTmplID string `json:"priTmplId"`
	Title     string `json:"title"`
	Content   string `json:"content"`
	Example   string `json:"example"`
	Type      int    `json:"type"`
}

type Tag

type Tag struct {
	ID    int64  `json:"id"`
	Name  string `json:"name"`
	Count int    `json:"count"`
}

type TagUserData

type TagUserData struct {
	OpenID []string `json:"openid"`
}

type TemplateInfo

type TemplateInfo struct {
	TemplateID      string `json:"template_id"`      // 模板ID
	Title           string `json:"title"`            // 模板标题
	PrimaryIndustry string `json:"primary_industry"` // 模板所属行业的一级行业
	DeputyIndustry  string `json:"deputy_industry"`  // 模板所属行业的二级行业
	Content         string `json:"content"`          // 模板内容
	Example         string `json:"example"`          // 模板示例
}

TemplateInfo 模板信息

type TemplateMsg

type TemplateMsg struct {
	ToUser     string       `json:"touser"`                // 接收者openid
	TemplateID string       `json:"template_id"`           // 模板ID
	URL        string       `json:"url,omitempty"`         // 模板跳转链接(海外帐号没有跳转能力)
	Minip      *MsgMinip    `json:"miniprogram,omitempty"` // 跳小程序所需数据,不需跳小程序可不用传该数据
	Data       MsgTemplData `json:"data"`                  // 模板内容,格式形如:{"key1":{"value":"V","color":"#"},"key2":{"value": "V","color":"#"}}
}

type TicketType

type TicketType string

TicketType JSApi ticket 类型

const (
	WXCardTicket TicketType = "wx_card"
	JSAPITicket  TicketType = "jsapi"
)

微信支持的 JSApi ticket

type UserInfo

type UserInfo struct {
	Subscribe      int            `json:"subscribe"`       // 用户是否订阅该公众号标识,值为0时,代表此用户没有关注该公众号,拉取不到其余信息。
	OpenID         string         `json:"openid"`          // 用户的标识,对当前公众号唯一
	NickName       string         `json:"nickname"`        // 用户的昵称
	Sex            int            `json:"sex"`             // 用户的性别,男(1),女(2),未知(0)
	Country        string         `json:"country"`         // 用户所在国家
	City           string         `json:"city"`            // 用户所在城市
	Province       string         `json:"province"`        // 用户所在省份
	Language       string         `json:"language"`        // 用户的语言,简体中文为zh_CN
	HeadImgURL     string         `json:"headimgurl"`      // 用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空。若用户更换头像,原有头像URL将失效。
	SubscribeTime  int64          `json:"subscribe_time"`  // 用户关注时间,为时间戳。如果用户曾多次关注,则取最后关注时间
	UnionID        string         `json:"unionid"`         // 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段。
	Remark         string         `json:"remark"`          // 公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注
	GroupID        int64          `json:"groupid"`         // 用户所在的分组ID(兼容旧的用户分组接口)
	TagidList      []int64        `json:"tagid_list"`      // 用户被打上的标签ID列表
	SubscribeScene SubscribeScene `json:"subscribe_scene"` // 用户关注的渠道来源
	QRScene        int64          `json:"qr_scene"`        // 二维码扫码场景(开发者自定义)
	QRSceneStr     string         `json:"qr_scene_str"`    // 二维码扫码场景描述(开发者自定义)
}

UserInfo 用户基本信息(UnionID机制)

type UserListData

type UserListData struct {
	OpenID []string `json:"openid"`
}

type XMLMedia

type XMLMedia struct {
	MediaID wx.CDATA `xml:"MediaId,omitempty"`
}

type XMLMusic

type XMLMusic struct {
	Title        wx.CDATA `xml:"Title,omitempty"`
	Description  wx.CDATA `xml:"Description,omitempty"`
	MusicURL     wx.CDATA `xml:"MusicUrl,omitempty"`
	HQMusicURL   wx.CDATA `xml:"HQMusicUrl,omitempty"`
	ThumbMediaID wx.CDATA `xml:"ThumbMediaId,omitempty"`
}

type XMLNews

type XMLNews struct {
	Articles []*XMLNewsArticle `xml:"item,omitempty"`
}

type XMLNewsArticle

type XMLNewsArticle struct {
	Title       wx.CDATA `xml:"Title,omitempty"`
	Description wx.CDATA `xml:"Description,omitempty"`
	URL         wx.CDATA `xml:"Url,omitempty"`
	PicURL      wx.CDATA `xml:"PicUrl,omitempty"`
}

type XMLText

type XMLText struct {
	Content wx.CDATA `xml:"Content,omitempty"`
}

type XMLTransInfo

type XMLTransInfo struct {
	KFAccount wx.CDATA `xml:"KfAccount,omitempty"`
}

type XMLVideo

type XMLVideo struct {
	MediaID     wx.CDATA `xml:"MediaId,omitempty"`
	Title       wx.CDATA `xml:"Title,omitempty"`
	Description wx.CDATA `xml:"Description,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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