Documentation ¶
Index ¶
- Constants
- func ConvertToShortUrl(accessToken string, longUrl string) (string, error)
- func DownloadQrCodePic(ticket, path string) (string, error)
- func GetQrCodePicUrl(ticket string) string
- type ActionInfo
- type QrCodeParam
- type QrCodeResult
- func CreateBriefIntSenceQrCode(accessToken string, expireSecond int, SenceID int) (*QrCodeResult, error)
- func CreateBriefStrSenceQrCode(accessToken string, expireSecond int, SenceStr string) (*QrCodeResult, error)
- func CreateForeverIntSenceQrCode(accessToken string, senceID int) (*QrCodeResult, error)
- func CreateForeverStrSenceQrCode(accessToken string, SenceStr string) (*QrCodeResult, error)
- type SenceInfo
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 DownloadQrCodePic ¶
func GetQrCodePicUrl ¶
获取二维码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)
Click to show internal directories.
Click to hide internal directories.