import request from '@/utils/request'

// 创建黑名单
export function createBlacklist(data) {
  return request({
    url: '/system/blacklist/create',
    method: 'post',
    data: data
  })
}

// 更新黑名单
export function updateBlacklist(data) {
  return request({
    url: '/system/blacklist/update',
    method: 'put',
    data: data
  })
}

// 删除黑名单
export function deleteBlacklist(id) {
  return request({
    url: '/system/blacklist/delete?id=' + id,
    method: 'delete'
  })
}

// 获得黑名单
export function getBlacklist(id) {
  return request({
    url: '/system/blacklist/get?id=' + id,
    method: 'get'
  })
}

// 获得黑名单分页
export function getBlacklistPage(query) {
  return request({
    url: '/system/blacklist/page',
    method: 'get',
    params: query
  })
}

// 导出黑名单 Excel
export function exportBlacklistExcel(query) {
  return request({
    url: '/system/blacklist/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
