Добавлены методы для работы с настройками авто-модерации, включая получение и установку значений, а также переключение состояний авто-публикации и авто-отклонения. Обновлены соответствующие репозитории и обработчики для интеграции новых функций в админ-панели.
Some checks are pending
CI pipeline / Test & Code Quality (push) Waiting to run

This commit is contained in:
2026-02-28 22:21:29 +03:00
parent b3cdadfd8e
commit 31314c9c9b
12 changed files with 1388 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ from database.repositories.blacklist_history_repository import (
BlacklistHistoryRepository,
)
from database.repositories.blacklist_repository import BlacklistRepository
from database.repositories.bot_settings_repository import BotSettingsRepository
from database.repositories.message_repository import MessageRepository
from database.repositories.migration_repository import MigrationRepository
from database.repositories.post_repository import PostRepository
@@ -25,6 +26,7 @@ class RepositoryFactory:
self._admin_repo: Optional[AdminRepository] = None
self._audio_repo: Optional[AudioRepository] = None
self._migration_repo: Optional[MigrationRepository] = None
self._bot_settings_repo: Optional[BotSettingsRepository] = None
@property
def users(self) -> UserRepository:
@@ -82,6 +84,13 @@ class RepositoryFactory:
self._migration_repo = MigrationRepository(self.db_path)
return self._migration_repo
@property
def bot_settings(self) -> BotSettingsRepository:
"""Возвращает репозиторий настроек бота."""
if self._bot_settings_repo is None:
self._bot_settings_repo = BotSettingsRepository(self.db_path)
return self._bot_settings_repo
async def create_all_tables(self):
"""Создает все таблицы в базе данных."""
await self.migrations.create_table() # Сначала создаем таблицу миграций
@@ -92,6 +101,7 @@ class RepositoryFactory:
await self.posts.create_tables()
await self.admins.create_tables()
await self.audio.create_tables()
await self.bot_settings.create_table()
async def check_database_integrity(self):
"""Проверяет целостность базы данных."""