import request from '@/utils/request'

// 查询中介黑名单列表
export function listIntermediary(query) {
  return request({
    url: '/dpc/intermediary/list',
    method: 'get',
    params: query
  })
}

// 查询中介黑名单详细
export function getIntermediary(intermediaryId) {
  return request({
    url: '/dpc/intermediary/' + intermediaryId,
    method: 'get'
  })
}

// 新增中介黑名单
export function addIntermediary(data) {
  return request({
    url: '/dpc/intermediary',
    method: 'post',
    data: data
  })
}

// 修改中介黑名单
export function updateIntermediary(data) {
  return request({
    url: '/dpc/intermediary',
    method: 'put',
    data: data
  })
}

// 删除中介黑名单
export function delIntermediary(intermediaryIds) {
  return request({
    url: '/dpc/intermediary/' + intermediaryIds,
    method: 'delete'
  })
}

// 导出中介黑名单
export function exportIntermediary(query) {
  return request({
    url: '/dpc/intermediary/export',
    method: 'post',
    params: query
  })
}

// 下载导入模板
export function importTemplate() {
  return request({
    url: '/dpc/intermediary/importTemplate',
    method: 'post'
  })
}

// 导入中介黑名单
export function importData(data, updateSupport) {
  return request({
    url: '/dpc/intermediary/importData?updateSupport=' + updateSupport,
    method: 'post',
    data: data
  })
}
