using DAL.Models.Entities; using DAL.Models.Filters; using DAL.Repositories; using HRD.LDAPService.JWT; using HRD.WebApi.Controllers; using HRD.WebApi.Repositories; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; namespace StaffDBServer.Controllers { [JWTAuthorize] public class WindreamColumnsToDepartmentController : BaseController { public WindreamColumnsToDepartmentController(IBaseRepository repositoryBase, ILogger logger) : base(repositoryBase, logger) { } [HttpPost("DepartmentFilter")] public async Task GetWindreamColumnsToDepartmentListAsync([FromBody] DepartmentFilter filter) { try { var list = await ((WindreamColumnsToDepartmentRepository)EntityRepository).GetListByFilterAsync(filter); return new OkObjectResult(list); } catch (Exception ex) { this.WriteLogException(ex); return StatusCode(StatusCodes.Status400BadRequest, $"Cann't get the filtered list of {typeof(WindreamColumnsToDepartment).Name}"); } } } }