feat: 初始化 vps-manager 资产管理系统(Asset/VPSDetail/DomainDetail/AIAccount 模型 + FastAPI 骨架)
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
"""vps-manager 后端入口"""
|
||||
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
from app.database import init_db
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(_: FastAPI):
|
||||
"""应用启动时自动建表"""
|
||||
init_db()
|
||||
yield
|
||||
|
||||
|
||||
app = FastAPI(title="VPS 资产管理系统", version="0.1.0", lifespan=lifespan)
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
def health_check() -> dict:
|
||||
"""健康检查"""
|
||||
return {"status": "ok", "app": "vps-manager", "version": "0.1.0"}
|
||||
Reference in New Issue
Block a user