Something went wrong. Try again.
Test web dev.
Something went wrong. Try again.
123456789101112131415161718192021222324252627namespace TestWeb.Core.Users;
using Utils;
public static class UsersModule{ public const string Prefix = "/api/users";
public static void MapEndpoints(IEndpointRouteBuilder endpoints) { var group = endpoints.MapGroup(Prefix) .WithTags("Users"); group.MapPost("/", CreateUserEndpoint.Handle) .WithSummary("Create a user") .WithRequestValidation<CreateUserEndpoint.Request>(); group.MapDelete("/{id}", DeleteUserEndpoint.Handle) .WithSummary("Delete user by id"); group.MapGet("/{id}", GetUserEndpoint.Handle) .WithSummary("Get user by id"); group.MapGet("/", GetUsersEndpoint.Handle) .WithSummary("Get user list"); group.MapPut("/{id}", UpdateUserEndpoint.Handle) .WithSummary("Update user by id") .WithRequestValidation<UpdateUserEndpoint.Request>(); }}