You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
from typing import List, Optional
|
|
|
|
from fastapi import APIRouter, HTTPException, status
|
|
|
|
from src.auth.service import CurrentUser
|
|
from src.database.core import DbSession
|
|
from src.database.service import CommonParameters
|
|
from src.models import StandardResponse
|
|
|
|
from .schema import EquipmentPagination
|
|
from .service import save_default_equipment, get_all
|
|
|
|
# from .schema import (OverhaulScheduleCreate, OverhaulSchedulePagination, OverhaulScheduleUpdate)
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("", response_model=StandardResponse[EquipmentPagination])
|
|
async def get_all_simulation(db_session: DbSession, common: CommonParameters):
|
|
"""Get all simulation."""
|
|
|
|
results = await get_all(common = common)
|
|
|
|
|
|
return {"data": results, "status": "success", "message": "Success"}
|
|
|
|
|
|
|
|
@router.get("/save_default", response_model=StandardResponse[None])
|
|
async def save_default_equipments(
|
|
db_session: DbSession, project_name: str = "trialapi"
|
|
):
|
|
await save_default_equipment(db_session=db_session, project_name=project_name)
|
|
|
|
return {"data": None, "status": "success", "message": "Success"}
|