diff --git a/langguanApi.xml b/langguanApi.xml
index 0d7dcb0..278c917 100644
--- a/langguanApi.xml
+++ b/langguanApi.xml
@@ -167,6 +167,44 @@
+
+
+ MenuController
+
+
+
+
+ 菜单服务
+
+
+
+
+ 获取菜单列表
+
+
+
+
+
+
+ 添加菜单
+
+
+
+
+
+
+ 更新菜单
+
+
+
+
+
+
+ 删除菜单
+
+
+
+
组织的工序
@@ -805,6 +843,26 @@
父菜单ID,一级菜单为null
+
+
+ 菜单名称
+
+
+
+
+ 菜单URL
+
+
+
+
+ 排序
+
+
+
+
+ 父菜单ID,一级菜单为null
+
+
角色名称
@@ -825,6 +883,11 @@
角色描述
+
+
+ 菜单ID
+
+
更新角色DTO
@@ -1730,6 +1793,13 @@
+
+
+ 获取菜单树
+
+
+
+
OrganizedService
@@ -1813,6 +1883,13 @@
+
+
+ 删除角色菜单
+
+
+
+
更新角色菜单
diff --git a/langguanApi/Controllers/MenuController.cs b/langguanApi/Controllers/MenuController.cs
new file mode 100644
index 0000000..49cff20
--- /dev/null
+++ b/langguanApi/Controllers/MenuController.cs
@@ -0,0 +1,69 @@
+using langguanApi.Model;
+using langguanApi.Model.Entity;
+using langguanApi.Service;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+
+namespace langguanApi.Controllers
+{
+ ///
+ /// MenuController
+ ///
+ [Route("api/[controller]")]
+ [ApiController]
+ public class MenuController : ControllerBase
+ {
+ ///
+ /// 菜单服务
+ ///
+ private readonly MenuService _menuService;
+ public MenuController(MenuService menuService)
+ {
+ _menuService = menuService;
+ }
+ ///
+ /// 获取菜单列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ public async Task List([FromQuery] reqpage input)
+ {
+ var result = await _menuService.Pager(input);
+ return Ok(result);
+ }
+ ///
+ /// 添加菜单
+ ///
+ ///
+ ///
+ [HttpPost("add")]
+ public async Task Add(AddMenuDto input)
+ {
+ var result = await _menuService.AddMenu(input);
+ return Ok(result);
+ }
+ ///
+ /// 更新菜单
+ ///
+ ///
+ ///
+ [HttpPut("update")]
+ public async Task Update(UpdateMenuDto input)
+ {
+ var result = await _menuService.UpdateMenu(input);
+ return Ok(result);
+ }
+ ///
+ /// 删除菜单
+ ///
+ ///
+ ///
+ [HttpDelete("remove")]
+ public async Task Remove(IEnumerable ids)
+ {
+ await _menuService.BatchRemoveAsync(ids);
+ return Ok(new ApiResult());
+ }
+ }
+}
diff --git a/langguanApi/Controllers/RoleController.cs b/langguanApi/Controllers/RoleController.cs
index 59874aa..1e3201c 100644
--- a/langguanApi/Controllers/RoleController.cs
+++ b/langguanApi/Controllers/RoleController.cs
@@ -16,9 +16,11 @@ namespace langguanApi.Controllers
public class RoleController : ControllerBase
{
public readonly RoleService _roleService;
- public RoleController(RoleService roleService)
+ private readonly RoleMenuServie _roleMenuServie;
+ public RoleController(RoleService roleService, RoleMenuServie roleMenuServie)
{
_roleService = roleService;
+ _roleMenuServie = roleMenuServie;
}
///
/// 获取角色详情
diff --git a/langguanApi/Model/Entity/Menu.cs b/langguanApi/Model/Entity/Menu.cs
index 02ccc82..8a8ad83 100644
--- a/langguanApi/Model/Entity/Menu.cs
+++ b/langguanApi/Model/Entity/Menu.cs
@@ -45,4 +45,26 @@
{
public string Id { get; set; }
}
+ public class MenuTreeDto
+ {
+ public string Id { get; set; }
+ ///
+ /// 菜单名称
+ ///
+ public string Name { get; set; }
+ ///
+ /// 菜单URL
+ ///
+ public string Url { get; set; }
+ ///
+ /// 排序
+ ///
+ public int Sort { get; set; }
+ ///
+ /// 父菜单ID,一级菜单为null
+ ///
+ public string ParentId { get; set; }
+ public string ParentName { get; set; }
+ public List Children { get; set; }
+ }
}
diff --git a/langguanApi/Model/Entity/Role.cs b/langguanApi/Model/Entity/Role.cs
index 2b446ba..540b3cb 100644
--- a/langguanApi/Model/Entity/Role.cs
+++ b/langguanApi/Model/Entity/Role.cs
@@ -21,6 +21,10 @@
/// 角色描述
///
public string RoleDescription { get; set; }
+ ///
+ /// 菜单ID
+ ///
+ public IEnumerable MenuIds { get; set; }
}
///
/// 更新角色DTO
diff --git a/langguanApi/Service/AlertService.cs b/langguanApi/Service/AlertService.cs
index d6af8ea..2a522ac 100644
--- a/langguanApi/Service/AlertService.cs
+++ b/langguanApi/Service/AlertService.cs
@@ -41,7 +41,7 @@ namespace langguanApi.Service
///
public async Task