1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-04 12:52:27 +08:00

Bug fix: omitempty关键字,给它赋的值恰好等于默认空值的话,在转为 json 之后也不会输出这个 field (#539)

This commit is contained in:
lyj
2022-02-28 10:38:46 +08:00
committed by GitHub
parent 5c4b28acee
commit 1b5c5fba67

View File

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