From 0561361dcdc611bc7cb4af38d4ec2cc493374bf7 Mon Sep 17 00:00:00 2001 From: mhf Date: Tue, 17 Jan 2023 14:04:07 +0800 Subject: [PATCH] fix(notify): fix topic enable bug --- pkg/notify/models/topic.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pkg/notify/models/topic.go b/pkg/notify/models/topic.go index 5faf4baa98..68e01007ea 100644 --- a/pkg/notify/models/topic.go +++ b/pkg/notify/models/topic.go @@ -51,15 +51,14 @@ func parseEvent(es string) (notify.SNotifyEvent, error) { } type STopicManager struct { - db.SStandaloneResourceBaseManager - db.SEnabledResourceBaseManager + db.SEnabledStatusStandaloneResourceBaseManager } var TopicManager *STopicManager func init() { TopicManager = &STopicManager{ - SStandaloneResourceBaseManager: db.NewStandaloneResourceBaseManager( + SEnabledStatusStandaloneResourceBaseManager: db.NewEnabledStatusStandaloneResourceBaseManager( STopic{}, "topic_tbl", "topic", @@ -70,8 +69,7 @@ func init() { } type STopic struct { - db.SStandaloneResourceBase - db.SEnabledResourceBase + db.SEnabledStatusStandaloneResourceBase Type string `width:"20" nullable:"false" create:"required" update:"user" list:"user"` Resources uint64 `nullable:"false"` @@ -569,7 +567,7 @@ func (sm *STopicManager) TopicsByEvent(eventStr string, advanceDays int) ([]STop } else { q = q.Equals("results", false) } - + q = q.Equals("enabled", true) q = q.Filter(sqlchemy.GT(sqlchemy.AND_Val("", q.Field("resources"), 1<