BaseWeixinWXXClient

package
v5.1.38 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WeChatServerError 微信服务器错误时返回返回消息
	WeChatServerError = "微信服务器发生错误"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientType

type ClientType struct {
	//组织ID
	OrgID int64
	// BaseURL 微信请求基础URL
	BaseURL string
	//配置内容
	ConfigData ConfigType
	//token
	AccessToken string
	//token 过期时间
	AccessTokenExpireTime time.Time
	//获取过期时间间隔
	AccessTokenExpireDuration time.Duration
}

ClientType 小程序初始化组件

func GetMerchantClient

func GetMerchantClient(orgID int64) (client ClientType, err error)

GetMerchantClient 获取指定ID的商户client数据

func (*ClientType) APITokenBase

func (t *ClientType) APITokenBase(sendURL string, body interface{}) error

APITokenBase 发送带有token的API

func (*ClientType) APITokenHeaderRes

func (t *ClientType) APITokenHeaderRes(sendURL string, body interface{}) (*http.Response, error)

APITokenHeaderRes 回调结构需要高度自定义模式,http结构体完整反馈 可用于类型识别,如二维码图片和json结构的区分处理

func (*ClientType) APITokenRes

func (t *ClientType) APITokenRes(sendURL string, body interface{}, resBody interface{}) error

APITokenRes 回调结构需要自定义的模式

func (*ClientType) GetAccessToken

func (t *ClientType) GetAccessToken() (string, error)

GetAccessToken 获取握手临时密钥 return string AccessToken

type ConfigType

type ConfigType struct {
	//小程序或服务商
	AppID string
	//API Key
	Key string
}

type ResponseBase

type ResponseBase struct {
	Errcode int    `json:"errcode"`
	Errmsg  string `json:"errmsg"`
}

Response 请求微信返回基础数据

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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