using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Authorization;
using Newtonsoft.Json.Linq;
using InterfaceForward.Application.Contracts.ForwardCore;
using InterfaceForward.Application.Filters;
using InterfaceForward.Application.Rabbit;
using InterfaceForward.Application.Services.App;
using InterfaceForward.Domain.Shared;
using InterfaceForward.Repositories.Log.Services;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using RabbitMQ.Client;
namespace InterfaceForward.Application.Services;
///
/// 接口转发服务
///
[ApiExplorerSettings(GroupName = "接口转发服务")]
[TypeFilter(typeof(ForwardAuthorizeFilter))]
[TypeFilter(typeof(ForwardExceptionFilter))]
[AllowAnonymous]
public class InterfaceForwardService : ApplicationService
{
private readonly InterfaceForwardCommon _forwardCommon;
private readonly ILogRepository _logRepository;
private readonly RabbitClient _rabbitClient;
private readonly IHttpContextAccessor _httpContextAccessor;
///
public InterfaceForwardService(ILogRepository logRepository,
InterfaceForwardCommon forwardCommon, RabbitClient rabbitClient,IHttpContextAccessor httpContextAccessor)
{
_logRepository = logRepository;
_forwardCommon = forwardCommon;
_rabbitClient = rabbitClient;
_httpContextAccessor = httpContextAccessor;
}
[HttpPost("Itfx/BatchRequest")]
public async Task BatchForwardThenPushToQueueAsync(
[FromQuery] [Required] string standardCode,
[FromQuery] [Required] string supplierCode,
[FromBody] [Required] List