EVMS 완전 자동화: - 공기 지연 AI 예측 (SPI 기반 준공일 예측) - 기성청구 가능 금액 자동 산출 - 매일 자정 EVMS 스냅샷 자동 생성 (APScheduler) - 매일 07:00 GONGSA 아침 브리핑 자동 생성 준공도서 패키지: - 준공 요약 + 품질시험 목록 + 검측 이력 + 인허가 현황 → ZIP 번들 - 준공 준비 체크리스트 API - 4종 HTML 템플릿 (WeasyPrint PDF 출력) Vision AI Level 3: - 설계 도면 vs 현장 사진 비교 보조 판독 (Claude Vision) - 철근 배근, 거푸집 치수 1차 분석 설계도서 파싱: - PDF 이미지/텍스트에서 공종·수량·규격 자동 추출 - Pandoc HWP 출력 지원 발주처 전용 포털: - 토큰 기반 읽기 전용 API - 공사 현황 대시보드, 공정률 추이 차트 에이전트 협업 고도화: - 협업 시나리오 (concrete_pour, excavation, weekly_report) - GONGSA→PUMJIL→ANJEON 순차 처리 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
69 lines
2.3 KiB
Python
69 lines
2.3 KiB
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from contextlib import asynccontextmanager
|
|
from app.config import settings
|
|
from app.api import (
|
|
auth, projects, tasks, daily_reports, reports, inspections,
|
|
weather, rag, kakao, permits, quality, settings as settings_router,
|
|
agents, evms, vision, geofence, completion, documents, portal,
|
|
)
|
|
from app.services.scheduler import start_scheduler, stop_scheduler
|
|
|
|
|
|
@asynccontextmanager
|
|
async def lifespan(app: FastAPI):
|
|
# Startup
|
|
start_scheduler()
|
|
yield
|
|
# Shutdown
|
|
stop_scheduler()
|
|
|
|
|
|
def create_app() -> FastAPI:
|
|
app = FastAPI(
|
|
title="CONAI API",
|
|
description="소형 건설업체를 위한 AI 기반 토목공사 통합관리 플랫폼",
|
|
version=settings.APP_VERSION,
|
|
lifespan=lifespan,
|
|
)
|
|
|
|
# CORS
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.CORS_ORIGINS,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
# API routers
|
|
api_prefix = "/api/v1"
|
|
app.include_router(auth.router, prefix=api_prefix)
|
|
app.include_router(projects.router, prefix=api_prefix)
|
|
app.include_router(tasks.router, prefix=api_prefix)
|
|
app.include_router(daily_reports.router, prefix=api_prefix)
|
|
app.include_router(reports.router, prefix=api_prefix)
|
|
app.include_router(inspections.router, prefix=api_prefix)
|
|
app.include_router(weather.router, prefix=api_prefix)
|
|
app.include_router(rag.router, prefix=api_prefix)
|
|
app.include_router(kakao.router, prefix=api_prefix)
|
|
app.include_router(permits.router, prefix=api_prefix)
|
|
app.include_router(quality.router, prefix=api_prefix)
|
|
app.include_router(agents.router, prefix=api_prefix)
|
|
app.include_router(evms.router, prefix=api_prefix)
|
|
app.include_router(vision.router, prefix=api_prefix)
|
|
app.include_router(geofence.router, prefix=api_prefix)
|
|
app.include_router(completion.router, prefix=api_prefix)
|
|
app.include_router(documents.router, prefix=api_prefix)
|
|
app.include_router(portal.router, prefix=api_prefix)
|
|
app.include_router(settings_router.router, prefix=api_prefix)
|
|
|
|
@app.get("/health")
|
|
async def health():
|
|
return {"status": "ok", "version": settings.APP_VERSION}
|
|
|
|
return app
|
|
|
|
|
|
app = create_app()
|