import { ResPage, Role } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";
/**
 * @name 角色管理模块
 */
// 获取分页列表
export const getRoleList = (params: Role.ReqRoleParams) => {
  return http.get<ResPage<Role.ResRoleList>>(PORT1 + `/system/role/list`, params);
};

// 新增
export const addRole = (params: Partial<Role.ResRoleList>) => {
  return http.post(PORT1 + `/system/role`, params);
};

// 编辑
export const editRole = (params: Partial<Role.ResRoleList>) => {
  return http.put(PORT1 + `/system/role`, params);
};

// 删除
export const deleteRole = (ids: string[]) => {
  return http.delete(PORT1 + `/system/role/${ids.join(",")}`);
};
