2025-04-29 15:03:02 +08:00
|
|
|
from fastapi import FastAPI
|
|
|
|
|
import sys
|
2025-06-20 10:03:39 +08:00
|
|
|
from .api.endpoints import router as api_router
|
2026-01-08 16:22:25 +08:00
|
|
|
from .core.fastgpt_client import lifespan
|
|
|
|
|
from .core.logging_config import setup_logging
|
|
|
|
|
|
|
|
|
|
# Setup logging first
|
|
|
|
|
setup_logging()
|
2025-04-29 15:03:02 +08:00
|
|
|
|
|
|
|
|
app = FastAPI(
|
|
|
|
|
title="AI Accident Information Collection API",
|
|
|
|
|
description="AI Accident Information Collection API",
|
2026-01-08 16:22:25 +08:00
|
|
|
version="1.0.0",
|
|
|
|
|
lifespan=lifespan
|
2025-04-29 15:03:02 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@app.get("/")
|
|
|
|
|
def read_root():
|
|
|
|
|
return {"message": "Server is running."}
|
|
|
|
|
|
|
|
|
|
app.include_router(api_router)
|