package models import "time" // NotifyChannel 通知通道:一个飞书/Lark 群机器人 webhook。 // 支持多通道对应不同告警群(如「应用告警群」「Nginx 告警群」),告警规则各自关联。 type NotifyChannel struct { ID uint `json:"id"` Name string `json:"name"` Webhook string `json:"webhook"` // ENC: 加密存储,不外发 SigningSecret string `json:"signingSecret"` // ENC: 可选签名校验 Enabled bool `json:"enabled"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` } func (c *NotifyChannel) Sanitized() map[string]interface{} { return map[string]interface{}{ "id": c.ID, "name": c.Name, "hasWebhook": c.Webhook != "", "hasSecret": c.SigningSecret != "", "enabled": c.Enabled, "createdAt": c.CreatedAt, "updatedAt": c.UpdatedAt, } }