import request from '@/utils/request';

/** 获取可用权益包列表 */
export function getBenefitPackageList() {
  return request.get('/shop/shop-member-benefit-package/list');
}

/** 获取权益包详情 */
export function getBenefitPackageDetail(id: number) {
  return request.get(`/shop/shop-member-benefit-package/${id}`);
}

/** 申请兑换 */
export function exchangeBenefitPackage(data: {
  packageId: number;
  addressId?: number;
}) {
  return request.post('/shop/shop-member-benefit-exchange/exchange', data);
}

/** 我的兑换记录 */
export function getMyExchangeList(params?: any) {
  return request.get('/shop/shop-member-benefit-exchange/my/list', params);
}

/** 取消兑换 */
export function cancelExchange(id: number) {
  return request.post(`/shop/shop-member-benefit-exchange/cancel/${id}`);
}
