Little test with AI + Add the equipment #8
@@ -23,7 +23,11 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
// PUT: api/DropZone/AddToFavorite/5
|
||||
/// <summary>
|
||||
/// Adds a drop zone to the user's favorites.
|
||||
/// </summary>
|
||||
/// <param name="id">The drop zone ID to add to favorites.</param>
|
||||
/// <returns>True if successful, false otherwise.</returns>
|
||||
[HttpPut("AddToFavorite/{id}")]
|
||||
[EnableCors]
|
||||
public bool AddToFavorite(int id)
|
||||
@@ -31,7 +35,10 @@ namespace skydiveLogs_api.Controllers
|
||||
return _dropZoneService.AddToFavorite(id);
|
||||
}
|
||||
|
||||
// DELETE: api/ApiWithActions
|
||||
/// <summary>
|
||||
/// Deletes a drop zone by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The drop zone ID to delete.</param>
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
@@ -39,7 +46,10 @@ namespace skydiveLogs_api.Controllers
|
||||
_dropZoneService.DeleteDzById(id);
|
||||
}
|
||||
|
||||
// GET: api/DropZone
|
||||
/// <summary>
|
||||
/// Retrieves a list of all drop zones.
|
||||
/// </summary>
|
||||
/// <returns>A collection of DropZoneResp objects containing all drop zones.</returns>
|
||||
[HttpGet]
|
||||
[EnableCors]
|
||||
public IEnumerable<DropZoneResp> Get()
|
||||
@@ -49,7 +59,11 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<IEnumerable<DropZoneResp>>(result);
|
||||
}
|
||||
|
||||
// GET: api/DropZone/5
|
||||
/// <summary>
|
||||
/// Retrieves a drop zone by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The drop zone ID to retrieve.</param>
|
||||
/// <returns>A DropZoneResp object containing the drop zone details.</returns>
|
||||
[HttpGet("{id}")]
|
||||
[EnableCors]
|
||||
public DropZoneResp Get(int id)
|
||||
@@ -59,6 +73,10 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<DropZoneResp>(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a simplified list of all drop zones.
|
||||
/// </summary>
|
||||
/// <returns>A collection of DropZoneSimpleResp objects containing simplified drop zone data.</returns>
|
||||
[HttpGet("GetSimple")]
|
||||
[EnableCors]
|
||||
public IEnumerable<DropZoneSimpleResp> GetSimple()
|
||||
@@ -68,7 +86,10 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<IEnumerable<DropZoneSimpleResp>>(result);
|
||||
}
|
||||
|
||||
// POST: api/DropZone
|
||||
/// <summary>
|
||||
/// Adds a new drop zone to the system.
|
||||
/// </summary>
|
||||
/// <param name="value">DropZoneReq object containing the new drop zone data.</param>
|
||||
[HttpPost]
|
||||
[EnableCors]
|
||||
public void Post([FromBody] DropZoneReq value)
|
||||
@@ -76,7 +97,12 @@ namespace skydiveLogs_api.Controllers
|
||||
_dropZoneService.AddNewDz(_mapper.Map<DropZone>(value));
|
||||
}
|
||||
|
||||
// PUT: api/DropZone/5
|
||||
/// <summary>
|
||||
/// Updates an existing drop zone.
|
||||
/// </summary>
|
||||
/// <param name="id">The drop zone ID to update.</param>
|
||||
/// <param name="value">DropZoneReq object containing the updated drop zone data.</param>
|
||||
/// <returns>True if successful, false otherwise.</returns>
|
||||
[HttpPut("{id}")]
|
||||
[EnableCors]
|
||||
public bool Put(int id, [FromBody] DropZoneReq value)
|
||||
@@ -84,7 +110,11 @@ namespace skydiveLogs_api.Controllers
|
||||
return _dropZoneService.UpdateDz(id, _mapper.Map<DropZone>(value));
|
||||
}
|
||||
|
||||
// PUT: api/DropZone/RemoveToFavorite/15
|
||||
/// <summary>
|
||||
/// Removes a drop zone from the user's favorites.
|
||||
/// </summary>
|
||||
/// <param name="id">The drop zone ID to remove from favorites.</param>
|
||||
/// <returns>True if successful, false otherwise.</returns>
|
||||
[HttpPut("RemoveToFavorite/{id}")]
|
||||
[EnableCors]
|
||||
public bool RemoveToFavorite(int id)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -23,7 +23,10 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
// DELETE: api/Image/5
|
||||
/// <summary>
|
||||
/// Deletes an image by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The image ID to delete.</param>
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
@@ -31,7 +34,10 @@ namespace skydiveLogs_api.Controllers
|
||||
_imageService.DeleteImageById(id);
|
||||
}
|
||||
|
||||
// GET: api/Image
|
||||
/// <summary>
|
||||
/// Retrieves a list of all images.
|
||||
/// </summary>
|
||||
/// <returns>A collection of ImageResp objects containing all images.</returns>
|
||||
[HttpGet]
|
||||
[EnableCors]
|
||||
public IEnumerable<ImageResp> Get()
|
||||
@@ -40,7 +46,11 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<IEnumerable<ImageResp>>(result);
|
||||
}
|
||||
|
||||
// GET: api/Image/5
|
||||
/// <summary>
|
||||
/// Retrieves an image by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The image ID to retrieve.</param>
|
||||
/// <returns>An ImageResp object containing the image details.</returns>
|
||||
[HttpGet("{id}")]
|
||||
[EnableCors]
|
||||
public ImageResp Get(int id)
|
||||
@@ -49,7 +59,10 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<ImageResp>(result);
|
||||
}
|
||||
|
||||
// POST: api/Image
|
||||
/// <summary>
|
||||
/// Adds a new image to the system.
|
||||
/// </summary>
|
||||
/// <param name="value">ImageReq object containing the new image data.</param>
|
||||
[HttpPost]
|
||||
[EnableCors]
|
||||
public void Post([FromBody] ImageReq value)
|
||||
@@ -57,7 +70,11 @@ namespace skydiveLogs_api.Controllers
|
||||
_imageService.AddNewImage(_mapper.Map<UserImage>(value));
|
||||
}
|
||||
|
||||
// PUT: api/Image/5
|
||||
/// <summary>
|
||||
/// Updates an existing image.
|
||||
/// </summary>
|
||||
/// <param name="id">The image ID to update.</param>
|
||||
/// <param name="value">ImageReq object containing the updated image data.</param>
|
||||
[HttpPut("{id}")]
|
||||
[EnableCors]
|
||||
public void Put(int id, [FromBody] ImageReq value)
|
||||
|
||||
@@ -23,7 +23,10 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
// DELETE: api/ApiWithActions/5
|
||||
/// <summary>
|
||||
/// Deletes a jump type by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The jump type ID to delete.</param>
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
@@ -31,7 +34,10 @@ namespace skydiveLogs_api.Controllers
|
||||
_jumpTypeService.DeleteJumpTypeById(id);
|
||||
}
|
||||
|
||||
// GET: api/JumpType
|
||||
/// <summary>
|
||||
/// Retrieves a list of all jump types.
|
||||
/// </summary>
|
||||
/// <returns>A collection of JumpTypeResp objects containing all jump types.</returns>
|
||||
[HttpGet]
|
||||
[EnableCors]
|
||||
public IEnumerable<JumpTypeResp> Get()
|
||||
@@ -40,7 +46,10 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<IEnumerable<JumpTypeResp>>(result);
|
||||
}
|
||||
|
||||
// GET: api/JumpType/tunnel
|
||||
/// <summary>
|
||||
/// Retrieves jump types used for tunnel operations.
|
||||
/// </summary>
|
||||
/// <returns>A collection of JumpTypeResp objects containing tunnel jump types.</returns>
|
||||
[HttpGet("tunnel")]
|
||||
[EnableCors]
|
||||
public IEnumerable<JumpTypeResp> GetForTunnel()
|
||||
@@ -49,7 +58,11 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<IEnumerable<JumpTypeResp>>(result);
|
||||
}
|
||||
|
||||
// GET: api/JumpType/5
|
||||
/// <summary>
|
||||
/// Retrieves a jump type by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The jump type ID to retrieve.</param>
|
||||
/// <returns>A JumpTypeResp object containing the jump type details.</returns>
|
||||
[HttpGet("{id}")]
|
||||
[EnableCors]
|
||||
public JumpTypeResp Get(int id)
|
||||
@@ -58,7 +71,10 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<JumpTypeResp>(result);
|
||||
}
|
||||
|
||||
// POST: api/JumpType
|
||||
/// <summary>
|
||||
/// Adds a new jump type to the system.
|
||||
/// </summary>
|
||||
/// <param name="value">JumpTypeReq object containing the new jump type data.</param>
|
||||
[HttpPost]
|
||||
[EnableCors]
|
||||
public void Post([FromBody] JumpTypeReq value)
|
||||
@@ -66,7 +82,11 @@ namespace skydiveLogs_api.Controllers
|
||||
_jumpTypeService.AddNewJumpType(_mapper.Map<JumpType>(value));
|
||||
}
|
||||
|
||||
// PUT: api/JumpType/5
|
||||
/// <summary>
|
||||
/// Updates an existing jump type.
|
||||
/// </summary>
|
||||
/// <param name="id">The jump type ID to update.</param>
|
||||
/// <param name="value">JumpTypeReq object containing the updated jump type data.</param>
|
||||
[HttpPut("{id}")]
|
||||
[EnableCors]
|
||||
public void Put(int id, [FromBody] JumpTypeReq value)
|
||||
|
||||
Reference in New Issue
Block a user