import request from '../utils/request'

const api = {
  Order: '/Kefu/Order',
  OrderDetail: '/Kefu/OrderDetail',
  AdminOrder: '/Admin/Kefu/Order',
  AdminOrderDetail: '/Admin/Kefu/OrderDetail',
}

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

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

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

export function adminReplyOrder(parameter) {
  return request({
    url: api.AdminOrder,
    method: 'put',
    data: parameter
  })
}

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

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

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