import http from '@/utils/request'

export function addTicketPrintModel ({ content, name, ticket_type_id_list }) {
  return http.post('/ticketPrintModel/addTicketPrintModel', {
    name,
    content,
    ticket_type_id_list
  })
}

export function deleteTicketPrintModel (id) {
  return http.post('/ticketPrintModel/deleteTicketPrintModel', {
    id
  })
}

export function getTicketPrintModelList () {
  return http.post('/ticketPrintModel/getTicketPrintModelList', { pageSize: 0, pageNum: 0 })
}

export function updateTicketPrintModel ({ id, name, content, ticket_type_id_list }) {
  return http.post('/ticketPrintModel/updateTicketPrintModel', {
    id,
    name,
    content,
    is_in_use: 0,
    ticket_type_id_list
  })
}
export function secondPrintTicket (list) {
  return http.post('/order/secondPrintTicket',
    list
  )
}

/* -------------------------------------小票打印接口------------------------------- */
export function addReceiptPrintModel ({ content, name, is_in_use = 1 }) {
  return http.post('/receiptPrintModel/add', {
    name,
    content,
    is_in_use
  })
}

export function deleteReceiptPrintModel (id) {
  return http.post('/receiptPrintModel/delete', {
    id
  })
}

export function updateReceiptPrintModel (params) {
  return http.post('/receiptPrintModel/update', params)
}

export function getReceiptPrintModel (id) {
  return http.post('/receiptPrintModel/list', {
    keyWords1: '',
    keyWords2: '',
    pageSize: 0,
    pageNum: 0
  })
}
