import { get, post } from '@/api/request';

const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_SYSTEM;

// 角色列表
export const roleListRolesApi = (params: any) => {
  return post(`${PREFIX}role/listRoles`, params);
};

// 创建角色
export const roleCreateApi = (params: any) => {
  return post(`${PREFIX}role/create`, params);
};

// 更新角色
export const roleUpdateApi = (params: any) => {
  return post(`${PREFIX}role/update`, params);
};

// 角色详情
export const roleGetRoleByIdApi = (params: any) => {
  return get(`${PREFIX}role/getRoleById`, params);
};

// 删除角色
export const roleDeleteRoleApi = (params: any) => {
  return get(`${PREFIX}role/deleteRole`, params);
};
// 分配角色权限
export const assignPermissionsApi = (params: any) => {
  return post(`${PREFIX}role/assignPermissions`, params);
};
// 查询角色权限
export const getRolePermissionsApi = (params: any) => {
  return get(`${PREFIX}role/getRolePermissions`, params);
};
