Documentation ¶
Index ¶
- Constants
- type ClientType
- func (t *ClientType) APITokenBase(sendURL string, body interface{}) error
- func (t *ClientType) APITokenHeaderRes(sendURL string, body interface{}) (*http.Response, error)
- func (t *ClientType) APITokenRes(sendURL string, body interface{}, resBody interface{}) error
- func (t *ClientType) GetAccessToken() (string, error)
- type ConfigType
- type ResponseBase
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 ResponseBase ¶
Response 请求微信返回基础数据
Click to show internal directories.
Click to hide internal directories.