Files
python_parser/python_parser/app/schemas/monitoring_tar.py

33 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from pydantic import BaseModel, Field
from typing import Optional, Literal
from enum import Enum
class TarMode(str, Enum):
"""Режимы получения данных мониторинга ТЭР"""
TOTAL = "total"
LAST_DAY = "last_day"
class MonitoringTarRequest(BaseModel):
"""Схема запроса для получения данных мониторинга ТЭР"""
mode: Optional[TarMode] = Field(
None,
description="Режим получения данных: 'total' (строки 'Всего') или 'last_day' (последние строки). Если не указан, возвращаются все данные",
example="total"
)
class Config:
json_schema_extra = {
"example": {
"mode": "total"
}
}
class MonitoringTarFullRequest(BaseModel):
"""Схема запроса для получения всех данных мониторинга ТЭР"""
# Пустая схема - возвращает все данные без фильтрации
pass
class Config:
json_schema_extra = {
"example": {}
}