Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeBytesToUint32(b []byte) uint32
- func EncodeUint32ToBytes(i uint32) []byte
- func MarshalWithNoEscapeHTML(v interface{}) (string, error)
- type AESCBCCrypto
- type AESPaddingMode
- type AICropResult
- type AccessToken
- type Action
- func AICrop(filename string, receiver *AICropResult) Action
- func AICropByURL(imgURL string, receiver *AICropResult) Action
- func ApplyPlugin(pluginAppID, reason string) Action
- func CreateQRCode(path string, receiver *QRCode, options ...QRCodeOption) Action
- func GetMedia(mediaID string, receiver *Media) Action
- func GetPluginDevApplyList(page, num int, receiver *[]PluginDevApplyInfo) Action
- func GetPluginList(receiver *[]PluginInfo) Action
- func GetQRCode(path string, receiver *QRCode, options ...QRCodeOption) Action
- func GetUnlimitQRCode(scene string, receiver *QRCode, options ...QRCodeOption) Action
- func ImgSecCheck(filename string) Action
- func MediaCheckAsync(mediaType SecCheckMediaType, mediaURL string, receiver *MediaCheckAsyncInfo) Action
- func MsgSecCheck(content string) Action
- func OCRBankCard(mode OCRMode, filename string, receiver *BankCard) Action
- func OCRBankCardByURL(mode OCRMode, imgURL string, receiver *BankCard) Action
- func OCRBusinessLicense(mode OCRMode, filename string, receiver *BusinessLicense) Action
- func OCRBusinessLicenseByURL(mode OCRMode, imgURL string, receiver *BusinessLicense) Action
- func OCRDriverLicense(mode OCRMode, filename string, receiver *DriverLicense) Action
- func OCRDriverLicenseByURL(mode OCRMode, imgURL string, receiver *DriverLicense) Action
- func OCRIDCardBack(mode OCRMode, filename string, receiver *IDCardBack) Action
- func OCRIDCardBackByURL(mode OCRMode, imgURL string, receiver *IDCardBack) Action
- func OCRIDCardFront(mode OCRMode, filename string, receiver *IDCardFront) Action
- func OCRIDCardFrontByURL(mode OCRMode, imgURL string, receiver *IDCardFront) Action
- func OCRPrintedText(mode OCRMode, filename string, receiver *PrintedText) Action
- func OCRPrintedTextByURL(mode OCRMode, imgURL string, receiver *PrintedText) Action
- func OCRVehicleLicense(mode OCRMode, filename string, receiver *VehicleLicense) Action
- func OCRVehicleLicenseByURL(mode OCRMode, imgURL string, receiver *VehicleLicense) Action
- func ScanQRCode(filename string, receiver *QRCodeScanResult) Action
- func ScanQRCodeByURL(imgURL string, receiver *QRCodeScanResult) Action
- func SendCustomerServiceMessage(msg *CustomerServiceMessage) Action
- func SendSubscribeMessage(msg *SubscribeMessage) Action
- func SendTemplateMessage(msg *TemplateMessage) Action
- func SendUniformMessage(msg *UniformMessage) Action
- func SetDevPluginApplyStatus(action PluginAction, appid, reason string) Action
- func SetTyping(msg *TypingMessage) Action
- func SuperreSolution(filename string, receiver *SuperreSolutionResult) Action
- func SuperreSolutionByURL(imgURL string, receiver *SuperreSolutionResult) Action
- func UnbindPlugin(pluginAppID string) Action
- func UploadMedia(mediaType MediaType, filename string, receiver *MediaUploadInfo) Action
- type AuthInfo
- type AuthSession
- type BankCard
- type BusinessLicense
- type CDATA
- type CertPosition
- type CropPosition
- type CustomerServiceMessage
- type DriverLicense
- type HTTPBody
- type HTTPClient
- type HTTPOption
- type IDCardBack
- type IDCardFront
- type ImageMessage
- type ImagePosition
- type ImageSize
- type LinkMessage
- type Media
- type MediaCheckAsyncInfo
- type MediaType
- type MediaUploadInfo
- type MessageBody
- type OATemplateMessage
- type OCRMode
- type PageMessage
- type PhoneInfo
- type PluginAction
- type PluginDevApplyInfo
- type PluginInfo
- type Position
- type PostBody
- type PrintedText
- type PrintedTextItem
- type QRCode
- type QRCodeOption
- type QRCodeScanData
- type QRCodeScanResult
- type SecCheckMediaType
- type SubscribeMessage
- type SuperreSolutionResult
- type TemplateMessage
- type TextMessage
- type TypingMessage
- type UniformMessage
- type UserInfo
- type VehicleLicense
- type WXClient
- type WaterMark
- type WechatAPI
- type WechatMP
- func (w *WechatMP) AccessToken(options ...HTTPOption) (*AccessToken, error)
- func (w *WechatMP) Code2Session(code string, options ...HTTPOption) (*AuthSession, error)
- func (w *WechatMP) DecryptAuthInfo(sessionKey, iv, encryptedData string, receiver AuthInfo) error
- func (w *WechatMP) Do(accessToken string, action Action, options ...HTTPOption) error
- type X
Constants ¶
const ( UniformMessageSendURL = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send" SubscribeMessageSendURL = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send" TemplateMessageSendURL = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send" CustomerServiceMessageSendURL = "https://api.weixin.qq.com/cgi-bin/message/custom/send" SetTypingURL = "https://api.weixin.qq.com/cgi-bin/message/custom/typing" )
msg
const ( QRCodeCreateURL = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode" QRCodeGetURL = "https://api.weixin.qq.com/wxa/getwxacode" QRCodeGetUnlimitURL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit" )
qrcode
const ( MediaUploadURL = "https://api.weixin.qq.com/cgi-bin/media/upload" MediaGetURL = "https://api.weixin.qq.com/cgi-bin/media/get" )
media
const ( PluginManageURL = "https://api.weixin.qq.com/wxa/plugin" PluginDevManageURL = "https://api.weixin.qq.com/wxa/devplugin" )
plugin
const ( ImgSecCheckURL = "https://api.weixin.qq.com/wxa/img_sec_check" MediaCheckAsyncURL = "https://api.weixin.qq.com/wxa/media_check_async" MsgSecCheckURL = "https://api.weixin.qq.com/wxa/msg_sec_check" )
security
const ( AICropURL = "https://api.weixin.qq.com/cv/img/aicrop" ScanQRCodeURL = "https://api.weixin.qq.com/cv/img/qrcode" SuperreSolutionURL = "https://api.weixin.qq.com/cv/img/superresolution" )
image
const ( OCRBankCardURL = "https://api.weixin.qq.com/cv/ocr/bankcard" OCRBusinessLicenseURL = "https://api.weixin.qq.com/cv/ocr/bizlicense" OCRDriverLicenseURL = "https://api.weixin.qq.com/cv/ocr/drivinglicense" OCRIDCardURL = "https://api.weixin.qq.com/cv/ocr/idcard" OCRPrintedTextURL = "https://api.weixin.qq.com/cv/ocr/comm" OCRVehicleLicenseURL = "https://api.weixin.qq.com/cv/ocr/driving" )
ocr
const (
AccessTokenURL = "https://api.weixin.qq.com/cgi-bin/token"
)
cgi-bin
const (
Code2SessionURL = "https://api.weixin.qq.com/sns/jscode2session"
)
sns
Variables ¶
var ( // PluginApply 向插件开发者发起使用插件的申请 PluginApply PluginAction = "apply" // PluginDevApplyList 获取当前所有插件使用方(供插件开发者调用) PluginDevApplyList PluginAction = "dev_apply_list" // PluginList 查询已添加的插件 PluginList = "list" // PluginDevAgree 同意申请 PluginDevAgree = "dev_agree" // PluginDevRefuse 拒绝申请 PluginDevRefuse = "dev_refuse" // PluginDevDelete 删除已拒绝的申请者 PluginDevDelete = "dev_delete" // PluginUnbind 删除已添加的插件 PluginUnbind = "unbind" )
var ( // SecCheckMediaAudio 音频 SecCheckMediaAudio = 1 // SecCheckMediaImage 图片 SecCheckMediaImage = 2 )
Functions ¶
func DecodeBytesToUint32 ¶
DecodeBytesToUint32 从 4 字节的网络字节序里解析出整数 uint32
func EncodeUint32ToBytes ¶
EncodeUint32ToBytes 把整数 uint32 格式化成 4 字节的网络字节序
func MarshalWithNoEscapeHTML ¶
MarshalWithNoEscapeHTML marshal with no escape HTML
Types ¶
type AESCBCCrypto ¶
type AESCBCCrypto struct {
// contains filtered or unexported fields
}
AESCBCCrypto aes-cbc crypto
func NewAESCBCCrypto ¶
func NewAESCBCCrypto(key, iv []byte) *AESCBCCrypto
NewAESCBCCrypto returns new aes-cbc crypto
func (*AESCBCCrypto) Decrypt ¶
func (c *AESCBCCrypto) Decrypt(cipherText []byte, mode AESPaddingMode) ([]byte, error)
Decrypt aes-cbc decrypt with PKCS#7 padding
func (*AESCBCCrypto) Encrypt ¶
func (c *AESCBCCrypto) Encrypt(plainText []byte, mode AESPaddingMode) ([]byte, error)
Encrypt aes-cbc encrypt with PKCS#7 padding
type AESPaddingMode ¶
type AESPaddingMode string
AESPaddingMode aes padding mode
const ( // PKCS5 PKCS#5 padding mode PKCS5 AESPaddingMode = "PKCS#5" // PKCS7 PKCS#7 padding mode PKCS7 AESPaddingMode = "PKCS#7" )
type AICropResult ¶
type AICropResult struct { Result []CropPosition `json:"result"` ImgSize ImageSize `json:"img_size"` }
AICropResult 图片裁切结果
type AccessToken ¶
AccessToken 小程序access_token
type Action ¶
type Action interface { Body() HTTPBody URL() func(accessToken string) string Decode() func(resp []byte) error }
Action defines mp action
func AICropByURL ¶
func AICropByURL(imgURL string, receiver *AICropResult) Action
AICropByURL 图片智能裁切
func CreateQRCode ¶
func CreateQRCode(path string, receiver *QRCode, options ...QRCodeOption) Action
CreateQRCode 创建小程序二维码 - 数量有限
func GetPluginDevApplyList ¶
func GetPluginDevApplyList(page, num int, receiver *[]PluginDevApplyInfo) Action
GetPluginDevApplyList 获取当前所有插件使用方(供插件开发者调用)
func GetQRCode ¶
func GetQRCode(path string, receiver *QRCode, options ...QRCodeOption) Action
GetQRCode 获取小程序二维码 - 数量有限
func GetUnlimitQRCode ¶
func GetUnlimitQRCode(scene string, receiver *QRCode, options ...QRCodeOption) Action
GetUnlimitQRCode 获取小程序二维码 - 数量不限
func MediaCheckAsync ¶
func MediaCheckAsync(mediaType SecCheckMediaType, mediaURL string, receiver *MediaCheckAsyncInfo) Action
MediaCheckAsync 异步校验图片/音频是否含有违法违规内容
func OCRBankCard ¶
OCRBankCard 银行卡识别
func OCRBankCardByURL ¶
OCRBankCardByURL 银行卡识别
func OCRBusinessLicense ¶
func OCRBusinessLicense(mode OCRMode, filename string, receiver *BusinessLicense) Action
OCRBusinessLicense 营业执照识别
func OCRBusinessLicenseByURL ¶
func OCRBusinessLicenseByURL(mode OCRMode, imgURL string, receiver *BusinessLicense) Action
OCRBusinessLicenseByURL 营业执照识别
func OCRDriverLicense ¶
func OCRDriverLicense(mode OCRMode, filename string, receiver *DriverLicense) Action
OCRDriverLicense 驾照识别
func OCRDriverLicenseByURL ¶
func OCRDriverLicenseByURL(mode OCRMode, imgURL string, receiver *DriverLicense) Action
OCRDriverLicenseByURL 驾照识别
func OCRIDCardBack ¶
func OCRIDCardBack(mode OCRMode, filename string, receiver *IDCardBack) Action
OCRIDCardBack 身份证背面识别
func OCRIDCardBackByURL ¶
func OCRIDCardBackByURL(mode OCRMode, imgURL string, receiver *IDCardBack) Action
OCRIDCardBackByURL 身份证背面识别
func OCRIDCardFront ¶
func OCRIDCardFront(mode OCRMode, filename string, receiver *IDCardFront) Action
OCRIDCardFront 身份证前面识别
func OCRIDCardFrontByURL ¶
func OCRIDCardFrontByURL(mode OCRMode, imgURL string, receiver *IDCardFront) Action
OCRIDCardFrontByURL 身份证前面识别
func OCRPrintedText ¶
func OCRPrintedText(mode OCRMode, filename string, receiver *PrintedText) Action
OCRPrintedText 通用印刷体识别
func OCRPrintedTextByURL ¶
func OCRPrintedTextByURL(mode OCRMode, imgURL string, receiver *PrintedText) Action
OCRPrintedTextByURL 通用印刷体识别
func OCRVehicleLicense ¶
func OCRVehicleLicense(mode OCRMode, filename string, receiver *VehicleLicense) Action
OCRVehicleLicense 行驶证识别
func OCRVehicleLicenseByURL ¶
func OCRVehicleLicenseByURL(mode OCRMode, imgURL string, receiver *VehicleLicense) Action
OCRVehicleLicenseByURL 行驶证识别
func ScanQRCode ¶
func ScanQRCode(filename string, receiver *QRCodeScanResult) Action
ScanQRCode 条码/二维码识别
func ScanQRCodeByURL ¶
func ScanQRCodeByURL(imgURL string, receiver *QRCodeScanResult) Action
ScanQRCodeByURL 条码/二维码识别
func SendCustomerServiceMessage ¶
func SendCustomerServiceMessage(msg *CustomerServiceMessage) Action
SendCustomerServiceMessage 发送客服消息
func SendSubscribeMessage ¶
func SendSubscribeMessage(msg *SubscribeMessage) Action
SendSubscribeMessage 发送订阅消息
func SendTemplateMessage ¶
func SendTemplateMessage(msg *TemplateMessage) Action
SendTemplateMessage 发送模板消息
func SetDevPluginApplyStatus ¶
func SetDevPluginApplyStatus(action PluginAction, appid, reason string) Action
SetDevPluginApplyStatus 修改插件使用申请的状态(供插件开发者调用)
func SuperreSolution ¶
func SuperreSolution(filename string, receiver *SuperreSolutionResult) Action
SuperreSolution 图片高清化
func SuperreSolutionByURL ¶
func SuperreSolutionByURL(imgURL string, receiver *SuperreSolutionResult) Action
SuperreSolutionByURL 图片高清化
func UploadMedia ¶
func UploadMedia(mediaType MediaType, filename string, receiver *MediaUploadInfo) Action
UploadMedia 上传临时素材到微信服务器
type AuthSession ¶
type AuthSession struct { SessionKey string `json:"session_key"` OpenID string `json:"openid"` UnionID string `json:"unionid"` }
AuthSession 小程序授权Session
type BusinessLicense ¶
type BusinessLicense 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 CertPosition `json:"cert_position"` ImgSize ImageSize `json:"img_size"` }
BusinessLicense 营业执照
type CDATA ¶
type CDATA string
CDATA XML CDATA section which is defined as blocks of text that are not parsed by the parser, but are otherwise recognized as markup.
func (CDATA) MarshalXML ¶
MarshalXML encodes the receiver as zero or more XML elements.
type CropPosition ¶
type CropPosition struct { CropLeft int `json:"crop_left"` CropTop int `json:"crop_top"` CropRignt int `json:"crop_rignt"` CropBottom int `json:"crop_bottom"` }
CropPosition 裁切位置
type CustomerServiceMessage ¶
type CustomerServiceMessage struct { OpenID string // 接收者(用户)的 openid MessageType string // 消息类型:text|image|link|miniprogrampage Text *TextMessage // 文本消息 Image *ImageMessage // 图文链接 Link *LinkMessage // 图文链接 Page *PageMessage // 小程序卡片 }
CustomerServiceMessage 小程序客服消息
type DriverLicense ¶
type DriverLicense struct { IDNum string `json:"id_num"` Name string `json:"name"` Sex string `json:"sex"` 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"` }
DriverLicense 驾照
type HTTPClient ¶
type HTTPClient interface { Get(reqURL string, options ...HTTPOption) ([]byte, error) Post(reqURL string, body []byte, options ...HTTPOption) ([]byte, error) }
func NewHTTPClient ¶
func NewHTTPClient(tlsCfg ...*tls.Config) HTTPClient
NewHTTPClient returns a new http client
type HTTPOption ¶
type HTTPOption interface {
// contains filtered or unexported methods
}
HTTPOption configures how we set up the http request
func WithHTTPClose ¶
func WithHTTPClose() HTTPOption
WithHTTPClose specifies close the connection after replying to this request (for servers) or after sending this request and reading its response (for clients).
func WithHTTPCookies ¶
func WithHTTPCookies(cookies ...*http.Cookie) HTTPOption
WithHTTPCookies specifies the cookies to http request.
func WithHTTPHeader ¶
func WithHTTPHeader(key, value string) HTTPOption
WithHTTPHeader specifies the headers to http request.
func WithHTTPTimeout ¶
func WithHTTPTimeout(d time.Duration) HTTPOption
WithHTTPTimeout specifies the timeout to http request.
type IDCardFront ¶
type IDCardFront struct { Name string `json:"name"` ID string `json:"id"` Addr string `json:"addr"` Gender string `json:"gender"` Nationality string `json:"nationality"` }
IDCardFront 身份证前面
type ImageMessage ¶
type ImageMessage struct {
MediaID string // 发送的图片的媒体ID,通过 新增素材接口 上传图片文件获得
}
ImageMessage 图片消息
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 LinkMessage ¶
type LinkMessage struct { Title string // 消息标题 Description string // 图文链接消息 RedirectURL string // 图文链接消息被点击后跳转的链接 ThumbURL string // 图文链接消息的图片链接,支持 JPG、PNG 格式,较好的效果为大图 640 X 320,小图 80 X 80 }
LinkMessage 图文链接
type MediaCheckAsyncInfo ¶
type MediaCheckAsyncInfo struct {
TraceID string
}
MediaCheckAsyncInfo 任务id,用于匹配异步推送结果
type MediaType ¶
type MediaType string
MediaType 素材类型
var MediaImage MediaType = "image"
MediaImage 图片素材
type MediaUploadInfo ¶
type MediaUploadInfo struct { Type string `json:"type"` MediaID string `json:"media_id"` CreatedAt int64 `json:"created_at"` }
MediaUploadInfo 临时素材上传信息
type OATemplateMessage ¶
type OATemplateMessage struct { OpenID string // 接收者(用户)的 openid TemplateID string // 模板ID RedirectURL string // 模板跳转链接(海外帐号没有跳转能力) MPAppID string // 所需跳转到的小程序appid(该小程序appid必须与发模板消息的公众号是绑定关联关系,暂不支持小游戏) MPPagePath string // 所需跳转到小程序的具体页面路径,支持带参数,(示例index?foo=bar),要求该小程序已发布,暂不支持小游戏 Data MessageBody // 模板内容,格式形如:{"key1": {"value": any}, "key2": {"value": any}} Color string // 模板内容字体颜色,不填默认为黑色 }
OATemplateMessage 公众号模板消息
type PageMessage ¶
type PageMessage struct { Title string // 消息标题 Path string // 小程序的页面路径,跟app.json对齐,支持参数,比如pages/index/index?foo=bar ThumbMediaID string // 小程序消息卡片的封面, image 类型的 media_id,通过 新增素材接口 上传图片文件获得,建议大小为 520*416 }
PageMessage 小程序卡片
type PhoneInfo ¶
type PhoneInfo struct { PhoneNumber string `json:"phoneNumber"` PurePhoneNumber string `json:"purePhoneNumber"` CountryCode string `json:"countryCode"` WaterMark WaterMark `json:"watermark"` }
PhoneInfo 用户手机号绑定信息
type PluginDevApplyInfo ¶
type PluginDevApplyInfo struct { AppID string `json:"appid"` Status int `json:"status"` Nickname string `json:"nickname"` HeadImgURL string `json:"headimgurl"` Categories []X `json:"categories"` CreateTime string `json:"create_time"` ApplyURL string `json:"apply_url"` Reason string `json:"reason"` }
PluginDevApplyInfo 插件使用方信息
type PluginInfo ¶
type PluginInfo struct { AppID string `json:"appid"` Status int `json:"status"` Nickname string `json:"nickname"` HeadImgURL string `json:"headimgurl"` }
PluginInfo 插件信息
type PostBody ¶
type PostBody struct {
// contains filtered or unexported fields
}
PostBody implements http body
type PrintedText ¶
type PrintedText struct { Items []PrintedTextItem `json:"items"` ImgSize ImageSize `json:"img_size"` }
PrintedText 通用印刷体
type PrintedTextItem ¶
type PrintedTextItem struct { Text string `json:"text"` Pos ImagePosition `json:"pos"` }
PrintedTextItem 通用印刷体内容项
type QRCodeOption ¶
type QRCodeOption interface {
// contains filtered or unexported methods
}
QRCodeOption configures how we set up the wxa_qrcode
func WithQRCodeAutoColor ¶
func WithQRCodeAutoColor(b bool) QRCodeOption
WithQRCodeAutoColor specifies the `auto_color` to wxa_qrcode.
func WithQRCodeIsHyaline ¶
func WithQRCodeIsHyaline(b bool) QRCodeOption
WithQRCodeIsHyaline specifies the `is_hyaline` to wxa_qrcode.
func WithQRCodeLineColor ¶
func WithQRCodeLineColor(m map[string]int) QRCodeOption
WithQRCodeLineColor specifies the `line_color` to wxa_qrcode.
func WithQRCodePage ¶
func WithQRCodePage(s string) QRCodeOption
WithQRCodePage specifies the `page` to wxa_qrcode.
func WithQRCodeWidth ¶
func WithQRCodeWidth(w int) QRCodeOption
WithQRCodeWidth specifies the `width` to wxa_qrcode.
type QRCodeScanData ¶
type QRCodeScanData struct { TypeName string `json:"type_name"` Data string `json:"data"` Pos ImagePosition `json:"pos"` }
QRCodeScanData 二维码扫描数据
type QRCodeScanResult ¶
type QRCodeScanResult struct { CodeResults []QRCodeScanData `json:"code_results"` ImgSize ImageSize `json:"img_size"` }
QRCodeScanResult 二维码扫描结果
type SubscribeMessage ¶
type SubscribeMessage struct { OpenID string // 接收者(用户)的 openid TemplateID string // 所需下发的订阅模板ID PagePath string // 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转 Data MessageBody // 模板内容,格式形如:{"key1": {"value": any}, "key2": {"value": any}} MPState string // 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版 Lang string // 进入小程序查看”的语言类型,支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文),默认为zh_CN }
SubscribeMessage 小程序订阅消息
type SuperreSolutionResult ¶
type SuperreSolutionResult struct {
MediaID string `json:"media_id"`
}
SuperreSolutionResult 图片高清化结果
type TemplateMessage ¶
type TemplateMessage struct { OpenID string // 接收者(用户)的 openid TemplateID string // 所需下发的模板消息的id Page string // 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转 FormID string // 表单提交场景下,为 submit 事件带上的 formId;支付场景下,为本次支付的 prepay_id Data MessageBody // 模板内容,格式形如:{"key1": {"value": any}, "key2": {"value": any}},不填则下发空模板 EmphasisKeyword string // 模板需要放大的关键词,不填则默认无放大,如:"keyword1.DATA" }
TemplateMessage 小程序模板消息
type TypingMessage ¶
type TypingMessage struct { OpenID string // 接收者(用户)的 openid Command string // 命令:Typing|CancelTyping }
TypingMessage 输入状态消息
type UniformMessage ¶
type UniformMessage struct { OpenID string // 接收者(用户)的 openid,可以是小程序的openid,也可以是公众号的openid PubAppID string // 公众号appid,要求与小程序有绑定且同主体 MPTemplateMessage *TemplateMessage // 小程序模板消息相关的信息,可以参考小程序模板消息接口; 有此节点则优先发送小程序模板消息 PubTemplateMessage *OATemplateMessage // 公众号模板消息相关的信息,可以参考公众号模板消息接口;有此节点并且没有 MPTemplateMessage 节点时,发送公众号模板消息 }
UniformMessage 统一服务消息
type UserInfo ¶
type UserInfo struct { OpenID string `json:"openId"` Language string `json:"language"` City string `json:"city"` Province string `json:"province"` AvatarURL string `json:"avatarUrl"` NickName string `json:"nickName"` Gender int `json:"gender"` Country string `json:"country"` UnionID string `json:"unionId"` WaterMark WaterMark `json:"watermark"` }
UserInfo 用户信息
type VehicleLicense ¶
type VehicleLicense struct { VehicleType string `json:"vehicle_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"` 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"` }
VehicleLicense 行驶证
type WechatAPI ¶
type WechatAPI struct {
// contains filtered or unexported fields
}
WechatAPI implements mp action
type WechatMP ¶
type WechatMP struct {
// contains filtered or unexported fields
}
WechatMP 微信小程序
func (*WechatMP) AccessToken ¶
func (w *WechatMP) AccessToken(options ...HTTPOption) (*AccessToken, error)
AccessToken 获取小程序的access_token
func (*WechatMP) Code2Session ¶
func (w *WechatMP) Code2Session(code string, options ...HTTPOption) (*AuthSession, error)
Code2Session 获取小程序授权的session_key
func (*WechatMP) DecryptAuthInfo ¶
DecryptAuthInfo 解密授权信息