improvements, fixes
This commit is contained in:
parent
6aad8614b9
commit
492cfae5ad
|
|
@ -10,10 +10,10 @@ namespace TIAM.Entities.Users
|
||||||
[Table("Users")]
|
[Table("Users")]
|
||||||
public class User : AcUser<Profile, Company, UserToCompany, Address>, IUser, IUserDtoDetail
|
public class User : AcUser<Profile, Company, UserToCompany, Address>, IUser, IUserDtoDetail
|
||||||
{
|
{
|
||||||
public virtual List<Product> Products { get; } = new();
|
public virtual List<Product> Products { get; set; } = new();
|
||||||
|
|
||||||
//public virtual ServiceProvider ServiceProvider { get; set; } = new();
|
//public virtual ServiceProvider ServiceProvider { get; set; } = new();
|
||||||
public virtual List<UserProductMapping> UserProductMappings { get; } = new();
|
public virtual List<UserProductMapping> UserProductMappings { get; set; } = new();
|
||||||
|
|
||||||
public User() { }
|
public User() { }
|
||||||
public User(string email, string password) : this(Guid.NewGuid(), email, password) { }
|
public User(string email, string password) : this(Guid.NewGuid(), email, password) { }
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
using TIAM.Entities.Profiles;
|
using AyCode.Interfaces;
|
||||||
|
using TIAM.Entities.Profiles;
|
||||||
using TIAM.Entities.ServiceProviders;
|
using TIAM.Entities.ServiceProviders;
|
||||||
using TIAM.Entities.Users;
|
using TIAM.Entities.Users;
|
||||||
|
|
||||||
namespace TIAM.Models.Dtos.Users;
|
namespace TIAM.Models.Dtos.Users;
|
||||||
|
|
||||||
public class UserDto : IUserDto<Profile, Company, UserToCompany>
|
public class UserDto : IUserDto<Profile, Company, UserToCompany>, IAcModelDtoBase<User>
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
|
@ -15,4 +16,28 @@ public class UserDto : IUserDto<Profile, Company, UserToCompany>
|
||||||
|
|
||||||
public List<Company> ServiceProviders { get; set; }
|
public List<Company> ServiceProviders { get; set; }
|
||||||
public List<UserToCompany> UserToServiceProviders { get; set; }
|
public List<UserToCompany> UserToServiceProviders { get; set; }
|
||||||
|
|
||||||
|
public UserDto() {}
|
||||||
|
|
||||||
|
public UserDto(User user) : this()
|
||||||
|
{
|
||||||
|
//TODO: Models... - J.
|
||||||
|
throw new NotImplementedException("UserDto(User user)");
|
||||||
|
|
||||||
|
Id = user.Id;
|
||||||
|
ProfileId = user.ProfileId;
|
||||||
|
AffiliateId = AffiliateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual User CreateMainEntity()
|
||||||
|
{
|
||||||
|
return new User
|
||||||
|
{
|
||||||
|
Id = Id,
|
||||||
|
ProfileId = ProfileId,
|
||||||
|
AffiliateId = AffiliateId,
|
||||||
|
ServiceProviders = ServiceProviders.ToList(),
|
||||||
|
UserToServiceProviders = UserToServiceProviders.ToList()
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
using TIAM.Entities.Users;
|
using AyCode.Interfaces;
|
||||||
|
using TIAM.Entities.Users;
|
||||||
|
|
||||||
namespace TIAM.Models.Dtos.Users
|
namespace TIAM.Models.Dtos.Users
|
||||||
{
|
{
|
||||||
public class UserDtoDetail : UserDto, IUserDtoDetail
|
public class UserDtoDetail : UserDto, IUserDtoDetail
|
||||||
{
|
{
|
||||||
public string PhoneNumber { get; set; }
|
public string? PhoneNumber { get; set; }
|
||||||
public string? RefreshToken { get; set; }
|
public string? RefreshToken { get; set; }
|
||||||
public Guid? RefferalId { get; set; }
|
public Guid? RefferalId { get; set; }
|
||||||
public string EmailAddress { get; set; }
|
public string EmailAddress { get; set; }
|
||||||
|
|
@ -12,5 +13,31 @@ namespace TIAM.Models.Dtos.Users
|
||||||
public string Password { get; set; }
|
public string Password { get; set; }
|
||||||
public DateTime Created { get; set; }
|
public DateTime Created { get; set; }
|
||||||
public DateTime Modified { get; set; }
|
public DateTime Modified { get; set; }
|
||||||
|
|
||||||
|
public UserDtoDetail() : base()
|
||||||
|
{ }
|
||||||
|
public UserDtoDetail(User user) : base(user)
|
||||||
|
{
|
||||||
|
PhoneNumber = user.PhoneNumber;
|
||||||
|
RefreshToken = user.RefreshToken;
|
||||||
|
EmailConfirmed = user.EmailConfirmed;
|
||||||
|
Password = user.Password;
|
||||||
|
EmailAddress = user.EmailAddress;
|
||||||
|
EmailConfirmed = user.EmailConfirmed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override User CreateMainEntity()
|
||||||
|
{
|
||||||
|
var user = base.CreateMainEntity();
|
||||||
|
|
||||||
|
user.PhoneNumber = PhoneNumber;
|
||||||
|
user.RefreshToken = RefreshToken;
|
||||||
|
user.EmailConfirmed = EmailConfirmed;
|
||||||
|
user.Password = Password;
|
||||||
|
user.EmailAddress = EmailAddress;
|
||||||
|
user.EmailConfirmed = EmailConfirmed;
|
||||||
|
|
||||||
|
return user;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using AyCode.Models.Users;
|
using AyCode.Interfaces;
|
||||||
|
using AyCode.Models.Users;
|
||||||
using TIAM.Entities.Products;
|
using TIAM.Entities.Products;
|
||||||
using TIAM.Entities.Profiles;
|
using TIAM.Entities.Profiles;
|
||||||
using TIAM.Entities.ServiceProviders;
|
using TIAM.Entities.ServiceProviders;
|
||||||
|
|
@ -6,7 +7,7 @@ using TIAM.Entities.Users;
|
||||||
|
|
||||||
namespace TIAM.Models.Dtos.Users;
|
namespace TIAM.Models.Dtos.Users;
|
||||||
|
|
||||||
public class UserModelDto : AcUserModelDtoBase<UserDto, Profile, Company, UserToCompany>, IProductsRelation, IUserModelDtoMinBase
|
public class UserModelDto : AcUserModelDtoBase<UserDto, Profile, Company, UserToCompany>, IProductsRelation, IUserModelDtoMinBase, IAcModelDtoBase<User>
|
||||||
{
|
{
|
||||||
public List<UserProductMapping> UserProductMappings { get; set; }
|
public List<UserProductMapping> UserProductMappings { get; set; }
|
||||||
public List<Product> Products { get; set; }
|
public List<Product> Products { get; set; }
|
||||||
|
|
@ -33,4 +34,19 @@ public class UserModelDto : AcUserModelDtoBase<UserDto, Profile, Company, UserTo
|
||||||
UserProductMappings.Add(new UserProductMapping(userProduct.Id, userProduct.UserId, userProduct.ProductId));
|
UserProductMappings.Add(new UserProductMapping(userProduct.Id, userProduct.UserId, userProduct.ProductId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual User CreateMainEntity()
|
||||||
|
{
|
||||||
|
//TODO: Models... - J.
|
||||||
|
throw new NotImplementedException("CreateMainEntity");
|
||||||
|
|
||||||
|
return new User
|
||||||
|
{
|
||||||
|
Id = Id,
|
||||||
|
ProfileId = UserDto.ProfileId,
|
||||||
|
AffiliateId = UserDto.AffiliateId,
|
||||||
|
ServiceProviders = ServiceProviders.ToList(),
|
||||||
|
UserToServiceProviders = UserToServiceProviders.ToList()
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -34,6 +34,12 @@ namespace TIAM.Models.Dtos.Users
|
||||||
UserProductMappings.Add(new UserProductMapping(userProduct.Id, userProduct.UserId, userProduct.ProductId));
|
UserProductMappings.Add(new UserProductMapping(userProduct.Id, userProduct.UserId, userProduct.ProductId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual User CreateMainEntity()
|
||||||
|
{
|
||||||
|
//TODO: Models... - J.
|
||||||
|
throw new NotImplementedException("CreateMainEntity");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ using Product = TIAM.Entities.Products.Product;
|
||||||
using TIAM.Entities.Addresses;
|
using TIAM.Entities.Addresses;
|
||||||
using TIAM.Entities.Profiles;
|
using TIAM.Entities.Profiles;
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Entities;
|
||||||
using AyCode.Services.SignalRs;
|
using AyCode.Services.SignalRs;
|
||||||
using AyCode.Utils.Extensions;
|
using AyCode.Utils.Extensions;
|
||||||
using TIAM.Entities.Drivers;
|
using TIAM.Entities.Drivers;
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,9 @@ public class DynamicMethodCallModel<TAttribute> where TAttribute : TagAttribute
|
||||||
public object InstanceObject { get; init; }
|
public object InstanceObject { get; init; }
|
||||||
public ConcurrentDictionary<int, MethodInfoModel<TAttribute>> MethodsByMessageTag { get; init; } = new();
|
public ConcurrentDictionary<int, MethodInfoModel<TAttribute>> MethodsByMessageTag { get; init; } = new();
|
||||||
|
|
||||||
|
public DynamicMethodCallModel(Type instanceObjectType) : this(Activator.CreateInstance(instanceObjectType)!)
|
||||||
|
{ }
|
||||||
|
|
||||||
public DynamicMethodCallModel(object instanceObject)
|
public DynamicMethodCallModel(object instanceObject)
|
||||||
{
|
{
|
||||||
InstanceObject = instanceObject;
|
InstanceObject = instanceObject;
|
||||||
|
|
@ -76,19 +79,20 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
||||||
private readonly TIAM.Core.Loggers.Logger<DevAdminSignalRHub> _logger;
|
private readonly TIAM.Core.Loggers.Logger<DevAdminSignalRHub> _logger;
|
||||||
|
|
||||||
private readonly AdminDal _adminDal;
|
private readonly AdminDal _adminDal;
|
||||||
private readonly ServiceProviderAPIController _serviceProviderApiController;
|
//private readonly ServiceProviderAPIController _serviceProviderApiController;
|
||||||
private readonly TransferDataAPIController _transferDataApiController;
|
//private readonly TransferDataAPIController _transferDataApiController;
|
||||||
|
|
||||||
public DevAdminSignalRHub(AdminDal adminDal, ServiceProviderAPIController serviceProviderApiController, TransferDataAPIController transferDataApiController, IEnumerable<IAcLogWriterBase> logWriters)
|
public DevAdminSignalRHub(AdminDal adminDal, ServiceProviderAPIController serviceProviderApiController, TransferDataAPIController transferDataApiController, IEnumerable<IAcLogWriterBase> logWriters)
|
||||||
{
|
{
|
||||||
_adminDal = adminDal;
|
_adminDal = adminDal;
|
||||||
_serviceProviderApiController = serviceProviderApiController;
|
//_serviceProviderApiController = serviceProviderApiController;
|
||||||
_transferDataApiController = transferDataApiController;
|
//_transferDataApiController = transferDataApiController;
|
||||||
|
|
||||||
_logger = new(logWriters.ToArray());
|
_logger = new(logWriters.ToArray());
|
||||||
|
|
||||||
_dynamicMethodCallModels.Add(new DynamicMethodCallModel<SignalRAttribute>(serviceProviderApiController));
|
_dynamicMethodCallModels.Add(new DynamicMethodCallModel<SignalRAttribute>(serviceProviderApiController));
|
||||||
_dynamicMethodCallModels.Add(new DynamicMethodCallModel<SignalRAttribute>(transferDataApiController));
|
_dynamicMethodCallModels.Add(new DynamicMethodCallModel<SignalRAttribute>(transferDataApiController));
|
||||||
|
_dynamicMethodCallModels.Add(new DynamicMethodCallModel<SignalRAttribute>(typeof(MessageAPIController)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue