You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.6 KiB
51 lines
1.6 KiB
using DealerSelection.Api.Interface;
|
|
using DealerSelection.WebApi.Models;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Swashbuckle.AspNetCore.Annotations;
|
|
using Model = DealerSelection.Api.Models;
|
|
|
|
namespace DealerSelection.WebApi.Controllers;
|
|
|
|
[ApiController]
|
|
[Route("")]
|
|
public class YellowController : ControllerBase
|
|
{
|
|
|
|
private IYellowAIApi Api { get; }
|
|
public YellowController(IYellowAIApi api)
|
|
{
|
|
Api = api;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Update Yellow AI response of Selected Dealer data in DB
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[Authorize]
|
|
[HttpPost]
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
[SwaggerOperation(Tags = new[] { "YellowAI" })]
|
|
[Route("updateselecteddealer")]
|
|
public async Task UpdateSelectedDealer(CustomerDealerInfoRequest customerDealerInfoRequest)
|
|
{
|
|
Api.Models.CustomerDealerInfoRequest request = MapperConfig.MapCustomerDealerInfoRequest(customerDealerInfoRequest);
|
|
await Api.UpdateSelectedDealer(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get Model Code against Mobile Number and BU Code
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[Authorize]
|
|
[HttpGet]
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
[SwaggerOperation(Tags = new[] { "YellowAI" })]
|
|
[Route("getmodelcode")]
|
|
public async Task<ModelDetail> GetModelDetails(string buCode,string buSubType,string mobileNumber)
|
|
{
|
|
Model.ModelDetail apiResponse = await Api.GetModelDetails(mobileNumber, buCode,buSubType);
|
|
ModelDetail response = MapperConfig.MapModelDetails(apiResponse);
|
|
return response;
|
|
}
|
|
}
|