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 DropZoneController : Base
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public DropZoneController(IDropZoneService dropZoneService,
|
||||
IMapper mapper)
|
||||
{
|
||||
@@ -20,12 +21,32 @@ namespace skydiveLogs_api.Controllers
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
// PUT: api/DropZone/AddToFavorite/5
|
||||
[HttpPut("AddToFavorite/{id}")]
|
||||
[EnableCors]
|
||||
public bool AddToFavorite(int id)
|
||||
{
|
||||
return _dropZoneService.AddToFavorite(id);
|
||||
}
|
||||
|
||||
// DELETE: api/ApiWithActions
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
{
|
||||
_dropZoneService.DeleteDzById(id);
|
||||
}
|
||||
|
||||
// GET: api/DropZone
|
||||
[HttpGet]
|
||||
[EnableCors]
|
||||
public IEnumerable<DropZoneResp> Get()
|
||||
{
|
||||
var result = _dropZoneService.GetAllDzs(ConnectedUser);
|
||||
var result = _dropZoneService.GetAllDzs();
|
||||
|
||||
return _mapper.Map<IEnumerable<DropZoneResp>>(result);
|
||||
}
|
||||
@@ -56,31 +77,21 @@ namespace skydiveLogs_api.Controllers
|
||||
return _dropZoneService.UpdateDz(id, _mapper.Map<DropZone>(value));
|
||||
}
|
||||
|
||||
// DELETE: api/ApiWithActions
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
{
|
||||
_dropZoneService.DeleteDzById(id);
|
||||
}
|
||||
|
||||
// PUT: api/DropZone/AddToFavorite/5
|
||||
[HttpPut("AddToFavorite/{id}")]
|
||||
[EnableCors]
|
||||
public bool AddToFavorite(int id)
|
||||
{
|
||||
return _dropZoneService.AddToFavorite(id, ConnectedUser);
|
||||
}
|
||||
|
||||
// PUT: api/DropZone/RemoveToFavorite/15
|
||||
[HttpPut("RemoveToFavorite/{id}")]
|
||||
[EnableCors]
|
||||
public bool RemoveToFavorite(int id)
|
||||
{
|
||||
return _dropZoneService.RemoveToFavorite(id, ConnectedUser);
|
||||
return _dropZoneService.RemoveToFavorite(id);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private readonly IDropZoneService _dropZoneService;
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user