From fcc61fdcd991b594baf843f572800d42e12be861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Mon, 15 Jul 2024 14:36:58 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=96=B0=E5=A2=9E=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=98=AF=E5=90=A6=E5=BC=80=E5=90=AF=E7=83=AD=E6=A6=9C?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.yaml | 2 ++ config/system.go | 1 + model/entity/friend.go | 1 + tasks/friends/friends.go | 1 + 4 files changed, 5 insertions(+) diff --git a/config.yaml b/config.yaml index 8647683..8aa8746 100644 --- a/config.yaml +++ b/config.yaml @@ -19,6 +19,8 @@ system: welcome: true # 每日早报 news: true + # 热榜 + hotTop: true # 微信HOOK配置 wechat: diff --git a/config/system.go b/config/system.go index 990735c..49ec19b 100644 --- a/config/system.go +++ b/config/system.go @@ -20,4 +20,5 @@ type defaultRule struct { Summary bool `json:"summary" yaml:"summary"` // 是否启用聊天总结 Welcome bool `json:"welcome" yaml:"welcome"` // 是否启用欢迎新成员 News bool `json:"news" yaml:"news"` // 是否启用每日早报 + HotTop bool `json:"hotTop" yaml:"hotTop"` // 是否启用热门话题 } diff --git a/model/entity/friend.go b/model/entity/friend.go index 26796c7..1e497aa 100644 --- a/model/entity/friend.go +++ b/model/entity/friend.go @@ -20,6 +20,7 @@ type Friend struct { EnableWelcome bool `json:"enableWelcome" gorm:"type:tinyint(1) default 0 not null"` // 是否启用迎新 EnableSummary bool `json:"enableSummary" gorm:"type:tinyint(1) default 0 not null"` // 是否启用总结 EnableNews bool `json:"enableNews" gorm:"type:tinyint(1) default 0 not null"` // 是否启用新闻 + EnableHotTop bool `json:"enableHotTop" gorm:"type:tinyint(1) default 0 not null"` // 是否启用热榜新闻 ClearMember int `json:"clearMember"` // 清理成员配置(多少天未活跃的) IsOk bool `json:"isOk" gorm:"type:tinyint(1) default 0 not null"` // 是否正常 UsedTokens int `json:"usedTokens"` // 已使用的AI Token数量 diff --git a/tasks/friends/friends.go b/tasks/friends/friends.go index fb52e40..6afbf03 100644 --- a/tasks/friends/friends.go +++ b/tasks/friends/friends.go @@ -75,6 +75,7 @@ func Sync() { EnableSummary: config.Conf.System.DefaultRule.Summary, EnableWelcome: config.Conf.System.DefaultRule.Welcome, EnableNews: config.Conf.System.DefaultRule.News, + EnableHotTop: config.Conf.System.DefaultRule.HotTop, ClearMember: 0, LastActive: time.Now().Local(), }).Error