Compare commits

...

3 Commits

Author SHA1 Message Date
46f9535b4a Rename API to AuthorizationService 2024-08-15 14:03:27 +00:00
acb15df909 Rename services accordingly 2024-08-15 14:00:09 +00:00
7c2fccb79e Move to services/ 2024-08-15 14:00:06 +00:00
46 changed files with 61 additions and 61 deletions

View File

@ -1,7 +1,7 @@
using API.Models; using AuthorizationService.Models;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace API; namespace AuthorizationService;
public class AppDBContext(DbContextOptions<AppDBContext> options) : DbContext(options) public class AppDBContext(DbContextOptions<AppDBContext> options) : DbContext(options)
{ {

View File

@ -1,9 +1,9 @@
using API.Models; using AuthorizationService.Models;
using API.Persistence.Repositories; using AuthorizationService.Persistence.Repositories;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace API.Application.Users.Commands namespace AuthorizationService.Application.Users.Commands
{ {
public class CreateUser public class CreateUser
{ {

View File

@ -1,8 +1,8 @@
using API.Models; using AuthorizationService.Models;
using API.Persistence.Repositories; using AuthorizationService.Persistence.Repositories;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace API.Application.Users.Commands namespace AuthorizationService.Application.Users.Commands
{ {
public class DeleteUser public class DeleteUser
{ {

View File

@ -1,5 +1,5 @@
using API.Models; using AuthorizationService.Models;
using API.Persistence.Repositories; using AuthorizationService.Persistence.Repositories;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
@ -9,7 +9,7 @@ using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims; using System.Security.Claims;
using System.Text; using System.Text;
namespace API.Application.Users.Commands namespace AuthorizationService.Application.Users.Commands
{ {
public class LoginUser public class LoginUser
{ {

View File

@ -1,8 +1,8 @@
using API.Models; using AuthorizationService.Models;
using API.Persistence.Repositories; using AuthorizationService.Persistence.Repositories;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace API.Application.Users.Commands namespace AuthorizationService.Application.Users.Commands
{ {
public class UpdateUser public class UpdateUser
{ {

View File

@ -1,9 +1,9 @@
using API.Models; using AuthorizationService.Models;
using API.Persistence.Repositories; using AuthorizationService.Persistence.Repositories;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace API.Application.Users.Commands namespace AuthorizationService.Application.Users.Commands
{ {
public class UpdateUserPassword public class UpdateUserPassword
{ {

View File

@ -1,8 +1,8 @@
using API.Models; using AuthorizationService.Models;
using API.Persistence.Repositories; using AuthorizationService.Persistence.Repositories;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace API.Application.Users.Queries namespace AuthorizationService.Application.Users.Queries
{ {
public class QueryAllUsers public class QueryAllUsers
{ {

View File

@ -1,9 +1,9 @@
using API.Models; using AuthorizationService.Models;
using API.Persistence.Repositories; using AuthorizationService.Persistence.Repositories;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Templates.BlazorIdentity.Pages.Manage; using Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Templates.BlazorIdentity.Pages.Manage;
namespace API.Application.Users.Queries namespace AuthorizationService.Application.Users.Queries
{ {
public class QueryUserById public class QueryUserById
{ {

View File

@ -9,7 +9,7 @@
<WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected> <WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected>
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>True</WebStackScaffolding_IsReferencingScriptLibrariesSelected> <WebStackScaffolding_IsReferencingScriptLibrariesSelected>True</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
<WebStackScaffolding_LayoutPageFile /> <WebStackScaffolding_LayoutPageFile />
<WebStackScaffolding_DbContextTypeFullName>API.AppDBContext</WebStackScaffolding_DbContextTypeFullName> <WebStackScaffolding_DbContextTypeFullName>AuthorizationService.AppDBContext</WebStackScaffolding_DbContextTypeFullName>
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected> <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.8.34511.84 VisualStudioVersion = 17.8.34511.84
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "API", "API.csproj", "{5DF9B7D8-FA4E-4209-A677-C4CF4886D4B3}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthorizationService", "AuthorizationService.csproj", "{5DF9B7D8-FA4E-4209-A677-C4CF4886D4B3}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace API.Controllers namespace AuthorizationService.Controllers
{ {
[ApiController] [ApiController]
[Route("[controller]")] [Route("[controller]")]

View File

@ -1,6 +1,6 @@
using API.Application.Users.Commands; using AuthorizationService.Application.Users.Commands;
using API.Application.Users.Queries; using AuthorizationService.Application.Users.Queries;
using API.Models; using AuthorizationService.Models;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
@ -10,7 +10,7 @@ using System.Security.Claims;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace API.Controllers namespace AuthorizationService.Controllers
{ {
[Route("api/[controller]")] [Route("api/[controller]")]
[ApiController] [ApiController]

View File

@ -9,17 +9,17 @@ EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release
WORKDIR /src WORKDIR /src
COPY ["API.csproj", "."] COPY ["AuthorizationService.csproj", "."]
RUN dotnet restore "./././API.csproj" RUN dotnet restore "./././AuthorizationService.csproj"
COPY . . COPY . .
WORKDIR "/src/." WORKDIR "/src/."
RUN dotnet build "./API.csproj" -c $BUILD_CONFIGURATION -o /app/build RUN dotnet build "./AuthorizationService.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish FROM build AS publish
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false RUN dotnet publish "./AuthorizationService.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "API.dll"] ENTRYPOINT ["dotnet", "AuthorizationService.dll"]

View File

@ -1,5 +1,5 @@
// <auto-generated /> // <auto-generated />
using API; using AuthorizationService;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable #nullable disable
namespace API.Migrations namespace AuthorizationService.Migrations
{ {
[DbContext(typeof(AppDBContext))] [DbContext(typeof(AppDBContext))]
[Migration("20240812084720_CreateUser")] [Migration("20240812084720_CreateUser")]
@ -19,7 +19,7 @@ namespace API.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.0-preview.6.24327.4"); modelBuilder.HasAnnotation("ProductVersion", "9.0.0-preview.6.24327.4");
modelBuilder.Entity("API.Models.User", b => modelBuilder.Entity("AuthorizationService.Models.User", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View File

@ -2,7 +2,7 @@
#nullable disable #nullable disable
namespace API.Migrations namespace AuthorizationService.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class CreateUser : Migration public partial class CreateUser : Migration

View File

@ -1,6 +1,6 @@
// <auto-generated /> // <auto-generated />
using System; using System;
using API; using AuthorizationService;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable #nullable disable
namespace API.Migrations namespace AuthorizationService.Migrations
{ {
[DbContext(typeof(AppDBContext))] [DbContext(typeof(AppDBContext))]
[Migration("20240813075158_ChangedUserWithGuid")] [Migration("20240813075158_ChangedUserWithGuid")]
@ -20,7 +20,7 @@ namespace API.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); modelBuilder.HasAnnotation("ProductVersion", "8.0.7");
modelBuilder.Entity("API.Models.User", b => modelBuilder.Entity("AuthorizationService.Models.User", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View File

@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable
namespace API.Migrations namespace AuthorizationService.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class ChangedUserWithGuid : Migration public partial class ChangedUserWithGuid : Migration

View File

@ -1,6 +1,6 @@
// <auto-generated /> // <auto-generated />
using System; using System;
using API; using AuthorizationService;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable #nullable disable
namespace API.Migrations namespace AuthorizationService.Migrations
{ {
[DbContext(typeof(AppDBContext))] [DbContext(typeof(AppDBContext))]
[Migration("20240813112418_NoMoreGuid")] [Migration("20240813112418_NoMoreGuid")]
@ -20,7 +20,7 @@ namespace API.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); modelBuilder.HasAnnotation("ProductVersion", "8.0.7");
modelBuilder.Entity("API.Models.User", b => modelBuilder.Entity("AuthorizationService.Models.User", b =>
{ {
b.Property<string>("Id") b.Property<string>("Id")
.HasColumnType("TEXT"); .HasColumnType("TEXT");

View File

@ -2,7 +2,7 @@
#nullable disable #nullable disable
namespace API.Migrations namespace AuthorizationService.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class NoMoreGuid : Migration public partial class NoMoreGuid : Migration

View File

@ -1,13 +1,13 @@
// <auto-generated /> // <auto-generated />
using System; using System;
using API; using AuthorizationService;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable #nullable disable
namespace API.Migrations namespace AuthorizationService.Migrations
{ {
[DbContext(typeof(AppDBContext))] [DbContext(typeof(AppDBContext))]
partial class AppDBContextModelSnapshot : ModelSnapshot partial class AppDBContextModelSnapshot : ModelSnapshot
@ -17,7 +17,7 @@ namespace API.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); modelBuilder.HasAnnotation("ProductVersion", "8.0.7");
modelBuilder.Entity("API.Models.User", b => modelBuilder.Entity("AuthorizationService.Models.User", b =>
{ {
b.Property<string>("Id") b.Property<string>("Id")
.HasColumnType("TEXT"); .HasColumnType("TEXT");

View File

@ -1,4 +1,4 @@
namespace API.Models namespace AuthorizationService.Models
{ {
public class BaseModel public class BaseModel
{ {

View File

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace API.Models; namespace AuthorizationService.Models;
public class User : BaseModel public class User : BaseModel
{ {

View File

@ -1,6 +1,6 @@
using API.Models; using AuthorizationService.Models;
namespace API.Persistence.Repositories namespace AuthorizationService.Persistence.Repositories
{ {
public interface IUserRepository public interface IUserRepository
{ {

View File

@ -1,8 +1,8 @@
using API.Models; using AuthorizationService.Models;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Templates.BlazorIdentity.Pages; using Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Templates.BlazorIdentity.Pages;
namespace API.Persistence.Repositories namespace AuthorizationService.Persistence.Repositories
{ {
public class UserRepository(AppDBContext context) : IUserRepository public class UserRepository(AppDBContext context) : IUserRepository
{ {

View File

@ -1,13 +1,13 @@
using API.Application.Users.Commands; using AuthorizationService.Application.Users.Commands;
using API.Application.Users.Queries; using AuthorizationService.Application.Users.Queries;
using API.Persistence.Repositories; using AuthorizationService.Persistence.Repositories;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using System.Text; using System.Text;
namespace API namespace AuthorizationService
{ {
public class Program public class Program
{ {

View File

@ -7,7 +7,7 @@ Environment=DOTNET_ROOT=/home/reimar/.dotnet
Environment=PATH=$PATH:/home/reimar/.dotnet Environment=PATH=$PATH:/home/reimar/.dotnet
Environment=DEFAULT_CONNECTION="Data Source=/home/reimar/skantravels/database.sqlite3" Environment=DEFAULT_CONNECTION="Data Source=/home/reimar/skantravels/database.sqlite3"
ExecStartPre=/home/reimar/skantravels/efbundle ExecStartPre=/home/reimar/skantravels/efbundle
ExecStart=/home/reimar/skantravels/API --urls=http://0.0.0.0:5001 ExecStart=/home/reimar/skantravels/AuthorizationService --urls=http://0.0.0.0:5001
Type=simple Type=simple
[Install] [Install]