import request from '@/utils/request'

// 查询会员码列表
export function listVipCode(query) {
  return request({
    url: '/mall/vipCode/list',
    method: 'get',
    params: query
  })
}

// 查询会员码详细
export function getVipCode(codeId) {
  return request({
    url: '/mall/vipCode/' + codeId,
    method: 'get'
  })
}

// 新增会员码
export function addVipCode(data) {
  return request({
    url: '/mall/vipCode',
    method: 'post',
    data: data
  })
}
// 新增会员码
export function createVipCode(data) {
  return request({
    url: '/mall/vipCode/createVipCode',
    method: 'post',
    timeout: null,
    data: data
  })
}

// 修改会员码
export function updateVipCode(data) {
  return request({
    url: '/mall/vipCode',
    method: 'put',
    data: data
  })
}

// 删除会员码
export function delVipCode(codeId) {
  return request({
    url: '/mall/vipCode/' + codeId,
    method: 'delete'
  })
}
