import request from '@/utils/request'

// 查询停车区列表
export function listParking(query) {
  return request({
    url: '/system/parking/list',
    method: 'get',
    params: query
  })
}

// 查询停车区详细
export function getParking(parkingId) {
  return request({
    url: '/system/parking/' + parkingId,
    method: 'get'
  })
}

// 新增停车区
export function addParking(data) {
  return request({
    url: '/system/parking',
    method: 'post',
    data: data
  })
}

// 修改停车区
export function updateParking(data) {
  return request({
    url: '/system/parking',
    method: 'put',
    data: data
  })
}

// 删除停车区
export function delParking(parkingId) {
  return request({
    url: '/system/parking/' + parkingId,
    method: 'delete'
  })
}

// 停车区状态修改
export function changeParkingStatus(parkingId, status) {
  const data = {
    parkingId,
    status
  }
  return request({
    url: '/system/parking/changeParkingStatus',
    method: 'put',
    data: data
  })
}

