import { http } from "@/utils/http";

/** 角色列表 */
export const getRoleList = (params?: { roleName?: string }) => {
  return http.request<any>("get", "/role/list", { params });
};

/** 新增角色 */
export const addRole = (data: object) => {
  return http.request<any>("post", "/role/add", { data });
};

/** 修改角色 */
export const modifyRole = (data: object) => {
  return http.request<any>("post", "/role/modify", { data });
};

/** 删除角色 */
export const deleteRole = (id: number) => {
  return http.request<any>("post", `/role/delete/${id}`);
};

/** 角色详情 */
export const getRoleDetail = (id: number) => {
  return http.request<any>("get", `/role/detail/${id}`);
};

/** 批量保存角色 */
export const saveRoleList = (data: Array<object>) => {
  return http.request<any>("post", "/role/saveList", { data });
};
