import request from '@/config/axios'

export const getVipDiscountList = async (params) => {
  return await request.get({
    url: '/admin-api/applet/xunjia/member/discount/list',
    params: params
  })
}

export const addVipDiscount = async (data) => {
  return await request.post({
    url: '/admin-api/applet/xunjia/member/discount/add',
    data
  })
}

export const updateVipDiscount = async (data) => {
  return await request.post({
    url: '/admin-api/applet/xunjia/member/discount/update',
    data
  })
}

export const deleteVipDiscount = async (id) => {
  return await request.delete({
    url: '/admin-api/applet/xunjia/member/discount/delete?discountId=' + id
  })
}

export const getVipDiscountOptions = async () => {
  return await request.get({
    url: '/admin-api/applet/xunjia/member/discount/simple-list'
  })
}

export const getUserDiscountList = async (params) => {
  return await request.get({
    url: '/admin-api/applet/xunjia/user/discount/list',
    params: params
  })
}

export const giveUserDiscount = async (data) => {
  return await request.post({
    url: '/admin-api/applet/xunjia/user/discount/send',
    data
  })
}
