完善角色菜单分配管理
This commit is contained in:
@@ -28,6 +28,8 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
_iMenuService = iMenuService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到树形菜单
|
||||
/// </summary>
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user