2018-10-19 23:09:52 +08:00
|
|
|
|
using Bootstrap.DataAccess;
|
|
|
|
|
using Bootstrap.Security;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace Bootstrap.Admin.Controllers
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Route("api/[controller]/[action]")]
|
|
|
|
|
[AllowAnonymous]
|
2018-11-24 15:12:44 +08:00
|
|
|
|
[ApiController]
|
|
|
|
|
public class InterfaceController : ControllerBase
|
2018-10-19 23:09:52 +08:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public IEnumerable<BootstrapDict> RetrieveDicts()
|
|
|
|
|
{
|
|
|
|
|
return DictHelper.RetrieveDicts();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public IEnumerable<string> RetrieveRolesByUrl([FromBody]string url)
|
|
|
|
|
{
|
|
|
|
|
return RoleHelper.RetrieveRolesByUrl(url);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public IEnumerable<string> RetrieveRolesByUserName([FromBody]string userName)
|
|
|
|
|
{
|
|
|
|
|
return RoleHelper.RetrieveRolesByUserName(userName);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public BootstrapUser RetrieveUserByUserName([FromBody]string userName)
|
|
|
|
|
{
|
|
|
|
|
return UserHelper.RetrieveUserByUserName(userName);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
2018-10-25 15:59:04 +08:00
|
|
|
|
public IEnumerable<BootstrapMenu> RetrieveAppMenus([FromBody]AppMenuOption args)
|
2018-10-19 23:09:52 +08:00
|
|
|
|
{
|
2018-10-25 15:59:04 +08:00
|
|
|
|
return MenuHelper.RetrieveAppMenus(args.AppId, args.UserName, args.Url);
|
2018-10-19 23:09:52 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|