Documentation ¶
Index ¶
- Constants
- func AesDecrypt(crytedByte []byte, key []byte, iv []byte) []byte
- func AesEncrypt(origData []byte, k []byte, iv []byte) string
- func DecryptData(req *DecryptDataRequest) ([]byte, error)
- func PKCS7Padding(ciphertext []byte, blocksize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- type CheckLoginResponse
- type DecryptDataRequest
- type GetQRCodeRequest
- type GetUnLimitQRCodeRequest
- type SendRequest
- type Wx
- func (s *Wx) CheckLogin(code string) (*CheckLoginResponse, error)
- func (s *Wx) GetAuthUrl(params map[string]interface{}, isFresh bool) ([]byte, error)
- func (s *Wx) GetQRCode(params *GetQRCodeRequest, isFresh bool) ([]byte, error)
- func (s *Wx) GetTicket(ticketType string, isFresh bool) ([]byte, error)
- func (s *Wx) GetUnLimitQRCode(params *GetUnLimitQRCodeRequest, isFresh bool) ([]byte, error)
- func (s *Wx) InitAuthToken(isFresh bool) (string, error)
- func (s *Wx) InvoiceInsert(params map[string]interface{}, isFresh bool) ([]byte, error)
- func (s *Wx) Request(urlParam map[string]string, bodyParams interface{}, paramUrl string, ...) ([]byte, error)
- func (s *Wx) Send(params *SendRequest, isFresh bool) ([]byte, error)
- func (s *Wx) SetPdf(pdfPath string, isFresh bool) ([]byte, error)
Constants ¶
const ( // access_token 地址 AccessTokenUrl = "https://api.weixin.qq.com/cgi-bin/token" //获取无限制小程序二维码 CreateUqrcodeUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit" //获取小程序二维码 适用于需要的码数量较少的业务场景 有数量限制:与 wxacode.createQRCode 总共生成的码数量限制为100,000 CreateQrCodeUrl = "https://api.weixin.qq.com/wxa/getwxacode" //授权$code 访问地址 CodeAccessUrl = "https://api.weixin.qq.com/sns/jscode2session" TemplatedSendUrl = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send" //获取授权页ticket GetticketUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket" //获取授权页链接 AuthUrl = "https://api.weixin.qq.com/card/invoice/getauthurl" //上传电子发票PDF文件 SetpdfUrl = "https://api.weixin.qq.com/card/invoice/platform/setpdf" //将电子发票卡券插入用户卡包 InvoiceInsertUrl = "https://api.weixin.qq.com/card/invoice/insert" )
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶ added in v1.3.0
@desc aes解密 @auth liuguoqiang 2020-04-21 @param @return
func AesEncrypt ¶ added in v1.3.0
@desc aes加密 @auth liuguoqiang 2020-04-21 @param @return
func DecryptData ¶ added in v1.3.0
func DecryptData(req *DecryptDataRequest) ([]byte, error)
@desc 检验数据的真实性,并且获取解密后的明文. @auth liuguoqiang 2020-04-08 @param @return
func PKCS7Padding ¶ added in v1.3.0
补码 AES加密数据块分组长度必须为128bit(byte[16]),密钥长度可以是128bit(byte[16])、192bit(byte[24])、256bit(byte[32])中的任意一个。 @desc @auth liuguoqiang 2020-04-21 @param @return
func PKCS7UnPadding ¶ added in v1.3.0
@desc 去码 @auth liuguoqiang 2020-04-21 @param @return
Types ¶
type CheckLoginResponse ¶ added in v1.3.0
type DecryptDataRequest ¶ added in v1.3.0
type GetQRCodeRequest ¶ added in v1.3.6
type GetUnLimitQRCodeRequest ¶
type SendRequest ¶
type Wx ¶
type Wx struct {
// contains filtered or unexported fields
}
func (*Wx) CheckLogin ¶ added in v1.3.0
func (s *Wx) CheckLogin(code string) (*CheckLoginResponse, error)
@desc 根据微信code获取授权信息 @auth liuguoqiang 2020-04-08 @param @return
func (*Wx) GetAuthUrl ¶ added in v1.3.0
@desc 获取微信授权页链接 @auth liuguoqiang 2020-02-25 @param @return
func (*Wx) GetQRCode ¶ added in v1.3.6
func (s *Wx) GetQRCode(params *GetQRCodeRequest, isFresh bool) ([]byte, error)
@desc 获取二维码 适用于需要的码数量较少的业务场景 有数量限制 @auth ykq 2020-05-13 @param @return
func (*Wx) GetTicket ¶ added in v1.3.0
@desc 获取授权页面ticket @auth liuguoqiang 2020-02-25 @param @return
func (*Wx) GetUnLimitQRCode ¶
func (s *Wx) GetUnLimitQRCode(params *GetUnLimitQRCodeRequest, isFresh bool) ([]byte, error)
@desc 获取二维码 @auth liuguoqiang 2020-02-25 @param @return
func (*Wx) InitAuthToken ¶
@desc 根据access_token值进行授权 @auth liuguoqiang 2020-02-25 @param $isFresh 是否刷新access_token @return
func (*Wx) InvoiceInsert ¶ added in v1.3.3
@desc 电子发票插入微信卡包 @auth liuguoqiang 2020-04-24 @param @return
func (*Wx) Request ¶
func (s *Wx) Request(urlParam map[string]string, bodyParams interface{}, paramUrl string, isFresh bool, isPost bool) ([]byte, error)
@desc 通用请求 @auth liuguoqiang 2020-02-25 @param @return