/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import { CustomRequestOptions } from '@/http/types';

import * as API from './types';

/** 健康检查 检查API服务的健康状态 GET /system/health */
export async function systemHealthUsingGet({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: {
        status?: string;
        timestamp?: number;
        uptime?: string;
      };
    }
  >('/system/health', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 系统信息 获取系统基本信息和Redis缓存信息 GET /system/info */
export async function systemInfoUsingGet({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: {
        architecture?: string;
        cache?: Record<string, unknown>;
        environment?: string;
        framework?: string;
        name?: string;
        timestamp?: number;
        version?: string;
      };
    }
  >('/system/info', {
    method: 'GET',
    ...(options || {}),
  });
}

/** Redis缓存信息 获取Redis缓存的详细信息 GET /system/redis */
export async function systemRedisUsingGet({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: {
        connected_clients?: number;
        hit_rate?: number;
        keyspace?: Record<string, unknown>;
        memory_usage?: number;
        top_keys?: unknown[];
        total_keys?: number;
        uptime?: number;
      };
    }
  >('/system/redis', {
    method: 'GET',
    ...(options || {}),
  });
}

/** Redis详细信息 获取Redis的完整详细信息 GET /system/redis/detail */
export async function systemRedisDetailUsingGet({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: {
        connected_clients?: number;
        hit_rate?: number;
        keyspace?: Record<string, unknown>;
        memory?: Record<string, unknown>;
        server?: Record<string, unknown>;
        stats?: Record<string, unknown>;
        total_keys?: number;
        uptime?: number;
        used_memory?: number;
      };
    }
  >('/system/redis/detail', {
    method: 'GET',
    ...(options || {}),
  });
}
