import request from '@/utils/request'

export function listModuleUsage(query) {
  return request({ url: '/admin/module-usage/list', method: 'get', params: query })
}

export function listModuleUsageSummary(query) {
  return request({ url: '/admin/module-usage/summary', method: 'get', params: query })
}

export function getProxyDetail(proxyId, statDate) {
  return request({ url: `/admin/module-usage/proxy/${proxyId}`, method: 'get', params: { statDate } })
}

export function getTenantDetail(tenantId) {
  return request({ url: `/admin/module-usage/tenant/${tenantId}`, method: 'get' })
}

export function refreshStatistics() {
  return request({ url: '/admin/module-usage/refresh', method: 'post' })
}

export function refreshTenantStatistics(tenantId) {
  return request({ url: `/admin/module-usage/refresh/${tenantId}`, method: 'post' })
}

export function exportModuleUsage(query) {
  return request({ url: '/admin/module-usage/export', method: 'get', params: query })
}
