import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/goldenwater";

export function listCompany(query) {
  return request({ url: '/pms/company/list', method: 'get', params: query })
}

export function getCompany(id) {
  return request({ url: '/pms/company/' + parseStrEmpty(id), method: 'get' })
}

export function addCompany(data) {
  return request({ url: '/pms/company', method: 'post', data: data })
}

export function updateCompany(data) {
  return request({ url: '/pms/company', method: 'put', data: data })
}

export function delCompany(id) {
  return request({ url: '/pms/company/' + id, method: 'delete' })
}

export function listContact(query) {
  return request({ url: '/pms/contact/list', method: 'get', params: query })
}

export function getContact(id) {
  return request({ url: '/pms/contact/' + parseStrEmpty(id), method: 'get' })
}

export function addContact(data) {
  return request({ url: '/pms/contact', method: 'post', data: data })
}

export function updateContact(data) {
  return request({ url: '/pms/contact', method: 'put', data: data })
}

export function delContact(id) {
  return request({ url: '/pms/contact/' + id, method: 'delete' })
}
