import request from '../utils/request'

const api = {
  getSeatMenu: '/IC/GetSeatMenu',
  getSeatInfo: '/IC/GetSeatInfo',
  seat: '/IC/Seat',
  endAhead: '/IC/Seat/EndAhead',
  star: '/IC/Star',
  starGroup: '/IC/StarGroup',
  rule: '/IC/Rule',
  myOrder: '/IC/Seat/MyOrder',
  orderHistory: '/IC/OrderHistory'
}

export function getSeatMenu(parameter) {
  return request({ url: api.getSeatMenu, method: 'get', params: parameter })
}

export function getSeatInfo(parameter) {
  return request({ url: api.getSeatInfo, method: 'get', params: parameter })
}

export function orderSeat(parameter) {
  return request({ url: api.seat, method: 'post', data: parameter })
}

export function myOrder(parameter) {
  return request({ url: api.myOrder, method: 'post', data: parameter })
}

export function deleteSeat(parameter) {
  return request({ url: api.seat, method: 'delete', data: parameter })
}

export function endAhead(parameter) {
  return request({ url: api.endAhead, method: 'post', data: parameter })
}

export function getStar() {
  return request({ url: api.star, method: 'get' })
}

export function saveStar(parameter) {
  return request({ url: api.star, method: 'post', data: parameter })
}

export function deleteStar(parameter) {
  return request({ url: api.star, method: 'delete', data: parameter })
}

export function getStarGroup() {
  return request({ url: api.starGroup, method: 'get' })
}

export function saveStarGroup(parameter) {
  return request({ url: api.starGroup, method: 'post', data: parameter })
}

export function deleteStarGroup(parameter) {
  return request({ url: api.starGroup, method: 'delete', data: parameter })
}

export function getRule() {
  return request({ url: api.rule, method: 'get' })
}

export function saveRule(parameter) {
  return request({ url: api.rule, method: 'post', data: parameter })
}

export function deleteRule(parameter) {
  return request({ url: api.rule, method: 'delete', data: parameter })
}

export function getOrderHistory() {
  return request({ url: api.orderHistory, method: 'get' })
}
