package model import ( "encoding/json" "time" ) // WechatBinding 用户微信订阅绑定 type WechatBinding struct { ID string `gorm:"type:uuid;primaryKey;default:gen_random_uuid()" json:"id"` UserID string `gorm:"column:user_id;type:uuid;uniqueIndex" json:"userId"` OpenID string `gorm:"column:open_id;size:128;uniqueIndex" json:"openId"` AuthorizedTemplates json.RawMessage `gorm:"column:authorized_templates;type:jsonb" json:"authorizedTemplates,omitempty"` CreatedAt time.Time `gorm:"type:timestamptz" json:"createdAt"` UpdatedAt time.Time `gorm:"type:timestamptz" json:"updatedAt"` } func (WechatBinding) TableName() string { return "wechat_bindings" }