urlscheme

package
v2.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExpireTypeTime 指定时间戳后失效
	ExpireTypeTime TExpireType = 0
	// ExpireTypeInterval 间隔指定天数后失效
	ExpireTypeInterval TExpireType = 1

	// EnvVersionRelease 正式版为"release"
	EnvVersionRelease EnvVersion = "release"
	// EnvVersionTrial 体验版为"trial"
	EnvVersionTrial EnvVersion = "trial"
	// EnvVersionDevelop 开发版为"develop"
	EnvVersionDevelop EnvVersion = "develop"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvVersion

type EnvVersion string

EnvVersion 要打开的小程序版本

type JumpWxa

type JumpWxa struct {
	Path  string `json:"path"`
	Query string `json:"query"`
	// envVersion 要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop"
	EnvVersion EnvVersion `json:"env_version,omitempty"`
}

JumpWxa 跳转到的目标小程序信息

type QueryScheme

type QueryScheme struct {
	// 小程序 scheme 码
	Scheme string `json:"scheme"`
}

QueryScheme 获取小程序访问scheme https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-scheme/urlscheme.query.html#参数

type SchemeInfo

type SchemeInfo struct {
	// 小程序 appid。
	AppID string `json:"appid"`
	// 小程序页面路径。
	Path string `json:"path"`
	// 小程序页面query。
	Query string `json:"query"`
	// 创建时间,为 Unix 时间戳。
	CreateTime int64 `json:"create_time"`
	// 到期失效时间,为 Unix 时间戳,0 表示永久生效
	ExpireTime int64 `json:"expire_time"`
	// 要打开的小程序版本。正式版为"release",体验版为"trial",开发版为"develop"。
	EnvVersion EnvVersion `json:"env_version"`
}

SchemeInfo scheme 配置

type TExpireType

type TExpireType int

TExpireType 失效类型 (指定时间戳/指定间隔)

type URLScheme

type URLScheme struct {
	*context.Context
}

URLScheme 小程序 URL Scheme

func NewURLScheme

func NewURLScheme(ctx *context.Context) *URLScheme

NewURLScheme 实例化

func (*URLScheme) Generate

func (u *URLScheme) Generate(params *USParams) (string, error)

Generate 生成url link

func (*URLScheme) QueryScheme

func (u *URLScheme) QueryScheme(querySchemeParams QueryScheme) (schemeInfo SchemeInfo, visitOpenid string, err error)

QueryScheme 查询小程序 scheme 码

type USParams

type USParams struct {
	JumpWxa        *JumpWxa    `json:"jump_wxa"`
	ExpireType     TExpireType `json:"expire_type"`
	ExpireTime     int64       `json:"expire_time"`
	ExpireInterval int         `json:"expire_interval"`
}

USParams 请求参数 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-scheme/urlscheme.generate.html#请求参数

type USResult

type USResult struct {
	util.CommonError

	OpenLink string `json:"openlink"`
}

USResult 返回的结果 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-scheme/urlscheme.generate.html#返回值

Jump to

Keyboard shortcuts

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