import service from '@/utils/service'

const baseUrl = process.env.VUE_APP_HOST + '/manager/api/vip'

const vipApi = {}

vipApi.baseUrl = baseUrl

vipApi.getVipList = params => {
  return service({
    url: `${baseUrl}/v1/statistics`,
    method: 'get',
    params: params
  })
}

vipApi.getSelectOptions = () => {
  return service({
    url: `${baseUrl}/v1/select`,
    method: 'get'
  })
}

vipApi.addVip = data => {
  return service({
    url: `${baseUrl}/v1`,
    method: 'post',
    data: data
  })
}

vipApi.updateVip = data => {
  return service({
    url: `${baseUrl}/v1`,
    method: 'put',
    data: data
  })
}

vipApi.getById = id => {
  return service({
    url: `${baseUrl}/v1/${id}`,
    method: 'get'
  })
}

export default vipApi
