Presentation 2

This commit is contained in:
2026-02-08 20:17:01 +01:00
parent 41793f00c1
commit 70a1cf1544
17 changed files with 681 additions and 113 deletions

502
.gitignore vendored
View File

@@ -1,32 +1,486 @@
# .NET ## Ignore Visual Studio temporary files, build results, and
dotnet/**/bin/ ## files generated by popular Visual Studio add-ons.
dotnet/**/obj/ ##
dotnet/**/*.user ## Get latest from `dotnet new gitignore`
dotnet/**/*.vs/
dotnet/**/.vs/
# React/Node # dotenv files
react/node_modules/ .env
react/dist/
react/.env
react/.env.local
react/.env.*.local
# IDE # User-specific files
.idea/ *.rsuser
.vscode/
*.suo *.suo
*.ntvs* *.user
*.njsproj *.userosscache
*.sln.docstates *.sln.docstates
# OS # User-specific files (MonoDevelop/Xamarin Studio)
.DS_Store *.userprefs
Thumbs.db
# Logs # Mono auto generated files
mono_crash.*
# Build results
**/bin/
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
bin\\[Dd]ebug/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET
project.lock.json
project.fragment.lock.json
artifacts/
# Tye
.tye/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
# but not Directory.Build.rsp, as it configures directory-level build defaults
!Directory.Build.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log *.log
npm-debug.log* *.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Claude Code plans # Chutzpah Test files
.claude/ _Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
.idea/
##
## Visual studio for Mac
##
# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/
# content below from: https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# content below from: https://github.com/github/gitignore/blob/main/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# Vim temporary swap files
*.swp

18
docker/docker-compose.yml Normal file
View File

@@ -0,0 +1,18 @@
version: "3.9"
services:
postgres:
image: postgres:18
container_name: postgres
restart: unless-stopped
environment:
POSTGRES_DB: aips_db
POSTGRES_USER: user
POSTGRES_PASSWORD: secret
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql
volumes:
pgdata:

77
dotnet/.gitignore vendored
View File

@@ -1,77 +0,0 @@
# Environment variables with secrets
.env
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio cache/options directory
.vs/
# JetBrains Rider
.idea/
*.sln.iml
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# NuGet Packages
*.nupkg
*.snupkg
**/packages/*
!**/packages/build/
*.nuget.props
*.nuget.targets
# Docker
**/.dockerignore

View File

@@ -8,6 +8,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.2" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.2" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" />
</ItemGroup> </ItemGroup>

View File

@@ -3,4 +3,4 @@ using AipsCore.Domain.Models.User.ValueObjects;
namespace AipsCore.Application.Models.User.Command.CreateUser; namespace AipsCore.Application.Models.User.Command.CreateUser;
public record CreateUserCommand(string Username, string Email) : ICommand<UserId>, ICommand; public record CreateUserCommand(string Username, string Email) : ICommand<UserId>;

View File

@@ -1,10 +1,11 @@
using AipsCore.Application.Abstract.Command; using AipsCore.Application.Abstract.Command;
using AipsCore.Domain.Abstract; using AipsCore.Domain.Abstract;
using AipsCore.Domain.Models.User.External; using AipsCore.Domain.Models.User.External;
using AipsCore.Domain.Models.User.ValueObjects;
namespace AipsCore.Application.Models.User.Command.CreateUser; namespace AipsCore.Application.Models.User.Command.CreateUser;
public class CreateUserCommandHandler : ICommandHandler<CreateUserCommand> public class CreateUserCommandHandler : ICommandHandler<CreateUserCommand, UserId>
{ {
private readonly IUserRepository _userRepository; private readonly IUserRepository _userRepository;
private readonly IUnitOfWork _unitOfWork; private readonly IUnitOfWork _unitOfWork;
@@ -15,11 +16,13 @@ public class CreateUserCommandHandler : ICommandHandler<CreateUserCommand>
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
} }
public async Task Handle(CreateUserCommand command, CancellationToken cancellationToken = default) public async Task<UserId> Handle(CreateUserCommand command, CancellationToken cancellationToken = default)
{ {
var user = Domain.Models.User.User.Create(command.Email, command.Username); var user = Domain.Models.User.User.Create(command.Email, command.Username);
await _userRepository.Save(user, cancellationToken); await _userRepository.Save(user, cancellationToken);
await _unitOfWork.SaveChangesAsync(cancellationToken); await _unitOfWork.SaveChangesAsync(cancellationToken);
return user.Id;
} }
} }

View File

@@ -1,5 +1,8 @@
using AipsCore.Application.Abstract; using AipsCore.Application.Abstract;
using AipsCore.Application.Abstract.Command;
using AipsCore.Application.Common.Dispatcher; using AipsCore.Application.Common.Dispatcher;
using AipsCore.Application.Models.User.Command.CreateUser;
using AipsCore.Domain.Models.User.ValueObjects;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@@ -10,7 +13,7 @@ public static class AipsRegistrationExtensions
public static IServiceCollection AddAips(this IServiceCollection services, IConfiguration configuration) public static IServiceCollection AddAips(this IServiceCollection services, IConfiguration configuration)
{ {
services.AddHandlersFromAssembly(typeof(Dispatcher).Assembly); services.AddHandlersFromAssembly(typeof(Dispatcher).Assembly);
services.AddSingleton<IDispatcher, Dispatcher>(); services.AddTransient<IDispatcher, Dispatcher>();
services.AddPersistence(configuration); services.AddPersistence(configuration);

View File

@@ -33,7 +33,7 @@ public static class HandlerRegistrationExtensions
if (!handlerInterfaces.Contains(genericDef)) if (!handlerInterfaces.Contains(genericDef))
continue; continue;
services.AddScoped(@interface, type); services.AddTransient(@interface, type);
} }
} }

View File

@@ -1,5 +1,8 @@
using AipsCore.Domain.Abstract;
using AipsCore.Domain.Models.User.External;
using AipsCore.Infrastructure.DI.Configuration; using AipsCore.Infrastructure.DI.Configuration;
using AipsCore.Infrastructure.Persistence.Db; using AipsCore.Infrastructure.Persistence.Db;
using AipsCore.Infrastructure.Persistence.User;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@@ -17,6 +20,9 @@ public static class PersistenceRegistrationExtensions
npgsql.MigrationsAssembly(typeof(AipsDbContext).Assembly.FullName); npgsql.MigrationsAssembly(typeof(AipsDbContext).Assembly.FullName);
}); });
}); });
services.AddTransient<IUnitOfWork, EfUnitOfWork>();
services.AddTransient<IUserRepository, UserRepository>();
return services; return services;
} }

View File

@@ -5,4 +5,10 @@ namespace AipsCore.Infrastructure.Persistence.Db;
public class AipsDbContext : DbContext public class AipsDbContext : DbContext
{ {
public DbSet<User.User> Users { get; set; } public DbSet<User.User> Users { get; set; }
public AipsDbContext(DbContextOptions options)
: base(options)
{
}
} }

View File

@@ -0,0 +1,51 @@
// <auto-generated />
using System;
using AipsCore.Infrastructure.Persistence.Db;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace AipsCore.Infrastructure.Persistence.Db.Migrations
{
[DbContext(typeof(AipsDbContext))]
[Migration("20260205205236_Init")]
partial class Init
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("AipsCore.Infrastructure.Persistence.User.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,35 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AipsCore.Infrastructure.Persistence.Db.Migrations
{
/// <inheritdoc />
public partial class Init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Username = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
Email = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Users");
}
}
}

View File

@@ -0,0 +1,48 @@
// <auto-generated />
using System;
using AipsCore.Infrastructure.Persistence.Db;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace AipsCore.Infrastructure.Persistence.Db.Migrations
{
[DbContext(typeof(AipsDbContext))]
partial class AipsDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("AipsCore.Infrastructure.Persistence.User.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -27,7 +27,8 @@ public class UserRepository : IUserRepository
public async Task Save(Domain.Models.User.User user, CancellationToken cancellationToken = default) public async Task Save(Domain.Models.User.User user, CancellationToken cancellationToken = default)
{ {
var userEntity = await _context.Users.FindAsync([new Guid(user.Id.IdValue), cancellationToken], cancellationToken: cancellationToken); // ReSharper disable once MethodSupportsCancellation
var userEntity = await _context.Users.FindAsync(new Guid(user.Id.IdValue));
if (userEntity is not null) if (userEntity is not null)
{ {

View File

@@ -7,7 +7,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DotNetEnv" Version="3.1.1" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1"/> <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -1,5 +1,6 @@
using AipsCore.Application.Abstract; using AipsCore.Application.Abstract;
using AipsCore.Application.Models.User.Command.CreateUser; using AipsCore.Application.Models.User.Command.CreateUser;
using AipsCore.Domain.Common.Validation;
using AipsCore.Domain.Models.User.ValueObjects; using AipsCore.Domain.Models.User.ValueObjects;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
@@ -12,8 +13,14 @@ public class UserController : ControllerBase
[HttpPost] [HttpPost]
public async Task<ActionResult<int>> CreateUser(CreateUserCommand command, IDispatcher dispatcher, CancellationToken cancellationToken) public async Task<ActionResult<int>> CreateUser(CreateUserCommand command, IDispatcher dispatcher, CancellationToken cancellationToken)
{ {
var userId = await dispatcher.Execute<UserId>(command, cancellationToken); try
{
return Ok(userId.IdValue); var userId = await dispatcher.Execute(command, cancellationToken);
return Ok(userId.IdValue);
}
catch (ValidationException validationException)
{
return BadRequest(validationException.ValidationErrors);
}
} }
} }

View File

@@ -1,13 +1,16 @@
using AipsCore.Infrastructure.DI; using AipsCore.Infrastructure.DI;
using DotNetEnv;
Env.Load();
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
var configuration = builder.Configuration; builder.Configuration.AddEnvironmentVariables();
builder.Services.AddControllers(); builder.Services.AddControllers();
builder.Services.AddOpenApi(); builder.Services.AddOpenApi();
builder.Services.AddAips(configuration); builder.Services.AddAips(builder.Configuration);
var app = builder.Build(); var app = builder.Build();
@@ -17,7 +20,6 @@ if (app.Environment.IsDevelopment())
app.MapOpenApi(); app.MapOpenApi();
} }
app.UseHttpsRedirection();
app.UseAuthorization(); app.UseAuthorization();