feat: add gosedo and media news sources
All checks were successful
CI/CD Pipeline / Quality Gate (push) Successful in 1m10s
CI/CD Pipeline / Build and Push Images (push) Successful in 19s
CI/CD Pipeline / Internal Notify (push) Successful in 0s
CI/CD Pipeline / Deploy Dev via Compose (push) Successful in 24s

This commit is contained in:
2026-08-13 14:12:53 +02:00
parent 1c2dd985d4
commit a0eb0a5303
29 changed files with 3228 additions and 85 deletions

View File

@@ -27,6 +27,8 @@ class ParserSourceDescriptor:
supports_file_upload: bool = False
api_route: str = ""
upload_route: str = ""
supports_refresh: bool = True
admin_only: bool = False
@property
def result_list_url(self) -> str:
@@ -41,7 +43,7 @@ class ParserSourceDescriptor:
@property
def upload_url(self) -> str:
"""Frontend/API URL ручной загрузки файла источника."""
if not self.supports_file_upload or not self.api_route:
if not self.supports_file_upload:
return ""
return f"/api/v1/{self.upload_api_route}/"
@@ -295,6 +297,38 @@ PARSER_SOURCES: dict[str, ParserSourceDescriptor] = {
),
api_route="trudvsem/vacancies",
),
"gosedo_address_directory": ParserSourceDescriptor(
key="gosedo_address_directory",
source=ParserLoadLog.Source.GOSEDO_ADDRESS_DIRECTORY,
title="ГосЭДО: Глобальный адресный справочник",
agency="ГосЭДО",
data_scope="Участники, операторы и организаторы электронного документооборота",
task_name="apps.parsers.tasks.parse_gosedo_address_directory",
mode="official_html",
upstream_url="https://gosedo.ru/wp-content/uploads/files/addresseesActual.html",
access_method="official_public_file",
parser_strategy="streaming_summary_details_html",
source_notes="Ежедневный conditional GET; публикация полным атомарным снимком.",
admin_only=True,
),
"media_news": ParserSourceDescriptor(
key="media_news",
source=ParserLoadLog.Source.MEDIA_NEWS,
title="Новости СМИ",
agency="Пользовательская загрузка",
data_scope="Оцененные упоминания организаций в СМИ",
task_name="apps.parsers.tasks.parse_media_news",
mode="manual_upload",
access_method="admin_upload",
parser_strategy="validated_xlsx_upsert",
source_notes=(
"Повторная загрузка обновляет совпавшие новости и сохраняет историю."
),
supports_file_upload=True,
upload_route="parsers/upload/media_news",
supports_refresh=False,
admin_only=True,
),
}