23 lines
812 B
Go
23 lines
812 B
Go
package model
|
||
|
||
import (
|
||
core "git.yuntuo.hk/k2safe/orbit/model"
|
||
)
|
||
|
||
// Subscription 表示事件订阅配置,绑定授权凭据及过滤规则。
|
||
// 对应表 orbit_subscriptions;这是服务端持久化模型,不直接作为 API 响应。
|
||
type Subscription struct {
|
||
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
|
||
core.Record
|
||
// Name 可读名称,唯一性范围由对应数据表约束。
|
||
Name string `db:"name"`
|
||
// CredentialID 关联的命名空间凭据标识。
|
||
CredentialID core.ID `db:"credential_id"`
|
||
// Filter 订阅过滤规则的 JSON 文档。
|
||
Filter core.JSON `db:"filter"`
|
||
// Enabled 是否启用;关闭后拒绝相应的新接入或新操作。
|
||
Enabled bool `db:"enabled"`
|
||
}
|
||
|
||
func (Subscription) TableName() string { return "orbit_subscriptions" }
|