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

const prefix = 'home-zone/';

/**
 * 分页查询专区列表
 * @param data
 */
export async function getHomeZonesList(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

/**
 * 获取专区下拉列表
 * @param data
 */
export async function getHomeZonesOption(data?: any) {
  return requestClient.get<any>(`${prefix}option`, { params: data });
}

/**
 * 获取专区详情
 * @param id
 */
export async function getHomeZonesInfo(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 新增专区
 * @param data
 */
export async function createHomeZones(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑专区
 * @param data
 */
export async function updateHomeZones(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除专区
 * @param data
 */
export async function deleteHomeZones(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}

/**
 * 更新专区排序
 * @param data
 */
export async function updateHomeZonesSortOrder(data: { ids: (string | number)[] }) {
  return requestClient.post<any>(`${prefix}update-sort-order`, data);
}

