feat: MediaController
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using MemeVault.Api.Middleware;
|
||||
using MemeVault.Api.Auth;
|
||||
using System.Text;
|
||||
using MemeVault.Api.Options;
|
||||
@@ -24,6 +25,8 @@ builder.Services.Configure<JwtOptions>(
|
||||
|
||||
builder.Services.AddSingleton<TelegramInitDataValidator>();
|
||||
builder.Services.AddSingleton<JwtTokenService>();
|
||||
builder.Services.AddHttpContextAccessor();
|
||||
builder.Services.AddScoped<CurrentUser>();
|
||||
|
||||
var jwtOpts = builder.Configuration.GetSection(JwtOptions.Section).Get<JwtOptions>()!;
|
||||
|
||||
@@ -45,6 +48,8 @@ builder.Services
|
||||
};
|
||||
});
|
||||
|
||||
builder.Services.AddProblemDetails();
|
||||
builder.Services.AddExceptionHandler<DomainExceptionHandler>();
|
||||
builder.Services.AddAuthorization();
|
||||
builder.Services.AddControllers();
|
||||
|
||||
@@ -53,16 +58,12 @@ builder.Services.AddEndpointsApiExplorer();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseExceptionHandler();
|
||||
app.UseHttpMetrics();
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapGet("/health", () => Results.Ok(new { status = "ok" }));
|
||||
// TODO: /api/media GET — список медиа пользователя
|
||||
// TODO: /api/media/{id} PATCH — обновить caption / теги
|
||||
// TODO: /api/media/{id} DELETE
|
||||
// TODO: /api/tags GET — теги пользователя
|
||||
// TODO: /api/collections GET/POST — коллекции
|
||||
|
||||
app.MapControllers();
|
||||
app.MapMetrics();
|
||||
|
||||
Reference in New Issue
Block a user