Add initial implementation of API, database, and user management components.

This commit is contained in:
2026-03-15 23:17:51 +01:00
commit 0543120f3b
53 changed files with 2241 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
namespace MikrocopApi.Exceptions;
public abstract class AppException : Exception
{
protected AppException(string message) : base(message)
{
}
public abstract int StatusCode { get; }
public abstract string Title { get; }
}

View File

@@ -0,0 +1,11 @@
namespace MikrocopApi.Exceptions;
public sealed class BadRequestException : AppException
{
public BadRequestException(string message) : base(message)
{
}
public override int StatusCode => StatusCodes.Status400BadRequest;
public override string Title => "Bad Request";
}

View File

@@ -0,0 +1,11 @@
namespace MikrocopApi.Exceptions;
public sealed class ConflictException : AppException
{
public ConflictException(string message) : base(message)
{
}
public override int StatusCode => StatusCodes.Status409Conflict;
public override string Title => "Conflict";
}

View File

@@ -0,0 +1,11 @@
namespace MikrocopApi.Exceptions;
public sealed class NotFoundException : AppException
{
public NotFoundException(string message) : base(message)
{
}
public override int StatusCode => StatusCodes.Status404NotFound;
public override string Title => "Not Found";
}

View File

@@ -0,0 +1,11 @@
namespace MikrocopApi.Exceptions;
public sealed class UnauthorizedException : AppException
{
public UnauthorizedException(string message) : base(message)
{
}
public override int StatusCode => StatusCodes.Status401Unauthorized;
public override string Title => "Unauthorized";
}