feat(server-go): 微信订阅消息骨架(#11,绑定/订阅/巡检触发,配置占位)

This commit is contained in:
weijuesen
2026-08-12 17:28:07 +08:00
parent 79e524b1d4
commit 921b185da2
9 changed files with 517 additions and 4 deletions
+18
View File
@@ -0,0 +1,18 @@
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" }