Files
yunzerwebsiteallinone/go/models/wechat_mini.go
T
2026-10-03 23:46:55 +08:00

25 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package models
import "time"
// =============================================================
// 微信小程序配置(表结构见 docs/sql/create_wechat_mini_config.sql)
//
// 小程序与公众号是两套独立应用,AppID / AppSecret 不可混用,
// 因此单独建表;AppSecret 以 AES-256-GCM 加密存储(复用 wechatmp 的密钥)。
// =============================================================
// WechatMiniConfig 微信小程序配置 yz_platform_wechat_mini_config(单行)
type WechatMiniConfig struct {
ID uint64 `orm:"column(id);pk;auto" json:"id"`
AppID string `orm:"column(app_id);size(64)" json:"app_id"`
AppSecret string `orm:"column(app_secret);size(512)" json:"-"` // 加密存储,不回显
Enabled int8 `orm:"column(enabled);default(0)" json:"enabled"`
AutoBind int8 `orm:"column(auto_bind);default(1)" json:"auto_bind"` // 1:手机号命中身份后自动绑定小程序
Remark string `orm:"column(remark);size(255)" json:"remark"`
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
}
func (m *WechatMiniConfig) TableName() string { return "yz_platform_wechat_mini_config" }