import request from '@/utils/request'

export function getEnterpriseList(query) {
  return request({
    url: '/crm/enterprise/',
    method: 'get',
    params: query
  })
}
export function getEnterprise(id) {
  return request({
    url: `/crm/enterprise/${id}/`,
    method: 'get'
  })
}
export function createEnterprise(data) {
  return request({
    url: '/crm/enterprise/',
    method: 'post',
    data
  })
}

export function updateEnterprise(id, data) {
  return request({
    url: `/crm/enterprise/${id}/`,
    method: 'put',
    data
  })
}

export function deleteEnterprise(id) {
  return request({
    url: `/crm/enterprise/${id}/`,
    method: 'delete'
  })
}

export function getAddressList(query) {
  return request({
    url: '/crm/enterpriseaddress/',
    method: 'get',
    params: query
  })
}

export function createAddress(data) {
  return request({
    url: '/crm/enterpriseaddress/',
    method: 'post',
    data
  })
}

export function updateAddress(id, data) {
  return request({
    url: `/crm/enterpriseaddress/${id}/`,
    method: 'put',
    data
  })
}

export function deleteAddress(id) {
  return request({
    url: `/crm/enterpriseaddress/${id}/`,
    method: 'delete'
  })
}
