28 lines
688 B
Python
28 lines
688 B
Python
from __future__ import annotations
|
|
|
|
from fastapi import APIRouter
|
|
from typing import Any, Dict
|
|
|
|
from app.services.settings import get_models, update_models, get_exchanges, update_exchanges
|
|
|
|
router = APIRouter(prefix="/settings", tags=["Settings"])
|
|
|
|
|
|
@router.get("/models")
|
|
async def models_get() -> Dict[str, Any]:
|
|
return get_models()
|
|
|
|
|
|
@router.put("/models")
|
|
async def models_put(patch: Dict[str, Any]) -> Dict[str, Any]:
|
|
return update_models(patch)
|
|
|
|
|
|
@router.get("/exchanges")
|
|
async def exchanges_get() -> Dict[str, Any]:
|
|
return get_exchanges()
|
|
|
|
|
|
@router.put("/exchanges")
|
|
async def exchanges_put(patch: Dict[str, Any]) -> Dict[str, Any]:
|
|
return update_exchanges(patch) |