import request from '@/utils/request'

const database =(data)=>{
  return request({
      url:`/realtimeDatabaseConfiguration/listByPage?name=${encodeURIComponent(data.name)}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
      method:"get"
  })
}
const addDatabase =(pairs)=>{
  return request({
      url:`/realtimeDatabaseConfiguration/save`,
      method:"post",
      data: pairs
  })
}
const deleteDatabase =(data)=>{
  return request({
      url:`/realtimeDatabaseConfiguration/remove-modelpower?ids=${data.id}`,
      method:"delete",
  })
}

// 设备厂商
const manufacturer =(data)=>{
  return request({
      url:`/manufacturer/listByPage?name=${encodeURIComponent(data.name)}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
      method:"get"
  })
}
const addManufacturer =(pairs)=>{
  return request({
      url:`/manufacturer/save`,
      method:"post",
      data: pairs
  })
}
const deleteManufacturer =(data)=>{
  return request({
      url:`/manufacturer/remove-manufacturer?ids=${data.id}`,
      method:"delete",
  })
}

// 设备类型
const modelpower =(data)=>{
  return request({
      url:`/modelpower/listByPage?modelid=${data.modelid}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
      method:"get"
  })
}
const addModelpower =(pairs)=>{
  return request({
      url:`/modelpower/save`,
      method:"post",
      data: pairs
  })
}
const deleteModelpower =(data)=>{
  return request({
      url:`/modelpower/remove-modelpower/${data.id}`,
      method:"delete",
  })
}

// 变电所
const windsubstation =(data)=>{
  return request({
      url:`/windsubstation/listByPage?name=${encodeURIComponent(data.name)}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
      method:"get"
  })
}
const addWindsubstation =(pairs)=>{
  return request({
      url:`/windsubstation/save`,
      method:"post",
      data: pairs
  })
}
const deleteWindsubstation =(data)=>{
  return request({
      url:`/windsubstation/remove-windsub/${data.id}`,
      method:"delete",
  })
}

export default {
	database,
	addDatabase,
	deleteDatabase,
	addManufacturer,
	addModelpower,
	addWindsubstation,
	manufacturer,
	modelpower,
	windsubstation,
	deleteManufacturer,
	deleteModelpower,
	deleteWindsubstation,
}