import request from '@/utils/request'

request.defaults.baseURL = '/ezhizao-yzbh-crm'

// 查询回收站列表
export function listBin(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/bin/list',
    method: 'get',
    params: query
  })
}

// 查询回收站详细
export function getBin(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/bin/' + id,
    method: 'get'
  })
}

// 新增回收站
export function addBin(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/bin/' + id,
    method: 'post',
  })
}

// 修改回收站
export function updateBin(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/bin',
    method: 'put',
    data: data
  })
}

// 删除回收站
export function delBin(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/bin/' + id,
    method: 'delete'
  })
}

// 还原回收站
export function restoreBin(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/bin/restore/' + id,
    method: 'post'
  })
}

// 还原回收站
export function restoreArchiveBin(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/bin/restoreArchive/' + id,
    method: 'post'
  })
}




