import request from '@/utils/request';

/** 收货地址列表 */
export function listShopUserAddress(params?: any) {
  return request.get('/shop/shop-user-address', params);
}

/** 获取收货地址详情 */
export function getShopUserAddress(id: number) {
  return request.get(`/shop/shop-user-address/${id}`);
}

/** 添加收货地址 */
export function addShopUserAddress(data: any) {
  return request.post('/shop/shop-user-address', data);
}

/** 更新收货地址 */
export function updateShopUserAddress(data: any) {
  return request.put('/shop/shop-user-address', data);
}

/** 删除收货地址 */
export function removeShopUserAddress(id: number) {
  return request.delete(`/shop/shop-user-address/${id}`);
}

/** 批量删除收货地址 */
export function removeBatchShopUserAddress(ids: number[]) {
  return request.post('/shop/shop-user-address/batch-delete', { ids });
}

/** 设置默认收货地址 */
export function setDefaultAddress(id: number) {
  return request.put(`/shop/shop-user-address/set-default/${id}`);
}

/** 获取默认收货地址 */
export function getDefaultAddress() {
  return request.get('/shop/shop-user-address/default');
}
