Many Chanegs
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
from fastapi import FastAPI
|
||||
from pydantic import BaseModel
|
||||
from fastapi import FastAPI,Depends
|
||||
import mysql.connector
|
||||
from datetime import datetime
|
||||
import Classes.main_classes as CL ## Importiert Classes
|
||||
import uvicorn
|
||||
import logging
|
||||
import auth
|
||||
from fastapi.security.api_key import APIKey
|
||||
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG) # add this line
|
||||
logger = logging.getLogger("foo")
|
||||
@@ -49,8 +51,8 @@ def database(query,name,user):
|
||||
app = FastAPI()
|
||||
|
||||
@app.post("/ping")
|
||||
async def ping(ping: CL.CL_Ping_Set):
|
||||
database(f"INSERT INTO `Ping-Server` VALUES ('{datetime.now()}','{ping.name}','{ping.ipadress}')","Stines-GmbH","")
|
||||
async def ping(ping: CL.CL_Ping_Set,api_key: APIKey = Depends(auth.get_api_key)):
|
||||
database(f"INSERT INTO `Ping-Server` VALUES ('{datetime.now()}','{ping.name}','{ping.ipaddress}')","Stines-GmbH","")
|
||||
return f"ADD Ping from {ping.name} to Server"
|
||||
|
||||
## Get Database from Server
|
||||
|
||||
Reference in New Issue
Block a user