添加接口实现接口
This commit is contained in:
@@ -40,5 +40,17 @@ namespace Yi.Framework.Interface
|
||||
/// <param name="menuId"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> SetMouldByMenu(int mouldId,int menuId);
|
||||
/// <summary>
|
||||
/// 添加菜单
|
||||
/// </summary>
|
||||
/// <param name="_menu"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> AddMenu(menu _menu);
|
||||
/// <summary>
|
||||
/// 添加子菜单
|
||||
/// </summary>
|
||||
/// <param name="_menu"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> AddChildrenMenu(menu _menu);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,12 @@ namespace Yi.Framework.Interface
|
||||
/// <param name="menuId"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> SetMenusByRolesId(List<int> menuIds, int roleId);
|
||||
/// <summary>
|
||||
/// 添加角色
|
||||
/// </summary>
|
||||
/// <param name="_role"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> AddRole(role _role);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,5 +52,6 @@ namespace Yi.Framework.Interface
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> SetRolesByUserId(List<int> roleIds,int userId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,27 @@ namespace Yi.Framework.Service
|
||||
{
|
||||
public MenuService(DbContext Db) : base(Db) { }
|
||||
|
||||
public async Task<bool> AddChildrenMenu(menu _menu)
|
||||
{
|
||||
var menu_data = await GetEntity(u=>u.id==_menu.id&& u.is_delete == (short)Common.Enum.DelFlagEnum.Normal);
|
||||
if (menu_data == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
menu_data.children.Add(new menu()) ;
|
||||
return await AddAsync(_menu);
|
||||
}
|
||||
|
||||
public async Task<bool> AddMenu(menu _menu)
|
||||
{
|
||||
var menu_data = await GetEntityById(_menu.id);
|
||||
if (menu_data == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return await AddAsync(_menu);
|
||||
}
|
||||
|
||||
public async Task<bool> DelListByUpdateAsync(List<int> _ids)
|
||||
{
|
||||
var menuList = await GetEntitiesAsync(u=>_ids.Contains(u.id));
|
||||
|
||||
@@ -15,6 +15,16 @@ namespace Yi.Framework.Service
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<bool> AddRole(role _role)
|
||||
{
|
||||
var role_data = await GetEntityById(_role.id);
|
||||
if(role_data==null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return await AddAsync(_role);
|
||||
}
|
||||
|
||||
public async Task<bool> DelListByUpdateAsync(List<int> _ids)
|
||||
{
|
||||
var userList = await GetEntitiesAsync(u=>_ids.Contains(u.id));
|
||||
|
||||
Reference in New Issue
Block a user