State of OMG-LEGION prior to merge

This commit is contained in:
2022-10-30 10:54:20 -04:00
parent 9924880b51
commit 48844127d7
45 changed files with 1350 additions and 868 deletions

View File

@@ -0,0 +1,63 @@

using Microsoft.AspNetCore.Mvc;
using PartSource.Data.Dtos;
using PartSource.Data.Models;
using PartSource.Data.Nexpart;
using PartSource.Services;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace PartSource.Api.Controllers
{
[Route("[controller]")]
[ApiController]
[ApiExplorerSettings(GroupName = "v1")]
public class WipersController : BaseNexpartController
{
private readonly NexpartService _nexpartService;
public WipersController(NexpartService nexpartService)
{
_nexpartService = nexpartService;
}
[HttpGet]
[Route("{baseVehicleId}")]
public async Task<ActionResult> GetWipersForVehicle(int baseVehicleId)
{
ApplicationSearch applicationSearch = new ApplicationSearch
{
VehicleIdentifier = new VehicleIdentifier
{
BaseVehicleId = baseVehicleId
},
MfrCode = new[] { "BOS", "TRI" },
PartType = new[]
{
new PartType { Id = 8852 }
},
Criterion = new[]
{
new Criterion
{
Attribute = "REGION",
Id = 2
}
},
GroupBy = "PARTTYPE"
};
ApplicationSearchResponse response = await _nexpartService.SendRequest<ApplicationSearch, ApplicationSearchResponse>(applicationSearch);
if (response.ResponseBody != null)
{
return NexpartResponse<ApplicationSearchResponse, Apps>(response);
}
else
{
return NotFound();
}
}
}
}