This commit is contained in:
Sébastien André
2020-03-04 22:49:01 +01:00
12 changed files with 125 additions and 32 deletions

View File

@@ -21,6 +21,15 @@ namespace skydiveLogs_api.Controllers
_mapper = mapper;
}
[HttpGet("Simple")]
[EnableCors]
public SimpleSummaryResp Simple()
{
var result = _statsService.GetSimpleSummary();
return _mapper.Map<SimpleSummaryResp>(result);
}
[HttpGet("ByDz")]
[EnableCors]
public IEnumerable<StatisticResp> ByDz()

View File

@@ -0,0 +1,11 @@
namespace skydiveLogs_api.DataContract
{
public class SimpleSummaryResp
{
public int TotalJumps { get; set; }
public int TotalCutaways { get; set; }
public JumpResp LastJump { get; set; }
}
}

View File

@@ -18,6 +18,8 @@ namespace skydiveLogs_api.Mapper
CreateMap<Model.Aircraft ,DataContract.AircraftResp>();
CreateMap<Model.DropZone ,DataContract.DropZoneResp>();
CreateMap<Model.Statistic ,DataContract.StatisticResp>();
CreateMap<Model.SimpleSummary, DataContract.SimpleSummaryResp>();
}
}
}