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]")]
public class DictsController : Controller
{
///
///
///
///
///
[HttpGet]
public QueryData Get(QueryDictOption value)
{
return value.RetrieveData();
}
///
///
///
///
[HttpPost]
public bool Post([FromBody]BootstrapDict value)
{
return DictHelper.SaveDict(value);
}
///
///
///
///
[HttpDelete]
[Authorize(Roles = "Administrators")]
public object Delete([FromBody]IEnumerable value)
{
var result = DictHelper.DeleteDict(value);
return new { result, msg = result ? "成功!" : "失败" };
}
}
}