-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
62 lines (50 loc) · 1.79 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using SecurityAPI.configuration;
using SecurityAPI.endpoint;
using Academico.System.Configuration;
var builder = WebApplication.CreateBuilder(args);
{
// Configuração manual do Swagger para agrupar os endpoints
var endpointGroups = new Dictionary<string, string[]>
{
{ "User Operations", new[] { "user/v1/autenticar", "user/v1/autenticar/ambiente", "user/v1/insert", "user/v1/update/{id:guid}" } }
};
var services = builder.Services;
services.AddEndpointsApiExplorer();
services.AddSweggerConfiguration();
services.AddInjectConfiguration();
services.AddSystemContextConfiguration();
services.AddFluentValidationConfiguration();
services.AddMediatorConfiguration();
services.AddOptions();
}
await using var app = builder.Build();
{
app.AddUserEndpoint();
app.AddPlataformEndpoint();
//app.AddApplicationEndpoint();
//app.AddOrganizationEndpoint();
//app.AddRouterEndpoint();
//app.AddRoleEndpoint();
//app.AddServiceEndpoint();
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "API V1");
// Configuração manual do Swagger para agrupar os endpoints
var endpointGroups = new Dictionary<string, string[]>
{
{ "User Operations", new[] { "user/v1/autenticar", "user/v1/autenticar/ambiente", "user/v1/insert", "user/v1/update/{id:guid}" } }
};
foreach (var group in endpointGroups)
{
foreach (var endpoint in group.Value)
{
c.SwaggerEndpoint($"/swagger/v1/swagger.json", group.Key);
}
}
});
//app.UseAuthentication();
//app.UseAuthorization();
app.UseHttpsRedirection();
}
await app.RunAsync();