/**
 * 系统管理 API 接口
 *
 * @module api/system
 * @author czj
 * @date 2026-07-29
 */

import request from '@/utils/request'

/** 系统信息响应结构 */
export interface SystemInfo {
  app_name: string
  backend_version: string
  python_version: string
  platform: string
  os: string
  uptime_seconds: number
  uptime_text: string
  db_type: string
  db_size_mb: number
  total_modules: number
  total_cases: number
  debug: boolean
  playwright_headless: boolean
  frontend_version: string
}

/**
 * 系统管理 API 服务
 */
export const systemApi = {
  /**
   * 获取系统运行信息
   */
  async getInfo(): Promise<SystemInfo> {
    const response = await request.get('/api/system/info')
    return response as any
  },
}
