basic

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowQRCode

func ShowQRCode(tk *Ticket) string

ShowQRCode 通过ticket换取二维码

Types

type Basic

type Basic struct {
	*context.Context
}

Basic struct

func NewBasic

func NewBasic(context *context.Context) *Basic

NewBasic 实例

func (*Basic) ClearQuota

func (basic *Basic) ClearQuota() error

ClearQuota 清理接口调用次数

func (*Basic) GetAPIDomainIP

func (basic *Basic) GetAPIDomainIP() ([]string, error)

GetAPIDomainIP 获取微信API接口 IP地址

func (*Basic) GetCallbackIP

func (basic *Basic) GetCallbackIP() ([]string, error)

GetCallbackIP 获取微信callback IP地址

func (*Basic) GetQRTicket

func (basic *Basic) GetQRTicket(tq *Request) (t *Ticket, err error)

GetQRTicket 获取二维码 Ticket

func (*Basic) Long2ShortURL

func (basic *Basic) Long2ShortURL(longURL string) (shortURL string, err error)

Long2ShortURL 将一条长链接转成短链接

type IPListRes

type IPListRes struct {
	util.CommonError
	IPList []string `json:"ip_list"`
}

IPListRes 获取微信服务器IP地址 返回结果

type Request

type Request struct {
	ExpireSeconds int64  `json:"expire_seconds,omitempty"`
	ActionName    string `json:"action_name"`
	ActionInfo    struct {
		Scene struct {
			SceneStr string `json:"scene_str,omitempty"`
			SceneID  int    `json:"scene_id,omitempty"`
		} `json:"scene"`
	} `json:"action_info"`
}

Request 临时二维码

func NewLimitQrRequest

func NewLimitQrRequest(scene interface{}) *Request

NewLimitQrRequest 新建永久二维码请求实例

func NewTmpQrRequest

func NewTmpQrRequest(exp time.Duration, scene interface{}) *Request

NewTmpQrRequest 新建临时二维码请求实例

type Ticket

type Ticket struct {
	util.CommonError `json:",inline"`
	Ticket           string `json:"ticket"`
	ExpireSeconds    int64  `json:"expire_seconds"`
	URL              string `json:"url"`
}

Ticket 二维码ticket

Jump to

Keyboard shortcuts

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