account

package
v0.0.0-...-f32fcc8 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateBriefQrCodeUrl   = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=%s"
	CreateForeverQrCodeUrl = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=%s"
	GetQrCodePicApi        = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=%s"
)
View Source
const (
	ConvertShortUrl = "https://api.weixin.qq.com/cgi-bin/shorturl?access_token=%s"
)

Variables

This section is empty.

Functions

func ConvertToShortUrl

func ConvertToShortUrl(accessToken string, longUrl string) (string, error)

func DownloadQrCodePic

func DownloadQrCodePic(ticket, path string) (string, error)

func GetQrCodePicUrl

func GetQrCodePicUrl(ticket string) string

获取二维码ticket后,开发者可用ticket换取二维码图片。请注意,本接口无须登录态即可调用。

Types

type ActionInfo

type ActionInfo struct {
	Sence *SenceInfo `json:"scene"`
}

type QrCodeParam

type QrCodeParam struct {
	ExpireSecond int    `json:"expire_seconds,omitempty"` //该二维码有效时间,以秒为单位。 最大不超过2592000(即30天),此字段如果不填,则默认有效期为30秒
	ActionName   string `json:"action_name"`              //二维码类型,QR_SCENE为临时的整型参数值,QR_STR_SCENE为临时的字符串参数值,
	//QR_LIMIT_SCENE为永久的整型参数值,QR_LIMIT_STR_SCENE为永久的字符串参数值
	Info *ActionInfo `json:"action_info"` //二维码详细信息
}

type QrCodeResult

type QrCodeResult struct {
	Ticket       string `json:"ticket"`         //获取的二维码ticket,凭借此ticket可以在有效时间内换取二维码。
	ExpireSecond int    `json:"expire_seconds"` //该二维码有效时间,以秒为单位。 最大不超过2592000(即30天)
	Url          string `json:"url"`            //二维码图片解析后的地址,开发者可根据该地址自行生成需要的二维码图片
}

func CreateBriefIntSenceQrCode

func CreateBriefIntSenceQrCode(accessToken string, expireSecond int, SenceID int) (*QrCodeResult, error)

func CreateBriefStrSenceQrCode

func CreateBriefStrSenceQrCode(accessToken string, expireSecond int, SenceStr string) (*QrCodeResult, error)

func CreateForeverIntSenceQrCode

func CreateForeverIntSenceQrCode(accessToken string, senceID int) (*QrCodeResult, error)

func CreateForeverStrSenceQrCode

func CreateForeverStrSenceQrCode(accessToken string, SenceStr string) (*QrCodeResult, error)

type SenceInfo

type SenceInfo struct {
	SenceId  int    `json:"scene_id,omitempty"`  //场景值ID,临时二维码时为32位非0整型,永久二维码时最大值为100000(目前参数只支持1--100000)
	SenceStr string `json:"scene_str,omitempty"` //场景值ID(字符串形式的ID),字符串类型,长度限制为1到64
}

Jump to

Keyboard shortcuts

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