diff --git a/langguanApi/Controllers/MeauController.cs b/langguanApi/Controllers/MeauController.cs index 39d5710..327413c 100644 --- a/langguanApi/Controllers/MeauController.cs +++ b/langguanApi/Controllers/MeauController.cs @@ -17,27 +17,7 @@ namespace langguanApi.Controllers { _meuaService = meauService; } - /// - /// 获取菜单列表 - /// - /// - /// - [HttpGet("GetMenuList")] - public async Task GetMenuList([FromQuery] reqpage input) - { - var result = await _meuaService.GetMeauList(input); - return Ok(result); - } - /// - /// 新增菜单 - /// - /// - /// - [HttpPost("AddMeau")] - public async Task AddMeau([FromBody] MeauDto input) - { - var result = await _meuaService.AddMeau(input); - return Ok(result); - } + + } } diff --git a/langguanApi/Controllers/RoleController.cs b/langguanApi/Controllers/RoleController.cs index 2ee96d6..59874aa 100644 --- a/langguanApi/Controllers/RoleController.cs +++ b/langguanApi/Controllers/RoleController.cs @@ -90,16 +90,6 @@ namespace langguanApi.Controllers Select(s => new { s.Id, s.RoleName }) }); } - /// - ///新增角色 - /// - /// - /// - [HttpPost("AddRole")] - public async Task AddRole([FromBody] RoleDto input) - { - var result = await _roleService.AddRole(input); - return Ok(result); - } + } } diff --git a/langguanApi/Model/SystemConfigurationEntity/Meau.cs b/langguanApi/Model/SystemConfigurationEntity/Meau.cs deleted file mode 100644 index 192ba51..0000000 --- a/langguanApi/Model/SystemConfigurationEntity/Meau.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace langguanApi.Model.SystemConfigurationEntity -{ - //菜单实体类 - public class Meau : BaseModel - { - /// - /// 父菜单ID 默认首页为1级,有组织为2级,无组织为2级,下面的子菜单为3级 - /// - public string ParentId { get; set; } - /// - /// 菜单编码 - /// - public string MenuCode { get; set; } - /// - /// 菜单名称 - /// - public string MenuName { get; set; } - /// - /// 可空,菜单跳转路径 - /// - public string Url { get; set; } - /// - /// 排序 - /// - public int Sort { get; set; } - /// - /// 是否激活 - /// - public bool IsActive { get; set; } - - } -} diff --git a/langguanApi/Model/SystemConfigurationEntity/UserRole.cs b/langguanApi/Model/SystemConfigurationEntity/UserRole.cs deleted file mode 100644 index dc186be..0000000 --- a/langguanApi/Model/SystemConfigurationEntity/UserRole.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace langguanApi.Model.SystemConfigurationEntity -{ - /// - /// 角色实体类 - /// - public class UserRole : BaseModel - { - /// - /// 角色名称 - /// - public string RoleName { get; set; } - /// - /// 多个菜单用,隔开 - /// - public string Meaus { get; set; } - /// - /// 是否管理员 - /// - public bool IsAdmin { get; set; } - /// - /// 角色描述 - /// - public string Description { get; set; } - } -} diff --git a/langguanApi/Service/MeauService.cs b/langguanApi/Service/MeauService.cs index eed9241..9309988 100644 --- a/langguanApi/Service/MeauService.cs +++ b/langguanApi/Service/MeauService.cs @@ -1,7 +1,7 @@ using langguanApi.Extensions.AutoDI; using langguanApi.Model; using langguanApi.Model.Dto.SystemConfigurationDto; -using langguanApi.Model.SystemConfigurationEntity; +using langguanApi.Model.Entity; using Mapster; using System.Linq.Expressions; @@ -11,62 +11,12 @@ namespace langguanApi.Service /// 菜单服务 /// [ServiceInjection(InjectionType.Transient)] - public class MeauService : BaseService + public class MeauService : BaseService { - public MeauService(IConfiguration config) : base(config, nameof(Meau)) + public MeauService(IConfiguration config) : base(config, nameof(Menu)) { } - /// - /// 获取菜单列表 - /// - /// - /// - public async Task GetMeauList(reqpage input) - { - Expression> exp = filter =>filter.IsDelete == false; - if (!string.IsNullOrEmpty(input.key)) - { - exp=filter => filter.MenuName.Contains(input.key); - } - return await base.GetPager(new ReqPaing() - { - pageSize = input.pageSize, - current = input.current - }, exp); - } - - - /// - /// 新加 - /// - /// - /// - public async Task AddMeau(MeauDto input) - { - if (await Exist(input)) - { - return new ApiResult { code = 1, msg = $"{input.MenuName}的菜单已存在" }; - } - var entity = input.Adapt(); - if (entity != null) - { - await base.CreateAsync(entity); - return new ApiResult { code = 0, msg = "" }; - } - return new ApiResult { code = 1, msg = "菜单添加失败" }; ; - } - /// - /// 是否存在 - /// - /// - /// - public async Task Exist(MeauDto input) - { - var entity = input.Adapt(); - Expression> exp = filter => filter.MenuName == entity.MenuName; - return await base.Exist(exp); - } } diff --git a/langguanApi/Service/RoleService.cs b/langguanApi/Service/RoleService.cs index 7f62785..d29dac5 100644 --- a/langguanApi/Service/RoleService.cs +++ b/langguanApi/Service/RoleService.cs @@ -3,7 +3,6 @@ using langguanApi.Extensions.AutoDI; using langguanApi.Model.Dto.SystemConfigurationDto; using langguanApi.Model; using langguanApi.Model.Entity; -using langguanApi.Model.SystemConfigurationEntity; using Mapster; using NPOI.SS.Formula.Functions; using System.Linq.Expressions; @@ -14,7 +13,7 @@ using System.Collections.Generic; namespace langguanApi.Service { /// - /// 校色服务 + /// 角色服务 /// [ServiceInjection(InjectionType.Transient)] public class RoleService : BaseService @@ -100,35 +99,15 @@ namespace langguanApi.Service }, exp); } + #region 用户管理角色相关 /// - /// 用户是否存在 + /// 根据id获取角色信息 /// - /// + /// /// - public async Task Exist(RoleDto input) + public async Task GetRoleById(string roleId) { - var entity = input.Adapt(); - Expression> exp = filter => filter.RoleName == entity.RoleName; - return await base.Exist(exp); - } - /// - /// 新加角色 - /// - /// - /// - public async Task AddRole(RoleDto input) - { - if (await Exist(input)) - { - return new ApiResult { code = 1, msg = $"{input.RoleName}的角色已存在" }; - } - var entity = input.Adapt(); - if (entity != null) - { - await base.CreateAsync(entity); - return new ApiResult { code = 0, msg = "" }; - } - return new ApiResult { code = 1, msg = "菜单添加失败" }; ; + return await base.GetAsync(roleId); } /// /// 根据Id,获取多个校色信息 @@ -141,17 +120,6 @@ namespace langguanApi.Service var list = (await base.GetListWithExp(exp)).ToList(); return list; } - - #region 用户管理角色相关 - /// - /// 根据id获取角色信息 - /// - /// - /// - public async Task GetRoleById(string roleId) - { - return await base.GetAsync(roleId); - } #endregion }