import { type NextRequest, NextResponse } from "next/server"
import { getMindsDBConnector } from "@/lib/mindsdb-connector"

export async function GET(request: NextRequest) {
  try {
    const mindsDB = getMindsDBConnector()
    const status = await mindsDB.getSystemStatus()

    return NextResponse.json({
      success: true,
      status,
      timestamp: new Date().toISOString(),
    })
  } catch (error) {
    console.error("系统状态API错误:", error)
    return NextResponse.json({ error: "获取系统状态失败" }, { status: 500 })
  }
}
