12345678910111213141516171819202122232425262728293031323334 |
- from fastapi import FastAPI
- from .api import vector, raster
- from .database import engine, Base
- # 创建数据库表
- Base.metadata.create_all(bind=engine)
- app = FastAPI(
- title="地图数据处理系统",
- description="一个用于处理地图数据的API系统",
- version="1.0.0",
- openapi_tags=[
- {
- "name": "vector",
- "description": "矢量数据相关接口",
- },
- {
- "name": "raster",
- "description": "栅格数据相关接口",
- }
- ]
- )
- # 注册路由
- app.include_router(vector.router, prefix="/api/vector", tags=["vector"])
- app.include_router(raster.router, prefix="/api/raster", tags=["raster"])
- @app.get("/")
- async def root():
- return {"message": "Welcome to the GIS Data Management API"}
- # if __name__ == "__main__":
- # import uvicorn
- # uvicorn.run(app, host="0.0.0.0", port=8000)
|