backup Mapping Actions and remove them and try to use Enricher Service for AiConversation ...
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
using System;
|
||||
using AutoMapper;
|
||||
using xAiModels.Interfaces;
|
||||
using xAiModels.Models.Dtos;
|
||||
using xAiModels.Models.Entities;
|
||||
using xIdentityService.Extensions;
|
||||
using xIdentityService.Interfaces;
|
||||
|
||||
namespace xAiModels.Configurations.Entities
|
||||
{
|
||||
public class XAiConversationMappingAction : IMappingAction<XAiConversation, XAiConversationDto>
|
||||
{
|
||||
private readonly IXIdentityProvider identityProvider;
|
||||
private readonly IXAiProjectTitleResourceProvider projectTitleResourceProvider;
|
||||
private readonly IXAiConversationTitleResourceProvider conversationTitleResourceProvider;
|
||||
private readonly IXAiProjectDescriptionResourceProvider projectDescriptionResourceProvider;
|
||||
|
||||
public XAiConversationMappingAction(
|
||||
IXIdentityProvider identityProvider,
|
||||
IXAiProjectTitleResourceProvider projectTitleResourceProvider,
|
||||
IXAiConversationTitleResourceProvider conversationTitleResourceProvider,
|
||||
IXAiProjectDescriptionResourceProvider projectDescriptionResourceProvider
|
||||
)
|
||||
{
|
||||
this.identityProvider = identityProvider;
|
||||
this.projectTitleResourceProvider = projectTitleResourceProvider;
|
||||
this.conversationTitleResourceProvider = conversationTitleResourceProvider;
|
||||
this.projectDescriptionResourceProvider = projectDescriptionResourceProvider;
|
||||
}
|
||||
|
||||
public void Process(
|
||||
XAiConversation source,
|
||||
XAiConversationDto destination,
|
||||
ResolutionContext context
|
||||
)
|
||||
{
|
||||
//
|
||||
// Retrieve Owner ...
|
||||
var device = identityProvider.GetDevice();
|
||||
var ownerUserInfo = identityProvider.GetUserInfo(
|
||||
device: device,
|
||||
userSelectByParam: source.OwnerId
|
||||
)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
var owner = ownerUserInfo.ToXPersonDto();
|
||||
|
||||
//
|
||||
// Setting Owner ...
|
||||
destination.Owner = owner;
|
||||
|
||||
// Retrieve Project Info ...
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
using System;
|
||||
using AutoMapper;
|
||||
using xAiModels.Models.Dtos;
|
||||
using xAiModels.Models.Entities;
|
||||
using xIdentityService.Extensions;
|
||||
using xIdentityService.Interfaces;
|
||||
|
||||
namespace xAiModels.Configurations.Entities
|
||||
{
|
||||
public class XAiMessageMappingAction : IMappingAction<XAiMessage, XAiMessageDto>
|
||||
{
|
||||
private readonly IXIdentityProvider identityProvider;
|
||||
|
||||
public XAiMessageMappingAction(
|
||||
IXIdentityProvider identityProvider
|
||||
)
|
||||
{
|
||||
this.identityProvider = identityProvider;
|
||||
}
|
||||
|
||||
public void Process(
|
||||
XAiMessage source,
|
||||
XAiMessageDto destination,
|
||||
ResolutionContext context
|
||||
)
|
||||
{
|
||||
//
|
||||
// Retrieve Owner ...
|
||||
var device = identityProvider.GetDevice();
|
||||
var ownerUserInfo = identityProvider.GetUserInfo(
|
||||
device: device,
|
||||
userSelectByParam: source.OwnerId
|
||||
)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
var owner = ownerUserInfo.ToXPersonDto();
|
||||
|
||||
//
|
||||
// Setting Owner ...
|
||||
destination.Owner = owner;
|
||||
|
||||
//
|
||||
// Retrieve Owner ...
|
||||
// Retrieve Conversation ...
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
using System;
|
||||
using AutoMapper;
|
||||
using xAiModels.Models.Dtos;
|
||||
using xAiModels.Models.Entities;
|
||||
using xIdentityService.Extensions;
|
||||
using xIdentityService.Interfaces;
|
||||
|
||||
namespace xAiModels.Configurations.Entities
|
||||
{
|
||||
public class XAiProjectMappingAction : IMappingAction<XAiProject, XAiProjectDto>
|
||||
{
|
||||
private readonly IXIdentityProvider identityProvider;
|
||||
|
||||
public XAiProjectMappingAction(
|
||||
IXIdentityProvider identityProvider
|
||||
)
|
||||
{
|
||||
this.identityProvider = identityProvider;
|
||||
}
|
||||
|
||||
public void Process(
|
||||
XAiProject source,
|
||||
XAiProjectDto destination,
|
||||
ResolutionContext context
|
||||
)
|
||||
{
|
||||
//
|
||||
// Retrieve Owner ...
|
||||
var device = identityProvider.GetDevice();
|
||||
var ownerUserInfo = identityProvider.GetUserInfo(
|
||||
device: device,
|
||||
userSelectByParam: source.OwnerId
|
||||
)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
var owner = ownerUserInfo.ToXPersonDto();
|
||||
|
||||
//
|
||||
// Setting Owner ...
|
||||
destination.Owner = owner;
|
||||
|
||||
//
|
||||
// Retrieve Owner ...
|
||||
// Retrieve Title Resources ...
|
||||
// Retrieve Description Resources ...
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using AutoMapper;
|
||||
using xAiModels.Configurations.Entities;
|
||||
using xAiModels.Models.Dtos;
|
||||
using xAiModels.Models.Entities;
|
||||
|
||||
@@ -11,18 +10,15 @@ namespace xAiModels.Configurations
|
||||
{
|
||||
//
|
||||
// XAiMessage ...
|
||||
CreateMap<XAiMessage, XAiMessageDto>()
|
||||
.AfterMap<XAiMessageMappingAction>();
|
||||
CreateMap<XAiMessage, XAiMessageDto>();
|
||||
|
||||
//
|
||||
// XAiProject ...
|
||||
CreateMap<XAiProject, XAiProjectDto>()
|
||||
.AfterMap<XAiProjectMappingAction>();
|
||||
CreateMap<XAiProject, XAiProjectDto>();
|
||||
|
||||
//
|
||||
// XAiConversation ...
|
||||
CreateMap<XAiConversation, XAiConversationDto>()
|
||||
.AfterMap<XAiConversationMappingAction>();
|
||||
CreateMap<XAiConversation, XAiConversationDto>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user