33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from ...core.database import get_db
|
|
from ...core.response import success_response
|
|
from ...dependencies import get_current_user, require_platform_ai_ops
|
|
from ...models import User
|
|
from ...services.ai_readiness_service import AIReadinessService
|
|
|
|
router = APIRouter(prefix="/ai-readiness", tags=["ai-readiness"])
|
|
|
|
|
|
@router.get("/project-launch")
|
|
async def get_project_launch_ai_readiness(
|
|
db: AsyncSession = Depends(get_db),
|
|
current_user: User = Depends(get_current_user),
|
|
):
|
|
payload = await AIReadinessService(db, tenant_id=int(current_user.tenant_id)).get_project_launch_readiness()
|
|
return success_response(payload)
|
|
|
|
|
|
@router.post("/project-launch/check")
|
|
async def run_project_launch_ai_readiness_check(
|
|
db: AsyncSession = Depends(get_db),
|
|
current_user: User = Depends(require_platform_ai_ops),
|
|
):
|
|
payload = await AIReadinessService(db, tenant_id=int(current_user.tenant_id)).run_project_launch_check(
|
|
user_id=int(current_user.id),
|
|
)
|
|
return success_response(payload)
|