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 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); if (response.ResponseBody != null) { return NexpartResponse(response); } else { return NotFound(); } } } }