feat: 新增预警定时扫描器,移除附件归档字段并为角色表补充更新时间

This commit is contained in:
SunYF
2026-10-31 15:41:27 +08:00
parent 11dbdaae75
commit 0c03d32682
107 changed files with 10790 additions and 1844 deletions
+24
View File
@@ -8,6 +8,30 @@ import (
"fmt"
)
// The AlertFunc type is an adapter to allow the use of ordinary
// function as Alert mutator.
type AlertFunc func(context.Context, *ent.AlertMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f AlertFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.AlertMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.AlertMutation", m)
}
// The AlertRuleFunc type is an adapter to allow the use of ordinary
// function as AlertRule mutator.
type AlertRuleFunc func(context.Context, *ent.AlertRuleMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f AlertRuleFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.AlertRuleMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.AlertRuleMutation", m)
}
// The AttachmentFunc type is an adapter to allow the use of ordinary
// function as Attachment mutator.
type AttachmentFunc func(context.Context, *ent.AttachmentMutation) (ent.Value, error)