wx

package
v0.0.0-...-3faa710 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: BSD-3-Clause Imports: 24 Imported by: 0

README

介绍

  • account:公众号相关
  • corp:企业号相关
  • mini:小程序相关
  • open:第三方开放平台相关
  • provider:企业服务商相关
  • single: 公众号和小程序共同内容

使用

//在框架的bootstrap方法或者初始化方法中执行如下操作

定义一个微信配置结构体并实现github.com/a07061625/gompf/mpf/api/wx/config.go文件中的IWxConfig接口
实例化微信配置结构体
调用github.com/a07061625/gompf/mpf/api/wx.LoadConfig()并将上述配置实例作为参数传入
微信配置文件请参考github.com/a07061625/gompf/configs/wx.yaml

定义一个微信工具结构体并实现github.com/a07061625/gompf/mpf/api/wx/util.go文件中的IWxOuter接口
实例化微信工具结构体
调用github.com/a07061625/gompf/mpf/api/wx.LoadUtil()并将上述工具实例作为参数传入
完成上述操作后就可以正常使用微信接口了

Documentation

Overview

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2019/12/27 0027
  • Time: 19:48

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2019/12/25 0025
  • Time: 10:42

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2019/12/31 0031
  • Time: 0:38

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2020/1/5 0005
  • Time: 0:18

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2020/1/5 0005
  • Time: 0:18

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2020/1/5 0005
  • Time: 0:17

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2020/1/5 0005
  • Time: 0:17

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2019/12/25 0025
  • Time: 10:42

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2020/1/2 0002
  • Time: 13:09

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2020/1/2 0002
  • Time: 13:11

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2020/1/2 0002
  • Time: 13:10

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2020/1/2 0002
  • Time: 13:10

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2020/1/2 0002
  • Time: 13:11

*

  • Created by GoLand.
  • User: 姜伟
  • Date: 2020/1/2 0002
  • Time: 13:09

Index

Constants

View Source
const (
	// 公众号或小程序缓存类型
	SingleCacheTypeAccessToken     = "single_accesstoken"
	SingleCacheTypeJsTicket        = "single_jsticket"
	SingleCacheTypeCardTicket      = "single_cardticket"
	SingleCacheTypeOpenAccessToken = "open_accesstoken"
	SingleCacheTypeOpenJsTicket    = "open_jsticket"
	SingleCacheTypeOpenCardTicket  = "open_cardticket"

	// 企业号缓存类型
	CorpCacheTypeAccessToken         = "corp_accesstoken"
	CorpCacheTypeJsTicket            = "corp_jsticket"
	CorpCacheTypeProviderAccessToken = "provider_accesstoken"
	CorpCacheTypeProviderJsTicket    = "provider_jsticket"

	AccountMerchantTypeSelf = "self" // 自身
	AccountMerchantTypeSub  = "sub"  // 子商户
)

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(outer IWxConfig)

func LoadUtil

func LoadUtil(outer IWxOuter)

func NewConfig

func NewConfig() *configWx

func NewConfigAccount

func NewConfigAccount() *configAccount

func NewConfigCorp

func NewConfigCorp() *configCorp

func NewSingleCardAddConfig

func NewSingleCardAddConfig(appId string) *singleCardAddConfig

func NewSingleCardConfig

func NewSingleCardConfig(appId string) *singleCardConfig

func NewSingleJsConfig

func NewSingleJsConfig(appId string) *singleJsConfig

func NewSingleJsPayConfig

func NewSingleJsPayConfig(appId string) *singleJsPayConfig

func NewUtilWx

func NewUtilWx() *utilWx

Types

type BaseWxAccount

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

func NewBaseWxAccount

func NewBaseWxAccount() BaseWxAccount

func (*BaseWxAccount) GetRequest

func (bw *BaseWxAccount) GetRequest() (*fasthttp.Client, *fasthttp.Request)

func (*BaseWxAccount) SetPayAccount

func (wa *BaseWxAccount) SetPayAccount(accountConfig *configAccount, merchantType string)

type BaseWxCorp

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

func NewBaseWxCorp

func NewBaseWxCorp() BaseWxCorp

func (*BaseWxCorp) GetRequest

func (bw *BaseWxCorp) GetRequest() (*fasthttp.Client, *fasthttp.Request)

type BaseWxMini

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

func NewBaseWxMini

func NewBaseWxMini() BaseWxMini

func (*BaseWxMini) GetRequest

func (bw *BaseWxMini) GetRequest() (*fasthttp.Client, *fasthttp.Request)

type BaseWxOpen

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

func NewBaseWxOpen

func NewBaseWxOpen() BaseWxOpen

func (*BaseWxOpen) GetRequest

func (bw *BaseWxOpen) GetRequest() (*fasthttp.Client, *fasthttp.Request)

type BaseWxProvider

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

func NewBaseWxProvider

func NewBaseWxProvider() BaseWxProvider

func (*BaseWxProvider) GetRequest

func (bw *BaseWxProvider) GetRequest() (*fasthttp.Client, *fasthttp.Request)

type BaseWxSingle

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

func NewBaseWxSingle

func NewBaseWxSingle() BaseWxSingle

func (*BaseWxSingle) GetRequest

func (bw *BaseWxSingle) GetRequest() (*fasthttp.Client, *fasthttp.Request)

type DataOpenAuthorize

type DataOpenAuthorize struct {
	AuthorizeStatus int
	AuthCode        string
	RefreshToken    string
}

func NewDataOpenAuthorize

func NewDataOpenAuthorize() *DataOpenAuthorize

type DataProviderAuthorize

type DataProviderAuthorize struct {
	AuthorizeStatus int
	PermanentCode   string
}

func NewDataProviderAuthorize

func NewDataProviderAuthorize() *DataProviderAuthorize

type IWxConfig

type IWxConfig interface {
	RefreshConfigAccount(appId string) *configAccount // 刷新公众号配置
	RefreshConfigCorp(appId string) *configCorp       // 刷新企业号配置
}

type IWxOuter

type IWxOuter interface {
	GetOpenAuthorizeInfo(appId string) *DataOpenAuthorize
	RefreshOpenAuthorizeInfo(appId string, operateType int, data map[string]interface{})
	GetProviderAuthorizeInfo(corpId string) *DataProviderAuthorize
	RefreshProviderAuthorizeInfo(corpId string, operateType int, data map[string]interface{})
}

type WxCDATAText

type WxCDATAText struct {
	Text string `xml:",innerxml"`
}

type WxNotifyOpen

type WxNotifyOpen struct {
	XMLName xml.Name `xml:"xml"`
	AppId   string
	Encrypt string
}

type WxResponse

type WxResponse struct {
	XMLName      xml.Name `xml:"xml"`
	Encrypt      WxCDATAText
	MsgSignature WxCDATAText
	TimeStamp    string
	Nonce        WxCDATAText
}

Directories

Path Synopsis
* * Created by GoLand.
* * Created by GoLand.
authorize
* * Created by GoLand.
* * Created by GoLand.
customservice
* * Created by GoLand.
* * Created by GoLand.
datacube
* * Created by GoLand.
* * Created by GoLand.
material
* * Created by GoLand.
* * Created by GoLand.
menu
* * Created by GoLand.
* * Created by GoLand.
merchant/category
* * Created by GoLand.
* * Created by GoLand.
merchant/express
* * Created by GoLand.
* * Created by GoLand.
merchant/group
* * Created by GoLand.
* * Created by GoLand.
merchant/media
* * Created by GoLand.
* * Created by GoLand.
merchant/order
* * Created by GoLand.
* * Created by GoLand.
merchant/product
* * Created by GoLand.
* * Created by GoLand.
merchant/shelf
* * Created by GoLand.
* * Created by GoLand.
merchant/stock
* * Created by GoLand.
* * Created by GoLand.
message
* * Created by GoLand.
* * Created by GoLand.
tool
* * Created by GoLand.
* * Created by GoLand.
user
* * Created by GoLand.
* * Created by GoLand.
* * Created by GoLand.
* * Created by GoLand.
agent
* * Created by GoLand.
* * Created by GoLand.
authorize
* * Created by GoLand.
* * Created by GoLand.
batch
* * Created by GoLand.
* * Created by GoLand.
crm
* * Created by GoLand.
* * Created by GoLand.
department
* * Created by GoLand.
* * Created by GoLand.
invoice
* * Created by GoLand.
* * Created by GoLand.
media
* * Created by GoLand.
* * Created by GoLand.
message
* * Created by GoLand.
* * Created by GoLand.
oa
* * Created by GoLand.
* * Created by GoLand.
pay
* * Created by GoLand.
* * Created by GoLand.
tag
* * Created by GoLand.
* * Created by GoLand.
user
* * Created by GoLand.
* * Created by GoLand.
* * Created by GoLand.
* * Created by GoLand.
authorize
* * Created by GoLand.
* * Created by GoLand.
message
* * Created by GoLand.
* * Created by GoLand.
tool
* * Created by GoLand.
* * Created by GoLand.
open
account/register
* * Created by GoLand.
* * Created by GoLand.
common/authorize
* * Created by GoLand.
* * Created by GoLand.
common/tool
* * Created by GoLand.
* * Created by GoLand.
mini/account
* * Created by GoLand.
* * Created by GoLand.
mini/category
* * Created by GoLand.
* * Created by GoLand.
mini/cloud
* * Created by GoLand.
* * Created by GoLand.
mini/codemanager
* * Created by GoLand.
* * Created by GoLand.
mini/codetemplate
* * Created by GoLand.
* * Created by GoLand.
mini/setting
* * Created by GoLand.
* * Created by GoLand.
provider
agent
* * Created by GoLand.
* * Created by GoLand.
authorize
* * Created by GoLand.
* * Created by GoLand.
constact
* * Created by GoLand.
* * Created by GoLand.
service
* * Created by GoLand.
* * Created by GoLand.
* * Created by GoLand.
* * Created by GoLand.
media
* * Created by GoLand.
* * Created by GoLand.
pay
* * Created by GoLand.
* * Created by GoLand.
pay/company
* * Created by GoLand.
* * Created by GoLand.
pay/profitsharing
* * Created by GoLand.
* * Created by GoLand.
pay/redpack
* * Created by GoLand.
* * Created by GoLand.

Jump to

Keyboard shortcuts

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