import { requestClient } from '#/api/request';

const prefix = 'user-receiving-address/';
/**
 * 分页查询用户收货地址列表
 * @param data
 */
export async function getUserReceivingAddressListApi(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

/**
 * 获取用户收货地址下拉列表
 */
export async function getUserReceivingAddressOptionApi() {
  return requestClient.get<any>(`${prefix}option`);
}

/**
 * 获取用户收货地址详情
 * @param id
 */
export async function getUserReceivingAddressInfoApi(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 新增用户收货地址
 * @param data
 */
export async function createUserReceivingAddressApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑用户收货地址
 * @param data
 */
export async function updateUserReceivingAddressApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除用户收货地址
 * @param data
 */
export async function deleteUserReceivingAddressApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}
