using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using PARR.API.Contracts.V1;
using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Controllers.V1.Base;
using PARR.API.Services.Interfaces;
using PARR.API.Settings;
using PARR.Core.Common.Interfaces;
using PARR.Core.Repositories.Interfaces;
using PARR.Core.Services.NextRunServices;
using PARR.Core.Services.Workload.Implementations;
namespace PARR.API.Controllers.V1
{
[Authorize]
public class TestController : BaseApiController
{
private readonly IClientService clientService;
private readonly IRedisCacheService redisCacheService;
private readonly INextRunService nextRunService;
private readonly ITemplateRepository templateService;
private readonly WorkloadCacheService workloadCacheService;
public TestController(
IClientService clientService,
IRedisCacheService redisCacheService,
INextRunService nextRunService,
ITemplateRepository templateService,
MqSettings mqSettings,
WorkloadCacheService workloadCacheService
)
{
this.clientService = clientService;
this.redisCacheService = redisCacheService;
this.nextRunService = nextRunService;
this.templateService = templateService;
this.workloadCacheService = workloadCacheService;
}
///
/// Получить мой ip
///
///
[HttpGet(ApiRoutes.Test.GetMyIp)]
public IActionResult GetMyIp()
{
var ipAddress = clientService.GetClientIp();
var ip = ipAddress?.ToString();
return Ok(new Response