Add comments
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user