Add an action to retrieve un simple summary with

the total of jumps and the last jump
This commit is contained in:
Sébastien André
2020-03-03 15:45:36 +01:00
parent e6f0edebf5
commit 6a5e9020d5
7 changed files with 50 additions and 5 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 TotalCutaway { 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>();
}
}
}