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

const prefix = 'role-quick-nav/';
/**
 * 分页查询快捷导航列表
 * @param data
 */
export async function getRoleQuickNavList(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

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

/**
 * 新增快捷导航
 * @param data
 */
export async function createRoleQuickNav(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑快捷导航
 * @param data
 */
export async function updateRoleQuickNav(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除快捷导航
 * @param data
 */
export async function deleteRoleQuickNav(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}

/**
 * 根据角色ID获取快捷导航
 * @param roleId
 */
export async function getRoleQuickNavByRoleId(roleId: number) {
  return requestClient.get<any>(`${prefix}get-by-role-id`, { params: { role_id: roleId } });
}

/**
 * 批量保存快捷导航
 * @param data
 */
export async function batchSaveRoleQuickNav(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}batch-save`, data);
}
