urllink

package
v2.1.5557 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TExpireType

type TExpireType int

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

const (
	// ExpireTypeTime 指定时间戳后失效
	ExpireTypeTime TExpireType = 0

	// ExpireTypeInterval 间隔指定天数后失效
	ExpireTypeInterval TExpireType = 1
)

type ULParams

type ULParams struct {
	Path  string `json:"path"`
	Query string `json:"query"`
	// envVersion 要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop"
	EnvVersion     string      `json:"env_version,omitempty"`
	IsExpire       bool        `json:"is_expire"`
	ExpireType     TExpireType `json:"expire_type"`
	ExpireTime     int64       `json:"expire_time"`
	ExpireInterval int         `json:"expire_interval"`
}

ULParams 请求参数 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link/urllink.generate.html#请求参数

type ULQueryResult

type ULQueryResult struct {
	util.CommonError

	URLLinkInfo struct {
		Appid      string `json:"appid"`
		Path       string `json:"path"`
		Query      string `json:"query"`
		CreateTime int64  `json:"create_time"`
		ExpireTime int64  `json:"expire_time"`
		EnvVersion string `json:"env_version"`
		CloudBase  struct {
			Env           string `json:"env"`
			Domain        string `json:"domain"`
			Path          string `json:"path"`
			Query         string `json:"query"`
			ResourceAppid string `json:"resource_appid"`
		} `json:"cloud_base"`
	} `json:"url_link_info"`
	VisitOpenid string `json:"visit_openid"`
}

ULQueryResult 返回的结果 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link/urllink.query.html 返回值

type ULResult

type ULResult struct {
	util.CommonError

	URLLink string `json:"url_link"`
}

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

type URLLink struct {
	*context.Context
}

URLLink 小程序 URL Link

func NewURLLink(ctx *context.Context) *URLLink

NewURLLink 实例化

func (*URLLink) Generate

func (u *URLLink) Generate(params *ULParams) (string, error)

Generate 生成url link

func (*URLLink) Query

func (u *URLLink) Query(urlLink string) (*ULQueryResult, error)

Query 查询小程序 url_link 配置。

Jump to

Keyboard shortcuts

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