feat: initial microservices project structure
Services: - api: FastAPI gateway with JWT auth, async endpoints, WebSocket - worker-gpu: CUDA sentence-transformers, FAISS IVFFlat, Ollama LLM - worker-indexer: Winnowing+MinHash plagiarism detection, PDF/DOCX extraction - worker-notifier: SMTP email notifications - worker-gost: GOST 7.1-2003 and GOST R 7.0.5-2008 formatting Infrastructure: - docker-compose.yml (production) + docker-compose.dev.yml (hot reload) - Nginx reverse proxy + WebSocket support - PostgreSQL 16 with Alembic migrations - Elasticsearch 8 with Russian/English analyzers - MinIO, RabbitMQ, Redis, Ollama Frontend: - React 18 + Vite + TypeScript + TailwindCSS + Zustand + React Query v5 - 9 pages: Home, Search, Cabinet, Task, Check, Bibliography, Pricing, Login, Register Scripts: - Parser stubs: OpenAlex, КиберЛенинка, arXiv (Phase 0 - to be filled) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
39
services/api/app/schemas/tasks.py
Normal file
39
services/api/app/schemas/tasks.py
Normal file
@@ -0,0 +1,39 @@
|
||||
"""Схемы для задач и поиска."""
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class TaskCreate(BaseModel):
|
||||
"""Создание задачи."""
|
||||
|
||||
type: str
|
||||
input_data: dict[str, Any] = Field(default_factory=dict)
|
||||
|
||||
|
||||
class TaskResponse(BaseModel):
|
||||
"""Ответ с информацией о задаче."""
|
||||
|
||||
id: str
|
||||
type: str
|
||||
status: str
|
||||
queue_position: int | None = None
|
||||
eta_seconds: int | None = None
|
||||
input_data: dict[str, Any] = Field(default_factory=dict)
|
||||
result: dict[str, Any] | None = None
|
||||
error: str | None = None
|
||||
created_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class SearchRequest(BaseModel):
|
||||
"""Запрос на семантический поиск источников."""
|
||||
|
||||
query: str = Field(min_length=3, max_length=1000)
|
||||
lang: str | None = Field(default=None, description="Язык: ru, en или None для всех")
|
||||
year_from: int | None = Field(default=None, ge=1900, le=2100)
|
||||
year_to: int | None = Field(default=None, ge=1900, le=2100)
|
||||
category: str | None = Field(default=None, description="Тематическая категория")
|
||||
Reference in New Issue
Block a user