wxacode

package
v3.6.17 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color struct {
	R string `json:"r"`
	G string `json:"g"`
	B string `json:"b"`
}

Color QRCode color

type CreateQRCodeRequest

type CreateQRCodeRequest struct {
	Path  string `json:"path"`            // 扫码进入的小程序页面路径,最大长度 128 字节,不能为空;对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar",即可在 wx.getLaunchOptionsSync 接口中的 query 参数获取到 {foo:"bar"}。
	Width int    `json:"width,omitempty"` // 二维码的宽度,单位 px。最小 280px,最大 1280px
}

type GetRequest

type GetRequest struct {
	Path      string `json:"path"`
	Width     int    `json:"width,omitempty"`
	AutoColor bool   `json:"auto_color,omitempty"`
	LineColor Color  `json:"line_color,omitempty"`
	IsHyaline bool   `json:"is_hyaline,omitempty"`
}

type UnlimitedQRCode

type UnlimitedQRCode struct {
	Scene     string `json:"scene"`
	Page      string `json:"page,omitempty"`
	Width     int    `json:"width,omitempty"`
	AutoColor bool   `json:"auto_color,omitempty"`
	LineColor Color  `json:"line_color,omitempty"`
	IsHyaline bool   `json:"is_hyaline,omitempty"`
	// 要打开的小程序版本。正式版为 release,体验版为 trial,开发版为 develop
	EnvVersion string `json:"env_version,omitempty"`
	// 检查 page 是否存在,为 true 时 page 必须是已经发布的小程序存在的页面(否则报错);为 false 时允许小程序未发布或者 page 不存在, 但 page 有数量上限(60000个)请勿滥用
	CheckPath bool `json:"check_path"`
}

UnlimitedQRCode 小程序码参数

type WXACode

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

func NewWXACode

func NewWXACode(request *request.Request, conbineURI func(url string, req interface{}, withToken bool) (string, error)) *WXACode

func (*WXACode) CreateQRCode

func (cli *WXACode) CreateQRCode(req *CreateQRCodeRequest) (*http.Response, *request.CommonError, error)

获取小程序二维码,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制。

func (*WXACode) GetUnlimited

func (cli *WXACode) GetUnlimited(req *UnlimitedQRCode) (*http.Response, *request.CommonError, error)

获取小程序码,适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制。

func (*WXACode) QRCode

func (cli *WXACode) QRCode(req *GetRequest) (*http.Response, *request.CommonError, error)

获取小程序码,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制

Jump to

Keyboard shortcuts

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