refactoring, improvements, fixes...
This commit is contained in:
parent
ae73f11f8a
commit
dc9c8ddad2
|
|
@ -43,7 +43,6 @@
|
|||
<ProjectReference Include="..\TIAM.Database\TIAM.Database.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities.Server\TIAM.Entities.Server.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||
<ProjectReference Include="..\TIAMWebApp\Server\TIAMWebApp.Server.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -7,13 +7,8 @@ using TIAM.Database.DbContexts.Users;
|
|||
using TIAM.Entities.Profiles;
|
||||
using TIAM.Entities.Users;
|
||||
using TIAM.Models.Dtos.Users;
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using TIAM.Entities.ServiceProviders;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAMWebApp.Server.Services.Logins;
|
||||
using AyCode.Interfaces.Users;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SendGrid.Helpers.Mail;
|
||||
using TIAM.Entities.Emails;
|
||||
|
||||
namespace TIAM.Database.Test
|
||||
|
|
@ -21,12 +16,12 @@ namespace TIAM.Database.Test
|
|||
[TestClass]
|
||||
public class UserDalTests : AcUserDalTestBase<UserDal, UserDbContext, User, Profile, UserToken, TiamServiceProvider, UserToServiceProvider, Address, EmailMessage>
|
||||
{
|
||||
private Guid _registerUserId = Guid.Parse("1f7e0591-330b-463b-81ad-d01f2e65e23e");
|
||||
private const string RegisterEmail = "qwerty@xxxxx.com";
|
||||
private const string RegisterPassword = "elem'r";
|
||||
//private Guid _registerUserId = Guid.Parse("1f7e0591-330b-463b-81ad-d01f2e65e23e");
|
||||
//private const string RegisterEmail = "qwerty@xxxxx.com";
|
||||
//private const string RegisterPassword = "elem'r";
|
||||
|
||||
private const string LoginEmail = "asdfsdf@ggggg.hu";
|
||||
private const string LoginPassword = "alad'r";
|
||||
//private const string LoginEmail = "asdfsdf@ggggg.hu";
|
||||
//private const string LoginPassword = "alad'r";
|
||||
|
||||
//private WebAssemblyHostConfiguration _configuration = new();
|
||||
//private Mock<UserDbContext> _mockContext;
|
||||
|
|
@ -67,62 +62,63 @@ namespace TIAM.Database.Test
|
|||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task RegisterUser_ReturnsUser_WhenUserExist()
|
||||
{
|
||||
//var a = TiamConst.ProjectIdString;
|
||||
|
||||
await Dal.RemoveUserAsync(_registerUserId); //kitöröljük a szemetet, ha korábbról bentmaradt - J.
|
||||
//[DataTestMethod]
|
||||
//public async Task RegisterUser_ReturnsUser_WhenUserExist()
|
||||
//{
|
||||
// //var a = TiamConst.ProjectIdString;
|
||||
|
||||
var loginService = new LoginService(Dal, AcEnv.AppConfiguration);
|
||||
var errorCode = await loginService.RegistrationAsync(_registerUserId, RegisterEmail, RegisterPassword, null);
|
||||
|
||||
Assert.IsTrue(errorCode == AcErrorCode.Unset);
|
||||
// await Dal.RemoveUserAsync(_registerUserId); //kitöröljük a szemetet, ha korábbról bentmaradt - J.
|
||||
|
||||
var user = Dal.GetUserByEmail(RegisterEmail, false);
|
||||
|
||||
Assert.IsNotNull(user);
|
||||
Assert.IsNotNull(user.Profile);
|
||||
Assert.IsNotNull(user.Profile.Address);
|
||||
// var loginService = new LoginService(Dal, AcEnv.AppConfiguration);
|
||||
// var errorCode = await loginService.RegistrationAsync(_registerUserId, RegisterEmail, RegisterPassword, null);
|
||||
|
||||
await Dal.RemoveUserAsync(user); //kitöröljük a szemetet - J.
|
||||
}
|
||||
// Assert.IsTrue(errorCode == AcErrorCode.Unset);
|
||||
|
||||
[TestMethod]
|
||||
public void LoginUser_ReturnsUser_WhenUserExist()
|
||||
{
|
||||
//var a = TiamConst.ProjectIdString;
|
||||
// var user = Dal.GetUserByEmail(RegisterEmail, false);
|
||||
|
||||
var loginService = new LoginService(Dal, AcEnv.AppConfiguration);
|
||||
// Assert.IsNotNull(user);
|
||||
// Assert.IsNotNull(user.Profile);
|
||||
// Assert.IsNotNull(user.Profile.Address);
|
||||
|
||||
#region Valid email+password test
|
||||
var loggedInModel = loginService.Login(LoginEmail, LoginPassword);
|
||||
// await Dal.RemoveUserAsync(user); //kitöröljük a szemetet - J.
|
||||
//}
|
||||
|
||||
Assert.IsNotNull(loggedInModel);
|
||||
Assert.IsNotNull(loggedInModel.LoggedInUser);
|
||||
Assert.IsNotNull(loginService.LoggedInModel?.LoggedInUser);
|
||||
//[DataTestMethod]
|
||||
//[DataRow([LoginEmail, LoginPassword])]
|
||||
//public void LoginUser_ReturnsUser_WhenUserExist()
|
||||
//{
|
||||
// //var a = TiamConst.ProjectIdString;
|
||||
|
||||
Assert.IsTrue(loggedInModel.LoginErrorCode == AcErrorCode.Unset, $"errorCode: {loggedInModel.LoginErrorCode}");
|
||||
Assert.IsTrue(loggedInModel.IsLoggedIn, $"loggedInModel.IsLoggedIn == false; errorCode: {loggedInModel.LoginErrorCode}");
|
||||
Assert.IsTrue(string.Equals(loggedInModel.LoggedInUser.EmailAddress, LoginEmail, StringComparison.CurrentCultureIgnoreCase));
|
||||
#endregion Valid email+password test
|
||||
// var loginService = new LoginService(Dal, AcEnv.AppConfiguration);
|
||||
|
||||
#region Wrong email test
|
||||
loggedInModel = loginService.Login("gffsdgdfg@gu.hu", LoginPassword);
|
||||
// #region Valid email+password test
|
||||
// var loggedInModel = loginService.Login(LoginEmail, LoginPassword);
|
||||
|
||||
Assert.IsNotNull(loggedInModel);
|
||||
Assert.IsFalse(loggedInModel.IsLoggedIn);
|
||||
Assert.IsTrue(loggedInModel.LoginErrorCode == AcErrorCode.WrongLoginData);
|
||||
#endregion Wrong email test
|
||||
// Assert.IsNotNull(loggedInModel);
|
||||
// Assert.IsNotNull(loggedInModel.LoggedInUser);
|
||||
// Assert.IsNotNull(loginService.LoggedInModel?.LoggedInUser);
|
||||
|
||||
#region Wrong password test
|
||||
loggedInModel = loginService.Login(LoginEmail, "fsdgfsdg");
|
||||
// Assert.IsTrue(loggedInModel.LoginErrorCode == AcErrorCode.Unset, $"errorCode: {loggedInModel.LoginErrorCode}");
|
||||
// Assert.IsTrue(loggedInModel.IsLoggedIn, $"loggedInModel.IsLoggedIn == false; errorCode: {loggedInModel.LoginErrorCode}");
|
||||
// Assert.IsTrue(string.Equals(loggedInModel.LoggedInUser.EmailAddress, LoginEmail, StringComparison.CurrentCultureIgnoreCase));
|
||||
// #endregion Valid email+password test
|
||||
|
||||
Assert.IsNotNull(loggedInModel);
|
||||
Assert.IsFalse(loggedInModel.IsLoggedIn);
|
||||
Assert.IsTrue(loggedInModel.LoginErrorCode == AcErrorCode.WrongLoginData);
|
||||
#endregion Wrong password test
|
||||
}
|
||||
// #region Wrong email test
|
||||
// loggedInModel = loginService.Login("gffsdgdfg@gu.hu", LoginPassword);
|
||||
|
||||
// Assert.IsNotNull(loggedInModel);
|
||||
// Assert.IsFalse(loggedInModel.IsLoggedIn);
|
||||
// Assert.IsTrue(loggedInModel.LoginErrorCode == AcErrorCode.WrongLoginData);
|
||||
// #endregion Wrong email test
|
||||
|
||||
// #region Wrong password test
|
||||
// loggedInModel = loginService.Login(LoginEmail, "fsdgfsdg");
|
||||
|
||||
// Assert.IsNotNull(loggedInModel);
|
||||
// Assert.IsFalse(loggedInModel.IsLoggedIn);
|
||||
// Assert.IsTrue(loggedInModel.LoginErrorCode == AcErrorCode.WrongLoginData);
|
||||
// #endregion Wrong password test
|
||||
//}
|
||||
|
||||
[DataTestMethod]
|
||||
[DataRow("540271F6-C604-4C16-8160-D5A7CAFEDF00")]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
using AyCode.Interfaces.Server.Logins;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Profiles;
|
||||
using TIAM.Entities.ServiceProviders;
|
||||
using TIAM.Entities.Users;
|
||||
|
||||
namespace TIAM.Models.Server.Logins;
|
||||
|
||||
public interface ILoggedInModel : IAcLoggedInModelBase<User, UserToken, Profile, TiamServiceProvider, UserToServiceProvider, Address>
|
||||
{}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
using AyCode.Models.Server.Logins;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Profiles;
|
||||
using TIAM.Entities.ServiceProviders;
|
||||
using TIAM.Entities.Users;
|
||||
|
||||
namespace TIAM.Models.Server.Logins;
|
||||
|
||||
public class LoggedInModel : AcLoggedInModelServer<User, UserToken, Profile, TiamServiceProvider, UserToServiceProvider, Address>, ILoggedInModel
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities.Server\TIAM.Entities.Server.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Models\TIAM.Models.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="AyCode.Core">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Core.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Entities">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Entities.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Interfaces">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Interfaces.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Interfaces.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Models">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Models.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Utils">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Utils.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities.Server\TIAM.Entities.Server.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
@ -21,15 +20,33 @@
|
|||
<Reference Include="AyCode.Core">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Core.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Database">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Database.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Entities">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Entities.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Interfaces">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Interfaces.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Interfaces.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Models">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Models.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Utils">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Utils.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
using AyCode.Services.Server.Tests.LoginServices;
|
||||
using TIAM.Database.DataLayers.Users;
|
||||
using TIAM.Database.DbContexts.Users;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Emails;
|
||||
using TIAM.Entities.Profiles;
|
||||
using TIAM.Entities.ServiceProviders;
|
||||
using TIAM.Entities.Users;
|
||||
using TIAM.Models.Server.Logins;
|
||||
using TIAM.Services.Server.Logins;
|
||||
|
||||
namespace TIAM.Services.Server.Tests.LoginServices
|
||||
{
|
||||
[TestClass]
|
||||
public class LoginServiceServerTests : AcLoginServiceServerTestBase<UserDal, UserDbContext, LoginService, LoggedInModel, User, Profile, UserToken, TiamServiceProvider, UserToServiceProvider, Address, EmailMessage>
|
||||
{
|
||||
private const string RegisterEmail = "qwerty@xxxxx.com";
|
||||
private const string RegisterPassword = "elem'r";
|
||||
private const string RegisterUserIdString = "1f7e0591-330b-463b-81ad-d01f2e65e23e";
|
||||
|
||||
private const string LoginEmail = "asdfsdf@ggggg.hu";
|
||||
private const string LoginPassword = "alad'r";
|
||||
|
||||
[DataTestMethod]
|
||||
[DataRow([RegisterUserIdString, RegisterEmail, RegisterPassword])]
|
||||
public override Task AcBase_RegisterUser_ReturnsUser_WhenUserExist(string[] userIdEmailPasswordStrings)
|
||||
=> base.AcBase_RegisterUser_ReturnsUser_WhenUserExist(userIdEmailPasswordStrings);
|
||||
|
||||
[DataTestMethod]
|
||||
[DataRow([LoginEmail, LoginPassword])]
|
||||
public override void AcBase_LoginUser_ReturnsUser_WhenUserExist(string[] emailPasswordStrings)
|
||||
=> base.AcBase_LoginUser_ReturnsUser_WhenUserExist(emailPasswordStrings);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="appsettings.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="appsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Database.Test\TIAM.Database.Test.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Database\TIAM.Database.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities.Server\TIAM.Entities.Server.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Models\TIAM.Models.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Services.Server\TIAM.Services.Server.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Services\TIAM.Services.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="AyCode.Core">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Core.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Core.Tests">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server.Tests\bin\Debug\net8.0\AyCode.Core.Tests.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Database">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Database.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Database.Tests">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server.Tests\bin\Debug\net8.0\AyCode.Database.Tests.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Entities">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Entities.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Interfaces">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Interfaces.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Interfaces.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Models">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Models.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Services">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Services.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Services.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Services.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Services.Server.Tests">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server.Tests\bin\Debug\net8.0\AyCode.Services.Server.Tests.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Utils">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Utils.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"ConnectionStrings": {
|
||||
"DeveloperDbConnection": "Data Source=185.51.190.197;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"JWT": {
|
||||
"Key": "Cee4400-rDMFkVvHPufyLDSzbfu2grgRhpepos299IhTLOXsljkcpt3yUR4RRjPQ",
|
||||
"Issuer": "http://localhost:5000",
|
||||
"Audience": "http://localhost:5000"
|
||||
},
|
||||
"SendGrid": {
|
||||
//"Key": "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"
|
||||
"Key": "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"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +1,11 @@
|
|||
using AyCode.Interfaces.Server.Logins;
|
||||
using AyCode.Models.Server.Logins;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Profiles;
|
||||
using TIAM.Entities.ServiceProviders;
|
||||
using TIAM.Entities.Users;
|
||||
using TIAMWebApp.Server.Models.Logins;
|
||||
using TIAM.Models.Server.Logins;
|
||||
|
||||
namespace TIAMWebApp.Server.Services.Logins;
|
||||
|
||||
public interface ILoginModel : IAcLoggedInModelBase<User, UserToken, Profile, TiamServiceProvider, UserToServiceProvider, Address>
|
||||
{}
|
||||
namespace TIAM.Services.Server.Logins;
|
||||
|
||||
public interface ILoginService : IAcLoginServiceServer<LoggedInModel, User, UserToken, Profile, TiamServiceProvider, UserToServiceProvider, Address>
|
||||
{
|
||||
|
|
@ -1,21 +1,16 @@
|
|||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Security;
|
||||
using AyCode.Core.Consts;
|
||||
using AyCode.Interfaces.Server.Logins;
|
||||
using AyCode.Core.Consts;
|
||||
using AyCode.Services.Server.Logins;
|
||||
using AyCode.Utils.Extensions;
|
||||
using TIAM.Database.DataLayers.Admins;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using TIAM.Database.DataLayers.Users;
|
||||
using TIAM.Database.DbContexts.Admins;
|
||||
using TIAM.Database.DbContexts.Users;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Emails;
|
||||
using TIAM.Entities.Profiles;
|
||||
using TIAM.Entities.ServiceProviders;
|
||||
using TIAM.Entities.Users;
|
||||
using TIAMWebApp.Server.Models.Logins;
|
||||
using TIAM.Models.Server.Logins;
|
||||
|
||||
namespace TIAMWebApp.Server.Services.Logins;
|
||||
namespace TIAM.Services.Server.Logins;
|
||||
|
||||
public class LoginService(UserDal userDal, IConfiguration configuration) : AcLoginServiceServer<LoggedInModel, UserDal, UserDbContext, User, UserToken, Profile, TiamServiceProvider, UserToServiceProvider, Address, EmailMessage>(userDal, configuration), ILoginService
|
||||
|
||||
|
|
@ -1,14 +1,12 @@
|
|||
using System.Net;
|
||||
using AyCode.Models.Enums;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using SendGrid;
|
||||
using SendGrid.Helpers.Mail;
|
||||
using AyCode.Models.Enums;
|
||||
using TIAM.Database.DataLayers.Admins;
|
||||
using TIAM.Database.DataLayers.Users;
|
||||
using TIAM.Entities.Emails;
|
||||
using TIAMWebApp.Shared.Application.Models.ClientSide.Messages;
|
||||
|
||||
|
||||
namespace TIAMWebApp.Server.Services
|
||||
namespace TIAM.Services.Server
|
||||
{
|
||||
public class MessageSenderService(IConfiguration configuration, AdminDal adminDal) : IMessageSenderService
|
||||
{
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.4" />
|
||||
<PackageReference Include="SendGrid" Version="9.29.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Database\TIAM.Database.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities.Server\TIAM.Entities.Server.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Models.Server\TIAM.Models.Server.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Models\TIAM.Models.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Services\TIAM.Services.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="AyCode.Core">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Core.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Database">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Database.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Entities">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Entities.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Interfaces">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Interfaces.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Interfaces.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Models">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Models.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Services">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Services.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Services.Server">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Services.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Utils">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Utils.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
using TIAM.Core.Enums;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using TIAM.Core.Enums;
|
||||
using TIAM.Database.DataLayers.Admins;
|
||||
using TIAM.Database.DataLayers.Users;
|
||||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Transfers;
|
||||
|
||||
namespace TIAMWebApp.Server.Services
|
||||
namespace TIAM.Services.Server
|
||||
{
|
||||
public class TransferBackendService(IConfiguration configuration, AdminDal adminDal)
|
||||
{
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||
<ProjectReference Include="..\TIAM.Models\TIAM.Models.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="AyCode.Core">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Entities">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Interfaces">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AyCode.Models">
|
||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -18,7 +18,7 @@ using TIAM.Database.DbSets.Transfers;
|
|||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Transfers;
|
||||
using TIAM.Entities.Users;
|
||||
using TIAMWebApp.Server.Services;
|
||||
using TIAM.Services.Server;
|
||||
using TIAMWebApp.Shared.Application.Models;
|
||||
using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels;
|
||||
using TIAMWebApp.Shared.Application.Models.PageModels;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ using AyCode.Core.Consts;
|
|||
using AyCode.Core.Helpers;
|
||||
using TIAM.Entities.Profiles;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAMWebApp.Server.Services.Logins;
|
||||
using TIAM.Services.Server.Logins;
|
||||
|
||||
namespace TIAMWebApp.Server.Controllers
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
using AyCode.Models.Server.Logins;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Profiles;
|
||||
using TIAM.Entities.ServiceProviders;
|
||||
using TIAM.Entities.Users;
|
||||
using TIAMWebApp.Server.Services.Logins;
|
||||
|
||||
namespace TIAMWebApp.Server.Models.Logins;
|
||||
|
||||
public class LoggedInModel : AcLoggedInModelServer<LoggedInModel, User, UserToken, Profile, TiamServiceProvider, UserToServiceProvider, Address>, ILoginModel
|
||||
{
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ using TIAM.Database.DataLayers.Auctions;
|
|||
using TIAM.Database.DataLayers.TransferDestinations;
|
||||
using TIAM.Database.DataLayers.Users;
|
||||
using TIAM.Entities.Emails;
|
||||
using TIAMWebApp.Server.Services;
|
||||
using TIAM.Services.Server;
|
||||
//using TIAM.Database.DataLayers.ServiceProviders;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@
|
|||
<ProjectReference Include="..\..\TIAM.Database\TIAM.Database.csproj" />
|
||||
<ProjectReference Include="..\..\TIAM.Entities.Server\TIAM.Entities.Server.csproj" />
|
||||
<ProjectReference Include="..\..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||
<ProjectReference Include="..\..\TIAM.Models\TIAM.Models.csproj" />
|
||||
<ProjectReference Include="..\..\TIAM.Services.Server\TIAM.Services.Server.csproj" />
|
||||
<ProjectReference Include="..\..\TIAM.Services\TIAM.Services.csproj" />
|
||||
<ProjectReference Include="..\Client\TIAMWebApp.Client.csproj" />
|
||||
<ProjectReference Include="..\Shared\TIAMWebApp.Shared.Application.csproj" />
|
||||
</ItemGroup>
|
||||
|
|
@ -72,5 +75,9 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Services\" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||
SqlSchemaCompare_Dev_to_DevRelease.scmp = SqlSchemaCompare_Dev_to_DevRelease.scmp
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TIAM.Services", "TIAM.Services\TIAM.Services.csproj", "{2B6543F8-ABE3-4C09-A0B3-F6AD13286761}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TIAM.Services.Server", "TIAM.Services.Server\TIAM.Services.Server.csproj", "{F1A1FA1F-DF3E-4BB3-85E9-BBA182FD6CA8}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TIAM.Services.Server.Tests", "TIAM.Services.Server.Tests\TIAM.Services.Server.Tests.csproj", "{433A137C-0FEF-4B96-B17F-1F4400108207}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TIAM.Models.Server", "TIAM.Models.Server\TIAM.Models.Server.csproj", "{D21032B0-B25F-495E-B784-1D3166FE720C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -118,6 +126,22 @@ Global
|
|||
{2A300982-AA2E-4E62-97F2-6EF4C97939B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2A300982-AA2E-4E62-97F2-6EF4C97939B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2A300982-AA2E-4E62-97F2-6EF4C97939B2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2B6543F8-ABE3-4C09-A0B3-F6AD13286761}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2B6543F8-ABE3-4C09-A0B3-F6AD13286761}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2B6543F8-ABE3-4C09-A0B3-F6AD13286761}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2B6543F8-ABE3-4C09-A0B3-F6AD13286761}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F1A1FA1F-DF3E-4BB3-85E9-BBA182FD6CA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F1A1FA1F-DF3E-4BB3-85E9-BBA182FD6CA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F1A1FA1F-DF3E-4BB3-85E9-BBA182FD6CA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F1A1FA1F-DF3E-4BB3-85E9-BBA182FD6CA8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{433A137C-0FEF-4B96-B17F-1F4400108207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{433A137C-0FEF-4B96-B17F-1F4400108207}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{433A137C-0FEF-4B96-B17F-1F4400108207}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{433A137C-0FEF-4B96-B17F-1F4400108207}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D21032B0-B25F-495E-B784-1D3166FE720C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D21032B0-B25F-495E-B784-1D3166FE720C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D21032B0-B25F-495E-B784-1D3166FE720C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D21032B0-B25F-495E-B784-1D3166FE720C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
|||
Loading…
Reference in New Issue