批量优化功能
This commit is contained in:
@@ -35,6 +35,7 @@ type WechatMpConfig struct {
|
||||
Verified int8 `orm:"column(verified);default(0)" json:"verified"`
|
||||
Enabled int8 `orm:"column(enabled);default(0)" json:"enabled"`
|
||||
Remark string `orm:"column(remark);size(255)" json:"remark"`
|
||||
FollowQrcode string `orm:"column(follow_qrcode);type(text);null" json:"follow_qrcode"` // 关注二维码(data URL)
|
||||
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"`
|
||||
}
|
||||
@@ -83,3 +84,46 @@ type WechatMpVerifyCode struct {
|
||||
}
|
||||
|
||||
func (m *WechatMpVerifyCode) TableName() string { return "yz_platform_wechat_mp_verify_code" }
|
||||
|
||||
// WechatMpLoginToken 公众号一次性登录令牌 yz_platform_wechat_mp_login_token
|
||||
// 用户在公众号内发送「登录」→ 生成一次性令牌并回复登录链接 →
|
||||
// 用户在微信内打开链接,前端用令牌换取正式登录态(未认证公众号无法使用网页授权,用此方案替代)。
|
||||
type WechatMpLoginToken struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Token string `orm:"column(token);size(64)" json:"token"`
|
||||
OpenID string `orm:"column(openid);size(64)" json:"openid"`
|
||||
BindType string `orm:"column(bind_type);size(32)" json:"bind_type"`
|
||||
BindID uint64 `orm:"column(bind_id)" json:"bind_id"`
|
||||
BindTid uint64 `orm:"column(bind_tid)" json:"bind_tid"`
|
||||
ExpireAt time.Time `orm:"column(expire_at);type(datetime)" json:"expire_at"`
|
||||
UsedAt *time.Time `orm:"column(used_at);type(datetime);null" json:"used_at"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
}
|
||||
|
||||
func (m *WechatMpLoginToken) TableName() string { return "yz_platform_wechat_mp_login_token" }
|
||||
|
||||
// 扫码登录会话状态
|
||||
const (
|
||||
WechatScanLoginPending = 0 // 待确认(等待用户点击确认链接)
|
||||
WechatScanLoginOK = 1 // 已确认(待 PC 端领取令牌)
|
||||
WechatScanLoginExpired = 2 // 已过期
|
||||
WechatScanLoginPicked = 3 // 令牌已领取
|
||||
)
|
||||
|
||||
// WechatMpScanLogin 公众号扫码登录会话 yz_platform_wechat_mp_scan_login
|
||||
type WechatMpScanLogin struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Scene string `orm:"column(scene);size(64)" json:"scene"`
|
||||
Code string `orm:"column(code);size(8)" json:"code"`
|
||||
OpenID string `orm:"column(openid);size(64);default('')" json:"openid"`
|
||||
Status int8 `orm:"column(status);default(0)" json:"status"`
|
||||
LoginToken string `orm:"column(login_token);size(64);default('')" json:"login_token"`
|
||||
BindType string `orm:"column(bind_type);size(32);default('')" json:"bind_type"`
|
||||
BindID uint64 `orm:"column(bind_id);default(0)" json:"bind_id"`
|
||||
BindTid uint64 `orm:"column(bind_tid);default(0)" json:"bind_tid"`
|
||||
ExpireAt time.Time `orm:"column(expire_at);type(datetime)" json:"expire_at"`
|
||||
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 *WechatMpScanLogin) TableName() string { return "yz_platform_wechat_mp_scan_login" }
|
||||
|
||||
Reference in New Issue
Block a user