This commit is contained in:
2026-08-03 09:44:56 +03:30
parent fa31d693d9
commit 5578c6cb2e
4 changed files with 82 additions and 16 deletions
@@ -1,10 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AutoMapper; using AutoMapper;
using xAiModels.Interfaces;
using xAiModels.Models.Dtos; using xAiModels.Models.Dtos;
using xAiModels.Models.Entities; using xAiModels.Models.Entities;
using xIdentityService.Extensions;
using xIdentityService.Interfaces; using xIdentityService.Interfaces;
namespace xAiModels.Configurations.Entities namespace xAiModels.Configurations.Entities
@@ -12,14 +11,23 @@ namespace xAiModels.Configurations.Entities
public class XAiConversationMappingAction : IMappingAction<XAiConversation, XAiConversationDto> public class XAiConversationMappingAction : IMappingAction<XAiConversation, XAiConversationDto>
{ {
private readonly IXIdentityProvider identityProvider; private readonly IXIdentityProvider identityProvider;
private readonly IXAiProjectTitleResourceProvider projectTitleResourceProvider;
private readonly IXAiConversationTitleResourceProvider conversationTitleResourceProvider;
private readonly IXAiProjectDescriptionResourceProvider projectDescriptionResourceProvider;
public XAiConversationMappingAction( public XAiConversationMappingAction(
IXIdentityProvider identityProvider IXIdentityProvider identityProvider,
IXAiProjectTitleResourceProvider projectTitleResourceProvider,
IXAiConversationTitleResourceProvider conversationTitleResourceProvider,
IXAiProjectDescriptionResourceProvider projectDescriptionResourceProvider
) )
{ {
this.identityProvider = identityProvider; this.identityProvider = identityProvider;
this.projectTitleResourceProvider = projectTitleResourceProvider;
this.conversationTitleResourceProvider = conversationTitleResourceProvider;
this.projectDescriptionResourceProvider = projectDescriptionResourceProvider;
} }
public void Process( public void Process(
XAiConversation source, XAiConversation source,
XAiConversationDto destination, XAiConversationDto destination,
@@ -28,6 +36,19 @@ namespace xAiModels.Configurations.Entities
{ {
// //
// Retrieve Owner ... // 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 ... // Retrieve Project Info ...
throw new NotImplementedException(); throw new NotImplementedException();
} }
@@ -1,10 +1,8 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
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.Extensions;
using xIdentityService.Interfaces; using xIdentityService.Interfaces;
namespace xAiModels.Configurations.Entities namespace xAiModels.Configurations.Entities
@@ -26,6 +24,21 @@ namespace xAiModels.Configurations.Entities
ResolutionContext context 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 Owner ...
// Retrieve Conversation ... // Retrieve Conversation ...
@@ -1,10 +1,8 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
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.Extensions;
using xIdentityService.Interfaces; using xIdentityService.Interfaces;
namespace xAiModels.Configurations.Entities namespace xAiModels.Configurations.Entities
@@ -26,6 +24,21 @@ namespace xAiModels.Configurations.Entities
ResolutionContext context 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 Owner ...
// Retrieve Title Resources ... // Retrieve Title Resources ...
+24 -5
View File
@@ -21,10 +21,14 @@ namespace xAiModels.Models.Dtos
public virtual XPersonDto Owner { get; set; } = null; public virtual XPersonDto Owner { get; set; } = null;
/// <summary> /// <summary>
/// Title of Conversation ... /// Conversation Title Resource ID ...
/// </summary> /// </summary>
public string Title { get; set; } public string Title { get; set; }
public virtual XLocaleResourceDto[] TitleLocales { get; set; }
/// <summary>
/// All Exists Title Locale Resources ...
/// </summary>
public virtual XLocaleResourceDto[] TitleLocales { get; set; }
/// <summary> /// <summary>
/// Created Time ... /// Created Time ...
@@ -39,11 +43,26 @@ namespace xAiModels.Models.Dtos
/// <summary> /// <summary>
/// Project ID ... /// Project ID ...
/// </summary> /// </summary>
public Guid ProjectId { get; set; } public Guid ProjectId { get; set; }
public virtual string ProjectTitle { get; set; } = null; /// <summary>
public virtual string ProjectDescription { get; set; } = null; /// Project Title Resource ID ...
/// </summary>
public virtual string ProjectTitle { get; set; } = null;
/// <summary>
/// Project Description Resource ID ...
/// </summary>
public virtual string ProjectDescription { get; set; } = null;
/// <summary>
/// Project Title Locale Resources ...
/// </summary>
public virtual XLocaleResourceDto[] ProjectTitleLocales { get; set; } public virtual XLocaleResourceDto[] ProjectTitleLocales { get; set; }
/// <summary>
/// Project Description Locale Resources ...
/// </summary>
public virtual XLocaleResourceDto[] ProjectDescriptionLocales { get; set; } public virtual XLocaleResourceDto[] ProjectDescriptionLocales { get; set; }
} }
} }