import request from '@/utils/request'

export function listSection(query) {
  return request({
    url: '/berthing/queryBerthing',
    method: 'post',
    data: query
  })
}

export function getSection(id) {
  return request({
    url: `/berthing/${id}`,
    method: 'get'
  })
}

export function getSiteSection(siteId) {
  return request({
    url: `/berthing/site/${siteId}`,
    method: 'get'
  })
}

export function uploadSection(formData) {
  return request({
    url: '/berthing/uploadFile',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}

export function addSection(data) {
  return request({
    url: '/berthing/insertBerthing',
    method: 'post',
    data: data
  })
}

export function deleteSection(id) {
  return request({
    url: `/berthing/${id}`,
    method: 'delete',
  })
}

export function getPlainPoint(id) {
  return request({
    url: `/berthing/stopPoint/${id}`,
    method: 'get'
  })
}

export function listPlainPoint(query) {
  return request({
    url: '/berthing/queryStopPrint',
    method: 'post',
    data: query
  })
}

export function savePlainPoint(data) {
  return request({
    url: '/berthing/addStopPrint',
    method: 'post',
    data: data
  })
}

export function deletePlainPoint(id) {
  return request({
    url: `/berthing/stopPoint/${id}`,
    method: 'delete',
  })
}

export function getPlainTime(id) {
  return request({
    url: `/berthing/stopTime/${id}`,
    method: 'get'
  })
}

export function listPlainTime(query) {
  return request({
    url: '/berthing/queryTimePrint',
    method: 'post',
    data: query
  })
}

export function savePlainTime(data) {
  return request({
    url: '/berthing/addTimePrint',
    method: 'post',
    data: data
  })
}

export function deletePlainTime(id) {
  return request({
    url: `/berthing/stopTime/${id}`,
    method: 'delete',
  })
}

export function getPlainWater(id) {
  return request({
    url: `/berthing/stopWater/${id}`,
    method: 'get'
  })
}

export function listPlainWater(query) {
  return request({
    url: '/berthing/queryFloatPrint',
    method: 'post',
    data: query
  })
}

export function savePlainWater(data) {
  return request({
    url: '/berthing/addFloatPrint',
    method: 'post',
    data: data
  })
}

export function deletePlainWater(id) {
  return request({
    url: `/berthing/stopWater/${id}`,
    method: 'delete',
  })
}
