This commit is contained in:
commit
1199bef0c8
45 changed files with 1200 additions and 0 deletions
26
src/Core/Vehicles/VehiclesModule.cs
Executable file
26
src/Core/Vehicles/VehiclesModule.cs
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
namespace TestWeb.Core.Vehicles;
|
||||
|
||||
using Utils;
|
||||
|
||||
public static class VehiclesModule
|
||||
{
|
||||
public const string Prefix = "/api/vehicles";
|
||||
|
||||
public static void MapEndpoints(IEndpointRouteBuilder endpoints)
|
||||
{
|
||||
var group = endpoints.MapGroup(Prefix)
|
||||
.WithTags("Vehicles");
|
||||
group.MapPost("/", CreateVehicleEndpoint.Handle)
|
||||
.WithSummary("Create a vehicle")
|
||||
.WithRequestValidation<CreateVehicleEndpoint.Request>();
|
||||
group.MapDelete("/{id}", DeleteVehicleEndpoint.Handle)
|
||||
.WithSummary("Delete vehicle by id");
|
||||
group.MapGet("/{id}", GetVehicleEndpoint.Handle)
|
||||
.WithSummary("Get vehicle by id");
|
||||
group.MapGet("/", GetVehiclesEndpoint.Handle)
|
||||
.WithSummary("Get vehicle list");
|
||||
group.MapPut("/{id}", UpdateVehicleEndpoint.Handle)
|
||||
.WithSummary("Update vehicle by id")
|
||||
.WithRequestValidation<UpdateVehicleEndpoint.Request>();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue