import request from '@/utils/request'

// 平台总览
export function getOverview() {
  return request({ url: '/admin/statistics/overview', method: 'get' })
}

// 代理分佣统计
export function getProxyProfitStatistics(params) {
  return request({ url: '/admin/statistics/proxyProfit', method: 'get', params })
}

// 代理分佣详情
export function getProxyProfitDetail(proxyId, params) {
  return request({ url: `/admin/statistics/proxyProfit/${proxyId}`, method: 'get', params })
}

// 租户消费统计
export function getTenantConsumeStatistics(params) {
  return request({ url: '/admin/statistics/tenantConsume', method: 'get', params })
}

// 租户消费详情
export function getTenantDetail(tenantId, params) {
  return request({ url: `/admin/statistics/tenantDetail/${tenantId}`, method: 'get', params })
}

// 消费类型统计
export function getConsumeTypeStatistics(params) {
  return request({ url: '/admin/statistics/consumeType', method: 'get', params })
}

// 平台成本汇总
export function getCostSummary(params) {
  return request({ url: '/admin/statistics/costSummary', method: 'get', params })
}

// 平台趋势
export function getPlatformTrend(params) {
  return request({ url: '/admin/statistics/trend', method: 'get', params })
}

// 小时统计
export function getHourlyStatistics(statDate, dimension) {
  return request({ url: '/admin/statistics/hourly', method: 'get', params: { statDate, dimension } })
}

// 服务成本配置
export function getCostConfigList() {
  return request({ url: '/admin/statistics/costConfig', method: 'get' })
}

// 原始消费记录
export function getConsumeRecords(params) {
  return request({ url: '/admin/statistics/consumeRecords', method: 'get', params })
}

// 手动执行统计
export function executeStatistics(type) {
  return request({ url: '/admin/statistics/execute', method: 'post', params: { type } })
}