Spaces:
Sleeping
Sleeping
| from fastapi import APIRouter , Query | |
| from app.services.bbch_service import get_all_stages , get_stage_by_code , get_crop_list | |
| from app.schemas.bbch import BBCHCategory , BBCHStage | |
| from typing import List , Optional | |
| router = APIRouter() | |
| async def get_stages(crop_type: Optional[str] = Query(None , description="Filter by crop")): | |
| return get_all_stages(crop_type) | |
| async def get_stage(code: str, crop_type: Optional[str] = Query(None, description="Crop type")): | |
| return get_stage_by_code(code , crop_type) | |
| async def get_crops(): | |
| return get_crop_list() | |