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

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

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

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

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



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

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

export const ticketExport = api.ticket + '/export'
