Test updates by AI
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
using AutoMapper;
|
||||
using System.Collections.Generic;
|
||||
using AutoMapper;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using skydiveLogs_api.DataContract;
|
||||
using skydiveLogs_api.Domain;
|
||||
using skydiveLogs_api.DomainBusiness.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace skydiveLogs_api.Controllers
|
||||
{
|
||||
@@ -23,7 +23,10 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
// DELETE: api/ApiWithActions/5
|
||||
/// <summary>
|
||||
/// Deletes an aircraft by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The aircraft ID to delete.</param>
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
@@ -31,7 +34,10 @@ namespace skydiveLogs_api.Controllers
|
||||
_aircraftService.DeleteAircraftById(id);
|
||||
}
|
||||
|
||||
// GET: api/Aircraft
|
||||
/// <summary>
|
||||
/// Retrieves a list of all aircraft.
|
||||
/// </summary>
|
||||
/// <returns>A collection of AircraftResp objects containing all aircraft data.</returns>
|
||||
[HttpGet]
|
||||
[EnableCors]
|
||||
public IEnumerable<AircraftResp> Get()
|
||||
@@ -40,7 +46,11 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<IEnumerable<AircraftResp>>(result);
|
||||
}
|
||||
|
||||
// GET: api/Aircraft/5
|
||||
/// <summary>
|
||||
/// Retrieves an aircraft by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The aircraft ID to retrieve.</param>
|
||||
/// <returns>An AircraftResp object containing the aircraft details.</returns>
|
||||
[HttpGet("{id}")]
|
||||
[EnableCors]
|
||||
public AircraftResp Get(int id)
|
||||
@@ -49,6 +59,10 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<AircraftResp>(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a simplified list of all aircraft.
|
||||
/// </summary>
|
||||
/// <returns>A collection of AircraftSimpleResp objects containing simplified aircraft data.</returns>
|
||||
[HttpGet("GetSimple")]
|
||||
[EnableCors]
|
||||
public IEnumerable<AircraftSimpleResp> GetSimple()
|
||||
@@ -57,7 +71,10 @@ namespace skydiveLogs_api.Controllers
|
||||
return _mapper.Map<IEnumerable<AircraftSimpleResp>>(result);
|
||||
}
|
||||
|
||||
// POST: api/Aircraft
|
||||
/// <summary>
|
||||
/// Adds a new aircraft to the system.
|
||||
/// </summary>
|
||||
/// <param name="value">AircraftReq object containing the new aircraft data.</param>
|
||||
[HttpPost]
|
||||
[EnableCors]
|
||||
public void Post([FromBody] AircraftReq value)
|
||||
@@ -65,7 +82,11 @@ namespace skydiveLogs_api.Controllers
|
||||
_aircraftService.AddNewAircraft(_mapper.Map<Aircraft>(value));
|
||||
}
|
||||
|
||||
// PUT: api/Aircraft/5
|
||||
/// <summary>
|
||||
/// Updates an existing aircraft.
|
||||
/// </summary>
|
||||
/// <param name="id">The aircraft ID to update.</param>
|
||||
/// <param name="value">AircraftReq object containing the updated aircraft data.</param>
|
||||
[HttpPut("{id}")]
|
||||
[EnableCors]
|
||||
public void Put(int id, [FromBody] AircraftReq value)
|
||||
@@ -82,4 +103,4 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user