import request from '@/utils/request'

// ======== 管理端专用接口（跨租户） ========

// 获取所有租户列表（下拉选择用）
export function listAllCompanies() {
  return request({
    url: '/workflow/lobster-admin/companies',
    method: 'get'
  })
}

// 获取租户工作流统计
export function getCompanyWorkflowStats(companyId) {
  return request({
    url: '/workflow/lobster-admin/company-stats/' + companyId,
    method: 'get'
  })
}

// 获取全平台工作流统计
export function getPlatformStats() {
  return request({
    url: '/workflow/lobster-admin/platform-stats',
    method: 'get'
  })
}

// 跨租户查询工作流实例
export function adminListInstances(params) {
  return request({
    url: '/workflow/lobster-admin/instances',
    method: 'get',
    params
  })
}

// 跨租户查询提示词
export function adminListPrompts(params) {
  return request({
    url: '/workflow/lobster-admin/prompts',
    method: 'get',
    params
  })
}

// 跨租户查询死信队列
export function adminListDeadLetters(params) {
  return request({
    url: '/workflow/lobster-admin/dead-letters',
    method: 'get',
    params
  })
}

// 跨租户查询节点审核
export function adminListEventAudits(params) {
  return request({
    url: '/workflow/lobster-admin/event-audits',
    method: 'get',
    params
  })
}

// 跨租户查询优化建议
export function adminListOptimizations(params) {
  return request({
    url: '/workflow/lobster-admin/optimizations',
    method: 'get',
    params
  })
}

// 跨租户查询计费记录
export function adminListBillingRecords(params) {
  return request({
    url: '/workflow/lobster-admin/billing-records',
    method: 'get',
    params
  })
}

// 跨租户查询语料
export function adminListSalesCorpus(params) {
  return request({
    url: '/workflow/lobster-admin/sales-corpus',
    method: 'get',
    params
  })
}

// 跨租户查询API注册
export function adminListApiRegistry(params) {
  return request({
    url: '/workflow/lobster-admin/api-registry',
    method: 'get',
    params
  })
}

// 跨租户查询聚合聊天
export function adminListChatAggregate(params) {
  return request({
    url: '/workflow/lobster-admin/chat-aggregate',
    method: 'get',
    params
  })
}
