From 83203f967d63f7991a0553950ca5b1ded77e9cd6 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Sun, 23 Jul 2023 22:50:03 -0700 Subject: [PATCH] Moved domain objects from the API to Domain --- .../Domain/Results/AuthenticationResult.cs | 12 ------------ .../Newsbot.Collector.Domain.csproj | 2 ++ .../Requests/NewRoleRequest.cs | 2 +- .../Requests/RegisterUserRequest.cs | 2 +- .../Requests/UserLoginRequest.cs | 2 +- .../Requests/UserRefreshTokenRequest.cs | 2 +- .../Response/AuthFailedResponse.cs | 2 +- .../Response/AuthSuccessfulResponse.cs | 2 +- .../Results/AuthenticationResult.cs | 7 +++++++ 9 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 Newsbot.Collector.Api/Domain/Results/AuthenticationResult.cs rename {Newsbot.Collector.Api/Domain => Newsbot.Collector.Domain}/Requests/NewRoleRequest.cs (69%) rename {Newsbot.Collector.Api/Domain => Newsbot.Collector.Domain}/Requests/RegisterUserRequest.cs (81%) rename {Newsbot.Collector.Api/Domain => Newsbot.Collector.Domain}/Requests/UserLoginRequest.cs (78%) rename {Newsbot.Collector.Api/Domain => Newsbot.Collector.Domain}/Requests/UserRefreshTokenRequest.cs (71%) rename {Newsbot.Collector.Api/Domain => Newsbot.Collector.Domain}/Response/AuthFailedResponse.cs (64%) rename {Newsbot.Collector.Api/Domain => Newsbot.Collector.Domain}/Response/AuthSuccessfulResponse.cs (79%) create mode 100644 Newsbot.Collector.Domain/Results/AuthenticationResult.cs diff --git a/Newsbot.Collector.Api/Domain/Results/AuthenticationResult.cs b/Newsbot.Collector.Api/Domain/Results/AuthenticationResult.cs deleted file mode 100644 index 4cd4516..0000000 --- a/Newsbot.Collector.Api/Domain/Results/AuthenticationResult.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections; - -namespace Newsbot.Collector.Api.Domain.Results; - -public class AuthenticationResult -{ - public string? Token { get; set; } - public string? RefreshToken { get; set; } - - public bool IsSuccessful { get; set; } - public IEnumerable? ErrorMessage { get; set; } -} \ No newline at end of file diff --git a/Newsbot.Collector.Domain/Newsbot.Collector.Domain.csproj b/Newsbot.Collector.Domain/Newsbot.Collector.Domain.csproj index b355dd0..462ff5b 100644 --- a/Newsbot.Collector.Domain/Newsbot.Collector.Domain.csproj +++ b/Newsbot.Collector.Domain/Newsbot.Collector.Domain.csproj @@ -4,6 +4,8 @@ net7.0 enable enable + + true diff --git a/Newsbot.Collector.Api/Domain/Requests/NewRoleRequest.cs b/Newsbot.Collector.Domain/Requests/NewRoleRequest.cs similarity index 69% rename from Newsbot.Collector.Api/Domain/Requests/NewRoleRequest.cs rename to Newsbot.Collector.Domain/Requests/NewRoleRequest.cs index 706ebef..b15867d 100644 --- a/Newsbot.Collector.Api/Domain/Requests/NewRoleRequest.cs +++ b/Newsbot.Collector.Domain/Requests/NewRoleRequest.cs @@ -1,4 +1,4 @@ -namespace Newsbot.Collector.Api.Domain.Requests; +namespace Newsbot.Collector.Domain.Requests; public class AddRoleRequest { diff --git a/Newsbot.Collector.Api/Domain/Requests/RegisterUserRequest.cs b/Newsbot.Collector.Domain/Requests/RegisterUserRequest.cs similarity index 81% rename from Newsbot.Collector.Api/Domain/Requests/RegisterUserRequest.cs rename to Newsbot.Collector.Domain/Requests/RegisterUserRequest.cs index 461615c..bde90c6 100644 --- a/Newsbot.Collector.Api/Domain/Requests/RegisterUserRequest.cs +++ b/Newsbot.Collector.Domain/Requests/RegisterUserRequest.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Newsbot.Collector.Api.Domain.Requests; +namespace Newsbot.Collector.Domain.Requests; public class RegisterUserRequest { diff --git a/Newsbot.Collector.Api/Domain/Requests/UserLoginRequest.cs b/Newsbot.Collector.Domain/Requests/UserLoginRequest.cs similarity index 78% rename from Newsbot.Collector.Api/Domain/Requests/UserLoginRequest.cs rename to Newsbot.Collector.Domain/Requests/UserLoginRequest.cs index 8b34017..6386e4f 100644 --- a/Newsbot.Collector.Api/Domain/Requests/UserLoginRequest.cs +++ b/Newsbot.Collector.Domain/Requests/UserLoginRequest.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Newsbot.Collector.Api.Domain.Requests; +namespace Newsbot.Collector.Domain.Requests; public class UserLoginRequest { diff --git a/Newsbot.Collector.Api/Domain/Requests/UserRefreshTokenRequest.cs b/Newsbot.Collector.Domain/Requests/UserRefreshTokenRequest.cs similarity index 71% rename from Newsbot.Collector.Api/Domain/Requests/UserRefreshTokenRequest.cs rename to Newsbot.Collector.Domain/Requests/UserRefreshTokenRequest.cs index 9556e49..9c20338 100644 --- a/Newsbot.Collector.Api/Domain/Requests/UserRefreshTokenRequest.cs +++ b/Newsbot.Collector.Domain/Requests/UserRefreshTokenRequest.cs @@ -1,4 +1,4 @@ -namespace Newsbot.Collector.Api.Domain.Requests; +namespace Newsbot.Collector.Domain.Requests; public class UserRefreshTokenRequest { diff --git a/Newsbot.Collector.Api/Domain/Response/AuthFailedResponse.cs b/Newsbot.Collector.Domain/Response/AuthFailedResponse.cs similarity index 64% rename from Newsbot.Collector.Api/Domain/Response/AuthFailedResponse.cs rename to Newsbot.Collector.Domain/Response/AuthFailedResponse.cs index 79ecf83..3c3e6f0 100644 --- a/Newsbot.Collector.Api/Domain/Response/AuthFailedResponse.cs +++ b/Newsbot.Collector.Domain/Response/AuthFailedResponse.cs @@ -1,4 +1,4 @@ -namespace Newsbot.Collector.Api.Domain.Response; +namespace Newsbot.Collector.Domain.Response; public class AuthFailedResponse { diff --git a/Newsbot.Collector.Api/Domain/Response/AuthSuccessfulResponse.cs b/Newsbot.Collector.Domain/Response/AuthSuccessfulResponse.cs similarity index 79% rename from Newsbot.Collector.Api/Domain/Response/AuthSuccessfulResponse.cs rename to Newsbot.Collector.Domain/Response/AuthSuccessfulResponse.cs index dcb42ef..ebdcf2a 100644 --- a/Newsbot.Collector.Api/Domain/Response/AuthSuccessfulResponse.cs +++ b/Newsbot.Collector.Domain/Response/AuthSuccessfulResponse.cs @@ -1,4 +1,4 @@ -namespace Newsbot.Collector.Api.Domain.Response; +namespace Newsbot.Collector.Domain.Response; public class AuthSuccessfulResponse { diff --git a/Newsbot.Collector.Domain/Results/AuthenticationResult.cs b/Newsbot.Collector.Domain/Results/AuthenticationResult.cs new file mode 100644 index 0000000..127d4d5 --- /dev/null +++ b/Newsbot.Collector.Domain/Results/AuthenticationResult.cs @@ -0,0 +1,7 @@ +namespace Newsbot.Collector.Domain.Results; + +public class AuthenticationResult : BaseResult +{ + public string? Token { get; set; } + public string? RefreshToken { get; set; } +} \ No newline at end of file