2020-04-13 12:41:22 +02:00
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using zero.Core;
|
|
|
|
|
using zero.Core.Api;
|
2020-04-17 12:28:03 +02:00
|
|
|
using zero.Core.Entities;
|
2020-04-16 00:56:22 +02:00
|
|
|
using zero.Core.Identity;
|
2020-04-13 12:41:22 +02:00
|
|
|
|
|
|
|
|
namespace zero.Web.Controllers
|
|
|
|
|
{
|
2020-04-16 00:56:22 +02:00
|
|
|
[ZeroAuthorize(Permissions.Settings.Countries, PermissionsValue.Read)]
|
2020-04-13 12:41:22 +02:00
|
|
|
public class CountriesController : BackofficeController
|
|
|
|
|
{
|
|
|
|
|
private ICountriesApi Api { get; set; }
|
|
|
|
|
|
|
|
|
|
public CountriesController(IZeroConfiguration config, ICountriesApi api) : base(config)
|
|
|
|
|
{
|
|
|
|
|
Api = api;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2020-04-17 15:32:33 +02:00
|
|
|
//public async Task<IActionResult> GetAll([FromQuery] ListQuery<Country> query)
|
|
|
|
|
//{
|
|
|
|
|
// return Json(await Api.GetByQuery("en-US", query));
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
2020-04-17 12:28:03 +02:00
|
|
|
public async Task<IActionResult> GetAll([FromQuery] ListQuery<Country> query)
|
2020-04-13 12:41:22 +02:00
|
|
|
{
|
2020-04-17 12:28:03 +02:00
|
|
|
return Json(await Api.GetByQuery("en-US", query));
|
2020-04-13 12:41:22 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|