using AutoMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using PARR.API.Contracts.V1;
using PARR.API.Contracts.V1.Requests.Queries;
using PARR.API.Contracts.V1.Responses;
using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Controllers.V1.Base;
using PARR.API.Extensions;
using PARR.API.Services.Interfaces;
using PARR.DAL.CacheServices;
using PARR.DAL.DomainModels;
using PARR.DAL.DomainServices.Interfaces;
using PARR.DAL.Models.Job;
using PARR.DAL.Services.Interfaces;
using PARR.DAL.Services.Interfaces.Job;
using PARR.DAL.Services.Interfaces.Unit;
using PARR.DAL.TransformServices;
namespace PARR.API.Controllers.V1
{
[Authorize]
public class TestController : BaseApiController
{
private readonly IClientService clientService;
private readonly IEsppScheduleTransformService esppScheduleTransformService;
private readonly IRedisCacheService redisCacheService;
private readonly IWeekendDayService weekendDayService;
private readonly IUnitService unitService;
private readonly IFieldFilterService fieldFilterService;
private readonly IJobService jobService;
private readonly IJobUnitFilterService jobUnitFilterService;
private readonly IUnitFilterService unitFilterService;
private readonly IMapper mapper;
public TestController(
IClientService clientService,
IEsppScheduleTransformService esppScheduleTransformService,
IRedisCacheService redisCacheService,
IWeekendDayService weekendDayService,
IUnitService unitService,
IFieldFilterService fieldFilterService,
IJobService jobService,
IJobUnitFilterService jobUnitFilterService,
IUnitFilterService unitFilterService,
IMapper mapper
)
{
this.clientService = clientService;
this.esppScheduleTransformService = esppScheduleTransformService;
this.redisCacheService = redisCacheService;
this.weekendDayService = weekendDayService;
this.unitService = unitService;
this.fieldFilterService = fieldFilterService;
this.jobService = jobService;
this.jobUnitFilterService = jobUnitFilterService;
this.unitFilterService = unitFilterService;
this.mapper = mapper;
}
///
/// Получить мой ip
///
///
[HttpGet(ApiRoutes.Test.GetMyIp)]
public IActionResult GetMyIp()
{
var ipAddress = clientService.GetClientIp();
var ip = ipAddress?.ToString();
return Ok(new Response