48 lines
1.7 KiB
C#
48 lines
1.7 KiB
C#
//using Microsoft.AspNetCore.Mvc;
|
|
//using PartSource.Data.Models;
|
|
//using PartSource.Services;
|
|
//using System.Web.Http;
|
|
|
|
//namespace PartSource.Api.Controllers
|
|
//{
|
|
// [Route("stores")]
|
|
// public class StoresController : ControllerBase
|
|
// {
|
|
// private const int Count = 5;
|
|
// private const int Page = 1;
|
|
// private readonly LocationService _service;
|
|
|
|
// public StoresController(LocationService service)
|
|
// {
|
|
// this._service = service;
|
|
// }
|
|
|
|
// [HttpGet]
|
|
// [Route("nearest/{postal}")]
|
|
// [Route("nearest/{postal}/count/{count}")]
|
|
// [Route("nearest/{postal}/count/{count}/page/{page}")]
|
|
// public ActionResult GetNearestStores(string postal, int count = 5, int page = 1)
|
|
// {
|
|
// PostalCode postalCodeData = this._service.GetPostalCodeData(postal);
|
|
// if (postalCodeData == null)
|
|
// return (ActionResult)this.BadRequest("Invalid postal code");
|
|
// return (ActionResult)this.Ok(new
|
|
// {
|
|
// Data = this._service.GetClosestLocations(postalCodeData, count, page)
|
|
// });
|
|
// }
|
|
|
|
// [HttpGet]
|
|
// [Route("nearest/{postal}/radius/{radius}")]
|
|
// [Route("nearest/{postal}/radius/{radius}/count/{count}")]
|
|
// [Route("nearest/{postal}/radius/{radius}/count/{count}/page/{page}")]
|
|
// public ActionResult GetNearestStores(string postal, double radius, int count = 5, int page = 1)
|
|
// {
|
|
// return (ActionResult)this.Ok(new
|
|
// {
|
|
// Data = this._service.GetClosestLocations(this._service.GetPostalCodeData(postal), count, page, radius)
|
|
// });
|
|
// }
|
|
// }
|
|
//}
|