namespace 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(); 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(); } }