72 lines
1.9 KiB
C#
72 lines
1.9 KiB
C#
|
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]
|
|||
|
public class InterfaceController : Controller
|
|||
|
{
|
|||
|
/// <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]
|
|||
|
public IEnumerable<BootstrapMenu> RetrieveAppMenus([FromBody]AppMenuArgs args)
|
|||
|
{
|
|||
|
return MenuHelper.RetrieveAppMenus(args.Name, args.Url);
|
|||
|
}
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public class AppMenuArgs
|
|||
|
{
|
|||
|
public string Name { get; set; }
|
|||
|
|
|||
|
public string Url { get; set; }
|
|||
|
}
|
|||
|
}
|
|||
|
}
|