params

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

* @Author: i@douxuefeng.cn * @Date: 2022-05-14 16:01:48 * @LastEditTime: 2022-05-14 16:04:11 * @LastEditors: i@douxuefeng.cn * @Description: * @FilePath: \go-utils\wechat\mini\params\access_token.go

* @Author: i@douxuefeng.cn * @Date: 2024-04-07 14:52:30 * @LastEditTime: 2024-05-27 06:37:09 * @LastEditors: Please set LastEditors * @Description:

* @Author: i@douxuefeng.cn * @Date: 2022-08-01 17:34:19 * @LastEditTime: 2022-09-20 11:10:56 * @LastEditors: i@douxuefeng.cn * @Description: * @FilePath: /go-utils/wechat/mini/params/qrcode.go

* @Author: i@douxuefeng.cn * @Date: 2022-05-14 16:06:20 * @LastEditTime: 2022-05-14 16:06:24 * @LastEditors: i@douxuefeng.cn * @Description: * @FilePath: \go-utils\wechat\mini\params\sns.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int64  `json:"expires_in"`
	Errcode     int    `json:"errcode"`
	Errmsg      string `json:"errmsg"`
}

type Code2Session

type Code2Session struct {
	Openid     string `json:"openid"`
	SessionKey string `json:"session_key"`
	Unionid    string `json:"unionid"`
	Errcode    int    `json:"errcode"`
	Errmsg     string `json:"errmsg"`
}

type ErrResp added in v1.0.0

type ErrResp struct {
	Errcode int64  `json:"errcode"`
	Errmsg  string `json:"errmsg"`
}

type GetTempMediaResp added in v1.0.0

type GetTempMediaResp struct {
	ErrResp
	ContentType string `json:"contentType"`
	Buffer      []byte `json:"buffer"`
}

type Image added in v1.0.0

type Image struct {
	Thumb   string `json:"thumb" form:"thumb"`
	MediaId string `json:"media_id"`
}
type Link struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Url         string `json:"url"`
	ThumbUrl    string `json:"thumb_url"` //图文链接消息的图片链接,支持 JPG、PNG 格式,较好的效果为大图 640 X 320,小图 80 X 80
}

type Miniprogrampage added in v1.0.0

type Miniprogrampage struct {
	Title        string `json:"title" form:"title"`       //消息标题
	Pagepath     string `json:"pagepath" form:"pagepath"` //小程序的页面路径,跟app.json对齐,支持参数,比如pages/index/index?foo=bar
	Thumb        string `json:"thumb" form:"thumb"`
	ThumbMediaId string `json:"thumb_media_id"` //小程序消息卡片的封面, image 类型的 media_id,通过 uploadTempMedia接口上传图片文件获得,建议大小为 520*416
}

type PhoneInfo

type PhoneInfo struct {
	PhoneNumber     string `json:"phoneNumber"`
	PurePhoneNumber string `json:"purePhoneNumber"`
	CountryCode     string `json:"countryCode"`
	Watermark       string `json:"watermark"`
}

type PhoneResult

type PhoneResult struct {
	Errcode   int       `json:"errcode"`
	Errmsg    string    `json:"errmsg"`
	PhoneInfo PhoneInfo `json:"phone_info"`
}

type QrcodeParams added in v0.2.3

type QrcodeParams struct {
	Scene      string         `json:"scene,omitempty"` //最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式)
	Page       string         `json:"page,omitempty"`
	Path       string         `json:"path,omitempty"`        //小程序码 有数量限制
	CheckPath  bool           `json:"check_path,omitempty"`  // 默认是true,检查page 是否存在,为 true 时 page 必须是已经发布的小程序存在的页面(否则报错);为 false 时允许小程序未发布或者 page 不存在, 但page 有数量上限(60000个)请勿滥用。
	EnvVersion string         `json:"env_version,omitempty"` //release trial develop
	Width      int            `json:"width,omitempty"`       //默认430,二维码的宽度,单位 px,最小 280px,最大 1280px
	AutoColor  bool           `json:"auto_color,omitempty"`  //自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调,默认 false
	LineColor  map[string]int `json:"line_color,omitempty"`  //默认是{"r":0,"g":0,"b":0} 。auto_color 为 false 时生效,使用 rgb 设置颜色 例如 {"r":"xxx","g":"xxx","b":"xxx"} 十进制表示
	IsHyaline  bool           `json:"is_hyaline,omitempty"`  //默认是false,是否需要透明底色,为 true 时,生成透明底色的小程序
}

type QrcodeResponse added in v0.2.3

type QrcodeResponse struct {
	Errcode int    `json:"errcode,omitempty"`
	Errmsg  string `json:"errmsg,omitempty"`
}

type SendCustomMessageReq added in v1.0.0

type SendCustomMessageReq struct {
	Touser          string `json:"touser" form:"touser"`
	Msgtype         string `json:"msgtype" form:"msgtype"`
	Text            Text   `json:"text"`
	Image           Image  `json:"image"`
	Link            Link
	Miniprogrampage Miniprogrampage `json:"miniprogrampage"`
}

type SendSubcribeMessageItemReq added in v1.0.0

type SendSubcribeMessageItemReq struct {
	Value string `json:"value"`
}

type SendSubcribeMessageReq added in v1.0.0

type SendSubcribeMessageReq struct {
	Touser      string                                `json:"touser"`
	Template_id string                                `json:"template_id"`
	Page        string                                `json:"page"`
	Data        map[string]SendSubcribeMessageItemReq `json:"data"`
}

type Serve added in v1.0.0

type Serve struct {
	Echostr   string `url:"echostr"`
	Timestamp string `url:"timestamp"`
	Nonce     string `url:"nonce"`
	Signature string `url:"signature"`
}

type Text added in v1.0.0

type Text struct {
	Content string `json:"content"`
}

type UploadTempMediaResp added in v1.0.0

type UploadTempMediaResp struct {
	ErrResp
	Type      string `json:"type"`
	MediaId   string `json:"media_id"` //媒体文件上传后,获取标识,3天内有效。
	CreatedAt int64  `json:"created_at"`
}

Jump to

Keyboard shortcuts

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