添加关系表业务

This commit is contained in:
橙子
2022-04-26 01:31:14 +08:00
parent 2556c037ba
commit f3061ed643
13 changed files with 191 additions and 17 deletions

View File

@@ -18,7 +18,7 @@ using Yi.Framework.WebCore.AuthorizationPolicy;
namespace Yi.Framework.ApiMicroservice.Controllers
{
/// <summary>
/// 账户控制器
/// 账户管理
/// </summary>
[ApiController]
[Route("api/[controller]/[action]")]

View File

@@ -15,6 +15,9 @@ using Yi.Framework.WebCore.AuthorizationPolicy;
namespace Yi.Framework.ApiMicroservice.Controllers
{
/// <summary>
/// 菜单管理
/// </summary>
[ApiController]
[Route("api/[controller]/[action]")]
public class MenuController : BaseCrudController<MenuEntity>
@@ -24,5 +27,16 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
_iMenuService = iMenuService;
}
/// <summary>
/// 得到树形菜单
/// </summary>
/// <returns></returns>
[HttpGet]
//暂未制作逻辑删除与多租户的过滤
public async Task<List<MenuEntity>> GetMenuTree()
{
return await _iMenuService.GetMenuTreeAsync();
}
}
}

View File

@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.DTOModel;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
@@ -15,6 +16,9 @@ using Yi.Framework.WebCore.AuthorizationPolicy;
namespace Yi.Framework.ApiMicroservice.Controllers
{
/// <summary>
/// 角色管理
/// </summary>
[ApiController]
[Route("api/[controller]/[action]")]
public class RoleController : BaseCrudController<RoleEntity>
@@ -24,5 +28,16 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
_iRoleService = iRoleService;
}
/// <summary>
/// 给多用户设置多角色
/// </summary>
/// <param name="giveRoleSetMenuDto"></param>
/// <returns></returns>
[HttpPut]
public async Task<Result> GiveRoleSetMenu(GiveRoleSetMenuDto giveRoleSetMenuDto)
{
return Result.Success().SetStatus(await _iRoleService.GiveRoleSetMenu(giveRoleSetMenuDto.RoleIds, giveRoleSetMenuDto.MenuIds));
}
}
}

View File

@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.DTOModel;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
@@ -15,6 +16,9 @@ using Yi.Framework.WebCore.AuthorizationPolicy;
namespace Yi.Framework.ApiMicroservice.Controllers
{
/// <summary>
/// 用户管理
/// </summary>
[ApiController]
[Route("api/[controller]/[action]")]
public class UserController : BaseCrudController<UserEntity>
@@ -24,5 +28,16 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
_iUserService = iUserService;
}
/// <summary>
/// 给多用户设置多角色
/// </summary>
/// <param name="giveUserSetRoleDto"></param>
/// <returns></returns>
[HttpPut]
public async Task<Result> GiveUserSetRole(GiveUserSetRoleDto giveUserSetRoleDto)
{
return Result.Success().SetStatus(await _iUserService.GiveUserSetRole(giveUserSetRoleDto.UserIds,giveUserSetRoleDto.RoleIds));
}
}
}