控制器添加复杂接口

This commit is contained in:
橙子
2021-10-14 13:15:00 +08:00
parent 93b8434857
commit 395a0350d6
16 changed files with 390 additions and 62 deletions

View File

@@ -5,12 +5,13 @@ 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;
namespace Yi.Framework.ApiMicroservice.Controllers
{
[Route("api/[controller]")]
[Route("api/[controller]/[action]")]
[ApiController]
public class MenuController : ControllerBase
{
@@ -61,5 +62,15 @@ namespace Yi.Framework.ApiMicroservice.Controllers
await _menuService.AddAsync(_menu);
return Result.Success();
}
/// <summary>
/// 给一个菜单设置一个接口,Id1为菜单id,Id2为接口id
/// </summary>
/// <param name="idDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<Result> SetMouldByMenu(IdDto<int> idDto)
{
}
}
}

View File

@@ -10,7 +10,7 @@ using Yi.Framework.Model.Models;
namespace Yi.Framework.ApiMicroservice.Controllers
{
[Route("api/[controller]")]
[Route("api/[controller]/[action]")]
[ApiController]
public class MouldController : ControllerBase
{

View File

@@ -5,12 +5,13 @@ 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;
namespace Yi.Framework.ApiMicroservice.Controllers
{
[Route("api/[controller]")]
[Route("api/[controller]/[action]")]
[ApiController]
public class RoleController : ControllerBase
{
@@ -20,7 +21,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
_roleService = roleService;
}
[HttpGet]
public async Task<Result> GetURole()
public async Task<Result> GetRole()
{
return Result.Success().SetData(await _roleService.GetAllEntitiesTrueAsync());
}
@@ -61,5 +62,15 @@ namespace Yi.Framework.ApiMicroservice.Controllers
await _roleService.AddAsync(_role);
return Result.Success();
}
/// <summary>
/// 给角色设置菜单多个角色与多个菜单让每一个角色都设置ids1为角色ids2为菜单
/// </summary>
/// <param name="idsListDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<Result> SetMenuByRole(IdsListDto<int> idsListDto)
{
}
}
}

View File

@@ -5,6 +5,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.WebCore;
@@ -82,5 +83,15 @@ namespace Yi.Framework.ApiMicroservice.Controllers
var menu_data = await _userService.GetMenusByUser(_user);
return Result.Success().SetData(menu_data);
}
/// <summary>
/// 给单个用户设置多个角色ids有用户id与 角列表色ids1对多
/// </summary>
/// <param name="idsDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<Result> SetRoleByUser(IdsDto<int> idsDto)
{
}
}
}