using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Cors; using AutoMapper; using skydiveLogs_api.Business.Interface; using skydiveLogs_api.DataContract; using skydiveLogs_api.Model; namespace skydiveLogs_api.Controllers { [Route("api/[controller]")] [ApiController] public class StatsController : ControllerBase { public StatsController(IDropZoneService dropZoneService, IMapper mapper) { _dropZoneService = dropZoneService; _mapper = mapper; } [HttpGet("ByDz")] [EnableCors] public IEnumerable ByDz() { var result = _dropZoneService.GetAllDzs(); return _mapper.Map>(result); } [HttpGet("ByAircraft")] [EnableCors] public IEnumerable ByAircraft() { var result = _dropZoneService.GetAllDzs(); return _mapper.Map>(result); } [HttpGet("ByJumpType")] [EnableCors] public IEnumerable ByJumpType() { var result = _dropZoneService.GetAllDzs(); return _mapper.Map>(result); } [HttpGet("ByRig")] [EnableCors] public IEnumerable ByRig() { var result = _dropZoneService.GetAllDzs(); return _mapper.Map>(result); } [HttpGet("ByYear")] [EnableCors] public IEnumerable ByYear() { var result = _dropZoneService.GetAllDzs(); return _mapper.Map>(result); } private readonly IDropZoneService _dropZoneService; private readonly IMapper _mapper; } }