屏蔽机器人消息

This commit is contained in:
2026-07-02 11:02:48 +08:00
parent 6052bf90ec
commit 7bc2e53ce6
3 changed files with 29 additions and 27 deletions
+6
View File
@@ -66,6 +66,12 @@ func (s *Store) CountBotNodes(opts ListOptions) (int64, error) {
return total, s.db.Model(&BotNodeRecord{}).Count(&total).Error
}
func (s *Store) IsBotNodeID(nodeID string) bool {
var count int64
s.db.Model(&BotNodeRecord{}).Where("node_id = ?", nodeID).Count(&count)
return count > 0
}
func (s *Store) GetBotNode(id uint64) (*BotNodeRecord, error) {
var row BotNodeRecord
if err := s.db.Where("id = ?", id).Take(&row).Error; err != nil {