import request from '@/utils/request'

// 查询接口配置列表
export function listApiConfig(query) {
  return request({
    url: '/v1/system/apiConfig/list',
    method: 'get',
    params: query
  })
}

// 查询接口配置详细
export function getApiConfig(id) {
  return request({
    url: '/v1/system/apiConfig/' + id,
    method: 'get'
  })
}

// 新增接口配置
export function addApiConfig(data) {
  return request({
    url: '/v1/system/apiConfig',
    method: 'post',
    data: data
  })
}

// 修改接口配置
export function updateApiConfig(data) {
  return request({
    url: '/v1/system/apiConfig',
    method: 'put',
    data: data
  })
}

// 删除接口配置
export function delApiConfig(id) {
  return request({
    url: '/v1/system/apiConfig/' + id,
    method: 'delete'
  })
}

// 导出接口配置
export function exportApiConfig(query) {
  return request({
    url: '/v1/system/apiConfig/export',
    method: 'get',
    params: query
  })
}

// 接口测试
export function apiDebug(routePath, data) {
  return request({
    url: '/v1/api/common/' + routePath,
    method: 'post',
    data: data
  })
}
