feat: add default response type
Some checks failed
Build and Deploy Docker Container / build-and-deploy (push) Failing after 1m30s
.NET Test Pipeline / build-and-test (push) Failing after 1m7s

This commit is contained in:
Polianin Nikita 2024-12-23 06:29:29 +03:00
parent 57b9819d13
commit 55562a9f00

View File

@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
@ -58,7 +59,10 @@ public class Program
builder.Host.AddCustomSerilog(); builder.Host.AddCustomSerilog();
AddDatabase(builder.Services, builder.Configuration, healthCheckBuilder); AddDatabase(builder.Services, builder.Configuration, healthCheckBuilder);
builder.Services.AddControllers(); builder.Services.AddControllers(options =>
{
options.Filters.Add(new ProducesResponseTypeAttribute(StatusCodes.Status500InternalServerError));
});
builder.Services.AddSingleton<IMaintenanceModeNotConfigureService, MaintenanceModeNotConfigureService>(); builder.Services.AddSingleton<IMaintenanceModeNotConfigureService, MaintenanceModeNotConfigureService>();
builder.Services.AddSingleton<IMaintenanceModeService, MaintenanceModeService>(); builder.Services.AddSingleton<IMaintenanceModeService, MaintenanceModeService>();