wx

package
v0.0.0-...-0917db3 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WxJson = jsoniter.Config{
	EscapeHTML:             true,
	SortMapKeys:            true,
	ValidateJsonRawMessage: true,
	TagKey:                 "wx",
}.Froze()

Functions

func GetAuthorizerAccessToken

func GetAuthorizerAccessToken(appid string) (string, error)

GetAuthorizerAccessToken 获取AuthorizerAccessToken

func GetAuthorizerInfo

func GetAuthorizerInfo(appid string, resp *AuthorizerInfoResp) error

GetAuthorizerInfo 获取授权账号信息

func GetAuthorizerWxApiUrl

func GetAuthorizerWxApiUrl(appid string, path string, query string) (string, error)

GetAuthorizerWxApiUrl 拼接微信开放平台的url,带小程序token

func GetComponentAccessToken

func GetComponentAccessToken() (string, error)

GetComponentAccessToken 获取ComponentAccessToken

func GetComponentWxApiUrl

func GetComponentWxApiUrl(path string, query string) (string, error)

GetComponentWxApiUrl 拼接微信开放平台的url,带第三方token

func GetRawWxApiUrl

func GetRawWxApiUrl(path string, query string) string

GetRawWxApiUrl 拼接微信开放平台的url,不带微信令牌

Types

type AuthorizerBasicConfig

type AuthorizerBasicConfig struct {
	IsPhoneConfigured bool `json:"isPhoneConfigured" wx:"is_phone_configured"`
	IsEmailConfigured bool `json:"isEmailConfigured" wx:"is_email_configured"`
}

AuthorizerBasicConfig 授权账号的基础配置结构体

type AuthorizerInfoResp

type AuthorizerInfoResp struct {
	AuthorizationInfo authorizationInfo `wx:"authorization_info"`
	AuthorizerInfo    authorizerInfo    `wx:"authorizer_info"`
}

AuthorizerInfoResp 授权账号信息结构体

type WxCommError

type WxCommError struct {
	ErrCode int    `wx:"errcode"`
	ErrMsg  string `wx:"errmsg"`
}

WxCommError 微信开放平台api通用错误

func GetWxApiWithAuthToken

func GetWxApiWithAuthToken(appid string, path string, query string) (*WxCommError, []byte, error)

GetWxApiWithAuthToken 以小程序身份向微信开放平台发起get请求

func GetWxApiWithComponentToken

func GetWxApiWithComponentToken(path string, query string) (*WxCommError, []byte, error)

GetWxApiWithComponentToken 以第三方身份向微信开放平台发起get请求

func GetWxApiWithoutToken

func GetWxApiWithoutToken(path string, query string) (*WxCommError, []byte, error)

GetWxApiWithoutToken 向微信开放平台发起get请求

func PostWxFormDataWithAuthToken

func PostWxFormDataWithAuthToken(appid string, path string, query string,
	formFile multipart.File, fileName string, fieldName string) (*WxCommError, []byte, error)

PostWxFormDataWithAuthToken 以小程序身份向微信开放平台发起post请求

func PostWxJsonWithAuthToken

func PostWxJsonWithAuthToken(appid string, path string, query string, data interface{}) (*WxCommError, []byte, error)

PostWxJsonWithAuthToken 以小程序身份向微信开放平台发起post请求

func PostWxJsonWithComponentToken

func PostWxJsonWithComponentToken(path string, query string, data interface{}) (*WxCommError, []byte, error)

PostWxJsonWithComponentToken 以第三方身份向微信开放平台发起post请求

func PostWxJsonWithoutToken

func PostWxJsonWithoutToken(path string, query string, data interface{}) (*WxCommError, []byte, error)

PostWxJsonWithoutToken 向微信开放平台发起post请求

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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