角色添加、角色编辑关联菜单功能

This commit is contained in:
chenchun
2022-09-11 15:39:55 +08:00
parent 004cb20132
commit 1d535b5d61
11 changed files with 187 additions and 115 deletions

View File

@@ -230,6 +230,13 @@
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.MenuController.GetListByRoleId(System.Int64)">
<summary>
根据角色id获取该角色下全部菜单
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="T:Yi.Framework.ApiMicroservice.Controllers.RoleController">
<summary>
角色管理
@@ -261,6 +268,12 @@
<param name="roleDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.RoleController.UpdateInfo(Yi.Framework.DTOModel.RoleInfoDto)">
<summary>
更新角色信息
</summary>
<returns></returns>
</member>
<member name="T:Yi.Framework.ApiMicroservice.Controllers.TestController">
<summary>
测试控制器

View File

@@ -61,5 +61,17 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
return Result.Success().SetData(await _iMenuService.GetMenuTreeAsync());
}
/// <summary>
/// 根据角色id获取该角色下全部菜单
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("{id}")]
public async Task<Result> GetListByRoleId(long id)
{
return Result.Success().SetData(await _iMenuService.GetListByRoleId(id));
}
}
}

View File

@@ -10,6 +10,7 @@ using Yi.Framework.DTOModel;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
using Yi.Framework.Service;
using Yi.Framework.WebCore;
using Yi.Framework.WebCore.AttributeExtend;
using Yi.Framework.WebCore.AuthorizationPolicy;
@@ -72,5 +73,15 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
return Result.Success().SetData(await _iRoleService.AddInfo(roleDto));
}
/// <summary>
/// 更新角色信息
/// </summary>
/// <returns></returns>
[HttpPut]
public async Task<Result> UpdateInfo(RoleInfoDto roleDto)
{
return Result.Success().SetStatus(await _iRoleService.UpdateInfo(roleDto));
}
}
}