import api from './request'

// 获取仪表盘概览数据
export const getDashboardOverview = () => {
  return api.get('/dashboard/overview')
}

// 获取月度收入趋势数据
export const getMonthlyRevenue = (year = '2024') => {
  return api.get('/dashboard/monthly-revenue', { 
    params: { year } 
  })
}

// 获取用户转化率数据
export const getConversionRate = (year = null) => {
  const params = year ? { year } : {}
  return api.get('/dashboard/conversion-rate', { params })
}

// 获取最近订单数据
export const getRecentOrders = (limit = 10) => {
  return api.get('/dashboard/recent-orders', { 
    params: { limit } 
  })
}

// 获取系统状态
export const getSystemStatus = () => {
  return api.get('/dashboard/system-status')
}

// 获取日活用户趋势数据
export const getDailyActiveUsersTrend = (year = '2024', granularity = 'monthly') => {
  return api.get('/analytics/daily-active-users', { 
    params: { year, granularity } 
  })
}