Add comments
This commit is contained in:
@@ -23,7 +23,10 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
// DELETE: api/ApiWithActions/5
|
||||
/// <summary>
|
||||
/// Deletes a gear item by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The gear ID to delete.</param>
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
@@ -31,17 +34,23 @@ namespace skydiveLogs_api.Controllers
|
||||
_gearService.DeleteGearById(id);
|
||||
}
|
||||
|
||||
// GET: api/Gear
|
||||
/// <summary>
|
||||
/// Retrieves a list of all gear items.
|
||||
/// </summary>
|
||||
/// <returns>A collection of GearResp objects containing all gear data.</returns>
|
||||
[HttpGet]
|
||||
[EnableCors]
|
||||
public IEnumerable<GearResp> Get()
|
||||
{
|
||||
//var result = _gearService.GetAllGears(ConnectedUser);
|
||||
var result = _gearService.GetAllGears();
|
||||
return _mapper.Map<IEnumerable<GearResp>>(result);
|
||||
}
|
||||
|
||||
// GET: api/Gear/5
|
||||
/// <summary>
|
||||
/// Retrieves a gear item by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The gear ID to retrieve.</param>
|
||||
/// <returns>A GearResp object containing the gear details.</returns>
|
||||
[HttpGet("{id}")]
|
||||
[EnableCors]
|
||||
public GearResp Get(int id)
|
||||
@@ -50,7 +59,10 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<GearResp>(result);
|
||||
}
|
||||
|
||||
// POST: api/Gear
|
||||
/// <summary>
|
||||
/// Adds a new gear item to the system.
|
||||
/// </summary>
|
||||
/// <param name="value">GearReq object containing the new gear data.</param>
|
||||
[HttpPost]
|
||||
[EnableCors]
|
||||
public void Post([FromBody] GearReq value)
|
||||
@@ -58,7 +70,11 @@ namespace skydiveLogs_api.Controllers
|
||||
_gearService.AddNewGear(_mapper.Map<Gear>(value));
|
||||
}
|
||||
|
||||
// PUT: api/Gear/5
|
||||
/// <summary>
|
||||
/// Updates an existing gear item.
|
||||
/// </summary>
|
||||
/// <param name="id">The gear ID to update.</param>
|
||||
/// <param name="value">GearReq object containing the updated gear data.</param>
|
||||
[HttpPut("{id}")]
|
||||
[EnableCors]
|
||||
public void Put(int id, [FromBody] GearReq value)
|
||||
|
||||
Reference in New Issue
Block a user