From 4d479cdf34d501afdd95e8f4101eca8060119292 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 29 Jul 2024 14:22:16 +0200 Subject: [PATCH] ADD /report --- Classes/main_classes.py | 7 +++++-- main.py | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Classes/main_classes.py b/Classes/main_classes.py index 225f358..659924b 100644 --- a/Classes/main_classes.py +++ b/Classes/main_classes.py @@ -5,7 +5,6 @@ class CL_Ping_Set(BaseModel): name: str ipaddress: str - class CL_Database_get(BaseModel): name: str @@ -179,4 +178,8 @@ class CL_ERROR_LOG(BaseModel): datum: str hostname: str samaccountname: str - errorcode: str \ No newline at end of file + errorcode: str + +class CL_REPORTING(BaseModel): + user: str + lastaccess: str \ No newline at end of file diff --git a/main.py b/main.py index 56a6a1c..e1a41a9 100644 --- a/main.py +++ b/main.py @@ -335,6 +335,11 @@ async def volume_mount(get: CL.CL_GET_VOLUME,api_key: APIKey = Depends(auth.get_ database(f"INSERT INTO `Volume-Mount` (date,user) VALUES ('{get.date}','{get.user}')","Stines-GmbH","") return f"User {get.user} ADD" +@app.posst("/report") +async def reporting(get: CL.CL_REPORTING,api_key: APIKey = Depends(auth.get_api_key)): + print(f"{get.user}") + print(f"{get.lastaccess}") + ## Startet den API-Server if __name__ == '__main__': uvicorn.run("main:app", host='0.0.0.0', port=8001, reload=True, log_level="debug") \ No newline at end of file