This commit is contained in:
2026-08-02 11:18:27 +03:30
parent 9a13fa68a7
commit fbbc728366
9 changed files with 113 additions and 11 deletions
@@ -5,17 +5,30 @@ using System.Threading.Tasks;
using AutoMapper; using AutoMapper;
using xAiModels.Models.Dtos; using xAiModels.Models.Dtos;
using xAiModels.Models.Entities; using xAiModels.Models.Entities;
using xIdentityService.Interfaces;
namespace xAiModels.Configurations.Entities namespace xAiModels.Configurations.Entities
{ {
public class XAiConversationMappingAction : IMappingAction<XAiConversation, XAiConversationDto> public class XAiConversationMappingAction : IMappingAction<XAiConversation, XAiConversationDto>
{ {
private readonly IXIdentityProvider identityProvider;
public XAiConversationMappingAction(
IXIdentityProvider identityProvider
)
{
this.identityProvider = identityProvider;
}
public void Process( public void Process(
XAiConversation source, XAiConversation source,
XAiConversationDto destination, XAiConversationDto destination,
ResolutionContext context ResolutionContext context
) )
{ {
//
// Retrieve Owner ...
// Retrieve Project Info ...
throw new NotImplementedException(); throw new NotImplementedException();
} }
} }
@@ -5,11 +5,21 @@ using System.Threading.Tasks;
using AutoMapper; using AutoMapper;
using xAiModels.Models.Dtos; using xAiModels.Models.Dtos;
using xAiModels.Models.Entities; using xAiModels.Models.Entities;
using xIdentityService.Interfaces;
namespace xAiModels.Configurations.Entities namespace xAiModels.Configurations.Entities
{ {
public class XAiMessageMappingAction : IMappingAction<XAiMessage, XAiMessageDto> public class XAiMessageMappingAction : IMappingAction<XAiMessage, XAiMessageDto>
{ {
private readonly IXIdentityProvider identityProvider;
public XAiMessageMappingAction(
IXIdentityProvider identityProvider
)
{
this.identityProvider = identityProvider;
}
public void Process( public void Process(
XAiMessage source, XAiMessage source,
XAiMessageDto destination, XAiMessageDto destination,
@@ -5,11 +5,21 @@ using System.Threading.Tasks;
using AutoMapper; using AutoMapper;
using xAiModels.Models.Dtos; using xAiModels.Models.Dtos;
using xAiModels.Models.Entities; using xAiModels.Models.Entities;
using xIdentityService.Interfaces;
namespace xAiModels.Configurations.Entities namespace xAiModels.Configurations.Entities
{ {
public class XAiProjectMappingAction : IMappingAction<XAiProject, XAiProjectDto> public class XAiProjectMappingAction : IMappingAction<XAiProject, XAiProjectDto>
{ {
private readonly IXIdentityProvider identityProvider;
public XAiProjectMappingAction(
IXIdentityProvider identityProvider
)
{
this.identityProvider = identityProvider;
}
public void Process( public void Process(
XAiProject source, XAiProject source,
XAiProjectDto destination, XAiProjectDto destination,
+10 -4
View File
@@ -1,3 +1,4 @@
using xAiModels.Constants;
using xAiModels.Models; using xAiModels.Models;
namespace xAiModels.Configurations namespace xAiModels.Configurations
@@ -10,13 +11,18 @@ namespace xAiModels.Configurations
public XAiModelDescriptor[] Models { get; set; } = []; public XAiModelDescriptor[] Models { get; set; } = [];
/// <summary> /// <summary>
/// Each User must Has a Default Project ... /// Each User must Has a Default Project, this is Title Resource Identifier ...
/// </summary> /// </summary>
public string DefaultProjectResource { get; set; } public string DefaultProjectTitleResource { get; set; } = XAiModelsConstants.DefaultXAiProjectTitleResourceID;
/// <summary> /// <summary>
/// Each User must Has a Default Conversation ... /// Each User must Has a Default Project, this is Description Resource Identifier ...
/// </summary> /// </summary>
public string DefaultConversationResource { get; set; } public string DefaultProjectDescriptionResource { get; set; } = XAiModelsConstants.DefaultXAiProjectDescriptionResourceID;
/// <summary>
/// Each User must Has a Default Conversation, this is Title Resource Identifier ... ...
/// </summary>
public string DefaultConversationTitleResource { get; set; } = XAiModelsConstants.DefaultXAiConversationTitleResourceID;
} }
} }
+5
View File
@@ -44,5 +44,10 @@ namespace xAiModels.Constants
public const string GetXAiMessageEFRepositoryDescriptor = "GetXAiMessageEFRepositoryDescriptor"; public const string GetXAiMessageEFRepositoryDescriptor = "GetXAiMessageEFRepositoryDescriptor";
public const string GetXAiProjectEFRepositoryDescriptor = "GetXAiProjectEFRepositoryDescriptor"; public const string GetXAiProjectEFRepositoryDescriptor = "GetXAiProjectEFRepositoryDescriptor";
public const string GetXAiConversationEFRepositoryDescriptor = "GetXAiConversationEFRepositoryDescriptor"; public const string GetXAiConversationEFRepositoryDescriptor = "GetXAiConversationEFRepositoryDescriptor";
//
public const string DefaultXAiProjectTitleResourceID = "XAiPrjT";
public const string DefaultXAiConversationTitleResourceID = "XAiCnvT";
public const string DefaultXAiProjectDescriptionResourceID = "XAiPrjD";
} }
} }
@@ -10,8 +10,8 @@ namespace xAiModels.Providers
public XAiConversationTitleResourceProvider( public XAiConversationTitleResourceProvider(
IXStringServiceProvider stringProvider IXStringServiceProvider stringProvider
) : base( ) : base(
item: XAiModelsConstants.XAiConversationTitleIdentifier, stringProvider: stringProvider,
stringProvider item: XAiModelsConstants.XAiConversationTitleIdentifier
) )
{ } { }
} }
+58
View File
@@ -0,0 +1,58 @@
using Microsoft.AspNetCore.SignalR;
using xAiModels.Interfaces;
using xAiModels.Interfaces.Entities;
using xAiModels.Providers.Dtos;
using xAiModels.Providers.Entities;
namespace xAiModels.Providers
{
/// <summary>
/// All Data Manipulation Requirements ...
/// </summary>
public class XAiDataProvider : IXAiDataProvider
{
private readonly IHubContext<XAiMessageDtoHub> messageDtoHub;
private readonly IHubContext<XAiProjectDtoHub> projectDtoHub;
private readonly IXAiMessageRepository messageRepositoryService;
private readonly IXAiProjectRepository projectRepositoryService;
private readonly IHubContext<XAiMessageEntityHub> messageEntityHub;
private readonly IHubContext<XAiProjectEntityHub> projectEntityHub;
private readonly IXAiConversationRepository conversationRepository;
private readonly IHubContext<XAiConversationDtoHub> conversationDtoHub;
private readonly IHubContext<XAiConversationEntityHub> conversationEntityHub;
private readonly IXAiProjectTitleResourceProvider projectTitleResourceProvider;
private readonly IXAiConversationTitleResourceProvider conversationTitleResourceProvider;
private readonly IXAiProjectDescriptionResourceProvider projectDescriptionResourceProvider;
public XAiDataProvider(
IHubContext<XAiMessageDtoHub> messageDtoHub,
IHubContext<XAiProjectDtoHub> projectDtoHub,
IXAiMessageRepository messageRepositoryService,
IXAiProjectRepository projectRepositoryService,
IHubContext<XAiMessageEntityHub> messageEntityHub,
IHubContext<XAiProjectEntityHub> projectEntityHub,
IXAiConversationRepository conversationRepository,
IHubContext<XAiConversationDtoHub> conversationDtoHub,
IHubContext<XAiConversationEntityHub> conversationEntityHub,
IXAiProjectTitleResourceProvider projectTitleResourceProvider,
IXAiConversationTitleResourceProvider conversationTitleResourceProvider,
IXAiProjectDescriptionResourceProvider projectDescriptionResourceProvider
)
{
this.messageDtoHub = messageDtoHub;
this.projectDtoHub = projectDtoHub;
this.projectEntityHub = projectEntityHub;
this.messageEntityHub = messageEntityHub;
this.conversationDtoHub = conversationDtoHub;
this.conversationEntityHub = conversationEntityHub;
this.conversationRepository = conversationRepository;
this.messageRepositoryService = messageRepositoryService;
this.projectRepositoryService = projectRepositoryService;
this.projectTitleResourceProvider = projectTitleResourceProvider;
this.conversationTitleResourceProvider = conversationTitleResourceProvider;
this.projectDescriptionResourceProvider = projectDescriptionResourceProvider;
}
}
}
@@ -10,8 +10,8 @@ namespace xAiModels.Providers
public XAiProjectDescriptionResourceProvider( public XAiProjectDescriptionResourceProvider(
IXStringServiceProvider stringProvider IXStringServiceProvider stringProvider
) : base( ) : base(
item: XAiModelsConstants.XAiProjectDescriptionIdentifier, stringProvider: stringProvider,
stringProvider item: XAiModelsConstants.XAiProjectDescriptionIdentifier
) )
{ } { }
} }
+2 -2
View File
@@ -10,8 +10,8 @@ namespace xAiModels.Providers
public XAiProjectTitleResourceProvider( public XAiProjectTitleResourceProvider(
IXStringServiceProvider stringProvider IXStringServiceProvider stringProvider
) : base( ) : base(
item: XAiModelsConstants.XAiProjectTitleIdentifier, stringProvider: stringProvider,
stringProvider item: XAiModelsConstants.XAiProjectTitleIdentifier
) )
{ } { }
} }