import { axios } from '@/utils/request'

const api = {
  visitorPerson: '/meeting/visitorPerson'
}

export function getVisitorPersonList(parameter) {
  return axios({
    url: api.visitorPerson + '/list',
    method: 'get',
    params: parameter
  })
}


export function getVisitorPersonId(id) {
  return axios({
    url: api.visitorPerson + '/get/' + id,
    method: 'get',
    params: {}
  })
}

export function getRecordByReservationId(id) {
  return axios({
    url: api.visitorPerson + '/getRecordByReservationId/' + id,
    method: 'get',
    params: {}
  })
}


export function saveVisitorPerson(parameter) {
  return axios({
    url: api.visitorPerson + (parameter.id > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delVisitorPerson(parameter) {
  return axios({
    url: api.visitorPerson + '/remove',
    method: 'post',
    params: parameter
  })
}


export function selectUserByCustomer(id) {
  return axios({
    url: api.visitorPerson + '/selectUserByCustomer/' + id,
    method: 'get',
    params: {}
  })
}

export function selectCustomer (parameter) {
  return axios({
    url: api.visitorPerson + '/selectCustomer',
    method: 'get',
    params: parameter
  })
}


export const visitorPersonExport = api.visitorPerson + '/export'
