完善角色菜单分配管理

This commit is contained in:
橙子
2022-04-29 12:38:19 +08:00
parent c651b60c59
commit 6c7b2224b1
14 changed files with 116 additions and 74 deletions

View File

@@ -28,6 +28,8 @@ namespace Yi.Framework.ApiMicroservice.Controllers
_iMenuService = iMenuService;
}
/// <summary>
/// 得到树形菜单
/// </summary>

View File

@@ -40,6 +40,14 @@ namespace Yi.Framework.ApiMicroservice.Controllers
return Result.Success().SetStatus(await _iRoleService.GiveRoleSetMenu(giveRoleSetMenuDto.RoleIds, giveRoleSetMenuDto.MenuIds));
}
/// <summary>
/// 通过角色id来获取菜单列表
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<Result> GetInMenuByRoleId(long RoleId)
{
return Result.Success().SetData(await _iRoleService.GetInMenuByRoleId(RoleId));
}
}
}

View File

@@ -63,7 +63,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
//不建议操作,直接切换其他仓储
await _iUserService._repository.ChangeRepository<Repository<RoleEntity>>().GetListAsync();
//直接操作Db对象???恭喜你已经毕业了!此后将有一天,接手到这个的软件的程序员将破口大骂。
//最好不要直接操作Db对象
await _iUserService._repository._Db.Queryable<UserEntity>().ToListAsync();
return Result.Success().SetData(await _iUserService.DbTest());