|
|
|
@ -1,13 +1,15 @@
|
|
|
|
from typing import List, Optional
|
|
|
|
from typing import List, Optional
|
|
|
|
|
|
|
|
|
|
|
|
from fastapi import APIRouter, HTTPException, status
|
|
|
|
from fastapi import APIRouter, HTTPException, status
|
|
|
|
|
|
|
|
from sqlalchemy import select
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from src.aeros_equipment.model import AerosEquipmentCustomParameterData
|
|
|
|
from src.auth.service import CurrentUser
|
|
|
|
from src.auth.service import CurrentUser
|
|
|
|
from src.database.core import DbSession
|
|
|
|
from src.database.core import DbSession
|
|
|
|
from src.database.service import CommonParameters
|
|
|
|
from src.database.service import CommonParameters
|
|
|
|
from src.models import StandardResponse
|
|
|
|
from src.models import StandardResponse
|
|
|
|
|
|
|
|
|
|
|
|
from .schema import EquipmentPagination
|
|
|
|
from .schema import CustomParameter, EquipmentPagination
|
|
|
|
from .service import save_default_equipment, get_all
|
|
|
|
from .service import save_default_equipment, get_all
|
|
|
|
|
|
|
|
|
|
|
|
# from .schema import (OverhaulScheduleCreate, OverhaulSchedulePagination, OverhaulScheduleUpdate)
|
|
|
|
# from .schema import (OverhaulScheduleCreate, OverhaulSchedulePagination, OverhaulScheduleUpdate)
|
|
|
|
@ -33,3 +35,18 @@ async def save_default_equipments(
|
|
|
|
await save_default_equipment(db_session=db_session, project_name=project_name)
|
|
|
|
await save_default_equipment(db_session=db_session, project_name=project_name)
|
|
|
|
|
|
|
|
|
|
|
|
return {"data": None, "status": "success", "message": "Success"}
|
|
|
|
return {"data": None, "status": "success", "message": "Success"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@router.get("/parameter-oreda/{location_tag}", response_model=StandardResponse[CustomParameter])
|
|
|
|
|
|
|
|
async def get_parameter_oreda(
|
|
|
|
|
|
|
|
db_session: DbSession, location_tag:str
|
|
|
|
|
|
|
|
):
|
|
|
|
|
|
|
|
query = select(AerosEquipmentCustomParameterData).where(AerosEquipmentCustomParameterData.location_tag == location_tag)
|
|
|
|
|
|
|
|
result = await db_session.execute(query)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
"data" : result.scalars().first(),
|
|
|
|
|
|
|
|
"status": "success",
|
|
|
|
|
|
|
|
"message": "Success"
|
|
|
|
|
|
|
|
}
|