/**
 * @description 统计相关API
 * @author yslg
 * @since 2025-10-15
 */

import { api } from '@/apis/index';
import type { ResultDomain } from '@/types';

/**
 * 统计API服务
 */
export const statisticsApi = {
  /**
   * 获取首页统计数据
   * @returns Promise<ResultDomain<any>>
   */
  async getHomePageStatistics(): Promise<ResultDomain<any>> {
    const response = await api.get<any>('/homepage/statistics');
    return response.data;
  },

  /**
   * 获取今日访问量
   * @returns Promise<ResultDomain<any>>
   */
  async getTodayVisits(): Promise<ResultDomain<any>> {
    const response = await api.get<any>('/homepage/statistics/today-visits');
    return response.data;
  },

  /**
   * 获取资源总数
   * @returns Promise<ResultDomain<any>>
   */
  async getTotalResources(): Promise<ResultDomain<any>> {
    const response = await api.get<any>('/homepage/statistics/total-resources');
    return response.data;
  }
};
