using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace Bootstrap.Admin.Controllers.Api
{
///
///
///
[Route("api/[controller]")]
[ApiController]
public class DictsController : ControllerBase
{
///
///
///
///
///
[HttpGet]
public QueryData Get([FromQuery]QueryDictOption value)
{
return value.RetrieveData();
}
///
///
///
///
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Dicts", Auth = "add,edit")]
public bool Post([FromBody]BootstrapDict value)
{
return DictHelper.Save(value);
}
///
///
///
///
[HttpDelete]
[Authorize(Roles = "Administrators")]
[ButtonAuthorize(Url = "~/Admin/Dicts", Auth = "del")]
public bool Delete([FromBody]IEnumerable value)
{
return DictHelper.Delete(value);
}
}
}