import request from '@/utils/request'

// ======== 服务成本配置 ========

export function listServiceCost() {
  return request({ url: '/admin/serviceCost/list', method: 'get' })
}

export function getServiceCostByType(serviceType) {
  return request({ url: `/admin/serviceCost/${serviceType}`, method: 'get' })
}

export function updateServiceCost(data) {
  return request({ url: '/admin/serviceCost', method: 'put', data })
}

export function getEnabledServiceTypes() {
  return request({ url: '/admin/serviceCost/enabled', method: 'get' })
}

// ======== 代理定价 ========

export function listServicePrice(query) {
  return request({ url: '/admin/servicePrice/list', method: 'get', params: query })
}

export function batchSaveServicePrice(data) {
  return request({ url: '/admin/servicePrice/batch', method: 'post', data })
}

// 代理定价批量保存（代理端接口）
export function batchSaveProxyServicePrice(data) {
  return request({ url: '/proxy/servicePrice/batch', method: 'put', data })
}
