This commit is contained in:
Халимов Рустам
2026-02-09 23:54:03 +03:00
parent c98c96e408
commit ee40b38968
65 changed files with 6157 additions and 957 deletions
@@ -0,0 +1,35 @@
using MediatR;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Nashel.Modules.Identity.Application.Commands;
namespace Nashel.Modules.Identity.Presentation.Endpoints;
public static class IdentityEndpoints
{
public static void MapIdentityEndpoints(this IEndpointRouteBuilder app)
{
var authGroup = app.MapGroup("/api/auth").WithTags("Auth");
authGroup.MapPost("/register", async (RegisterUserCommand command, ISender sender) =>
{
var result = await sender.Send(command);
return Results.Ok(result);
});
authGroup.MapPost("/login", async (LoginCommand command, ISender sender) =>
{
var token = await sender.Send(command);
return Results.Ok(new { Token = token });
});
var profileGroup = app.MapGroup("/api/profile").WithTags("Profile").RequireAuthorization();
profileGroup.MapPost("/become-performer", async (ISender sender) =>
{
await sender.Send(new BecomePerformerCommand());
return Results.Ok();
});
}
}
@@ -1,15 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\Nashel.Modules.Identity.Application\Nashel.Modules.Identity.Application.csproj" />
<ProjectReference Include="..\Application\Nashel.Modules.Identity.Application.csproj" />
</ItemGroup>
<PropertyGroup>
<RootNamespace>Nashel.Modules.Identity.Presentation</RootNamespace>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>