Add a cache system on the referential info
+ Add an identity service
This commit is contained in:
@@ -8,11 +8,12 @@ using skydiveLogs_api.Domain;
|
||||
using skydiveLogs_api.DomainBusiness.Interfaces;
|
||||
using skydiveLogs_api.DataContract;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Controllers
|
||||
{
|
||||
public class GearController : Base
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public GearController(IGearService gearService,
|
||||
IMapper mapper)
|
||||
{
|
||||
@@ -20,12 +21,25 @@ namespace skydiveLogs_api.Controllers
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
// DELETE: api/ApiWithActions/5
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
{
|
||||
_gearService.DeleteGearById(id);
|
||||
}
|
||||
|
||||
// GET: api/Gear
|
||||
[HttpGet]
|
||||
[EnableCors]
|
||||
public IEnumerable<GearResp> Get()
|
||||
{
|
||||
var result = _gearService.GetAllGears(ConnectedUser);
|
||||
//var result = _gearService.GetAllGears(ConnectedUser);
|
||||
var result = _gearService.GetAllGears();
|
||||
return _mapper.Map<IEnumerable<GearResp>>(result);
|
||||
}
|
||||
|
||||
@@ -43,7 +57,7 @@ namespace skydiveLogs_api.Controllers
|
||||
[EnableCors]
|
||||
public void Post([FromBody] GearReq value)
|
||||
{
|
||||
_gearService.AddNewGear(_mapper.Map<Gear>(value), ConnectedUser);
|
||||
_gearService.AddNewGear(_mapper.Map<Gear>(value));
|
||||
}
|
||||
|
||||
// PUT: api/Gear/5
|
||||
@@ -54,16 +68,14 @@ namespace skydiveLogs_api.Controllers
|
||||
_gearService.UpdateGear(id, _mapper.Map<Gear>(value));
|
||||
}
|
||||
|
||||
// DELETE: api/ApiWithActions/5
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
{
|
||||
_gearService.DeleteGearById(id);
|
||||
}
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private readonly IGearService _gearService;
|
||||
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user