feat:初始化工程
This commit is contained in:
6
apis/__init__.py
Normal file
6
apis/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from fastapi import FastAPI
|
||||
from .log import router as log_router
|
||||
|
||||
|
||||
def register_routers(app: FastAPI):
|
||||
app.include_router(log_router, prefix="")
|
||||
BIN
apis/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
apis/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
BIN
apis/__pycache__/log.cpython-312.pyc
Normal file
BIN
apis/__pycache__/log.cpython-312.pyc
Normal file
Binary file not shown.
15
apis/log.py
Normal file
15
apis/log.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from schemas.log_alert import LogAlertTrigger
|
||||
from service import log_alert_service
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/log-alter",
|
||||
tags=["日志告警"],
|
||||
responses={404: {"description": "Not found"}}
|
||||
)
|
||||
|
||||
|
||||
@router.post("", summary="触发日志告警")
|
||||
def trigger_log_alter(log_alter: LogAlertTrigger):
|
||||
return log_alert_service.trigger_alert(log_alter)
|
||||
Reference in New Issue
Block a user