This commit is contained in:
2026-04-24 00:33:50 +03:30
parent 8786470134
commit 5efd41754a
46 changed files with 1104 additions and 4 deletions
@@ -0,0 +1,27 @@
using System;
using xAiApi.AI.Interfaces.Entities;
using xAiApi.AI.Models.Entities;
using xDataService.Configuration;
using xDataService.GraphQL;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiConversationGraphQLTypeHelper : XBaseGraphQLTypeHelper<XAiConversation, Guid>, IXAiConversationGraphQLTypeHelper
{
public XAiConversationGraphQLTypeHelper(
XDataServiceConfiguration configuration
) : base(configuration)
{ }
public override string GetInQueryCollectionName()
{
return "aiConversations";
}
public override string GetInQuerySingleName()
{
return "aiConversation";
}
}
}
@@ -0,0 +1,23 @@
using System;
using GraphQL.Types;
using xAiApi.AI.Interfaces.Entities;
using xAiApi.AI.Models.Entities;
using xDataService.Configuration;
using xDataService.GraphQL;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiConversationGraphQuery : XBaseGraphQLQuery<XAiConversation, Guid, XAiConversationGraphType, GuidGraphType>
{
public XAiConversationGraphQuery(
XDataServiceConfiguration configuration,
IXAiConversationRepository repository,
IXAiConversationGraphQLTypeHelper helper
) : base(
configuration,
repository,
helper
)
{ }
}
}
@@ -0,0 +1,13 @@
using System;
using GraphQL.Types;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiConversationGraphSchema : Schema
{
public XAiConversationGraphSchema(IServiceProvider services) : base(services)
{
Query = (XAiConversationGraphQuery)services.GetService(typeof(XAiConversationGraphQuery));
}
}
}
@@ -0,0 +1,17 @@
using System;
using xAiApi.AI.Models.Entities;
using xDataService.GraphQL;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiConversationGraphType : XBaseGraphObjectType<XAiConversation, Guid>
{
public XAiConversationGraphType() : base()
{
Field(x => x.Title);
Field(x => x.Messages);
Field(x => x.CreatedOn);
Field(x => x.UpdatedAt);
}
}
}
@@ -0,0 +1,26 @@
using System;
using xAiApi.AI.Interfaces.Entities;
using xAiApi.AI.Models.Entities;
using xDataService.Configuration;
using xDataService.GraphQL;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiMessageGraphQLTypeHelper : XBaseGraphQLTypeHelper<XAiMessage, Guid>, IXAiMessageGraphQLTypeHelper
{
public XAiMessageGraphQLTypeHelper(
XDataServiceConfiguration configuration
) : base(configuration)
{ }
public override string GetInQueryCollectionName()
{
return "aiMessages";
}
public override string GetInQuerySingleName()
{
return "aiMessage";
}
}
}
@@ -0,0 +1,23 @@
using System;
using GraphQL.Types;
using xAiApi.AI.Interfaces.Entities;
using xAiApi.AI.Models.Entities;
using xDataService.Configuration;
using xDataService.GraphQL;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiMessageGraphQuery : XBaseGraphQLQuery<XAiMessage, Guid, XAiMessageGraphType, GuidGraphType>
{
public XAiMessageGraphQuery(
XDataServiceConfiguration configuration,
IXAiMessageRepository repository,
IXAiMessageGraphQLTypeHelper helper
) : base(
configuration,
repository,
helper
)
{ }
}
}
@@ -0,0 +1,13 @@
using System;
using GraphQL.Types;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiMessageGraphSchema : Schema
{
public XAiMessageGraphSchema(IServiceProvider services) : base(services)
{
Query = (XAiMessageGraphQuery)services.GetService(typeof(XAiMessageGraphQuery));
}
}
}
@@ -0,0 +1,19 @@
using System;
using xAiApi.AI.Models.Entities;
using xDataService.GraphQL;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiMessageGraphType : XBaseGraphObjectType<XAiMessage, Guid>
{
public XAiMessageGraphType() : base()
{
Field(x => x.Role);
Field(x => x.Content);
Field(x => x.Metadata);
Field(x => x.CreatedOn);
Field(x => x.UpdatedAt);
Field(x => x.ConversationId);
}
}
}
@@ -0,0 +1,27 @@
using System;
using xAiApi.AI.Interfaces.Entities;
using xAiApi.AI.Models.Entities;
using xDataService.Configuration;
using xDataService.GraphQL;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiProjectGraphQLTypeHelper : XBaseGraphQLTypeHelper<XAiProject, Guid>, IXAiProjectGraphQLTypeHelper
{
public XAiProjectGraphQLTypeHelper(
XDataServiceConfiguration configuration
) : base(configuration)
{ }
public override string GetInQueryCollectionName()
{
return "aiProjects";
}
public override string GetInQuerySingleName()
{
return "aiProjects";
}
}
}
@@ -0,0 +1,23 @@
using System;
using GraphQL.Types;
using xAiApi.AI.Interfaces.Entities;
using xAiApi.AI.Models.Entities;
using xDataService.Configuration;
using xDataService.GraphQL;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiProjectGraphQuery : XBaseGraphQLQuery<XAiProject, Guid, XAiProjectGraphType, GuidGraphType>
{
public XAiProjectGraphQuery(
XDataServiceConfiguration configuration,
IXAiProjectRepository repository,
IXAiProjectGraphQLTypeHelper helper
) : base(
configuration,
repository,
helper
)
{ }
}
}
@@ -0,0 +1,13 @@
using System;
using GraphQL.Types;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiProjectGraphSchema : Schema
{
public XAiProjectGraphSchema(IServiceProvider services) : base(services)
{
Query = (XAiProjectGraphQuery)services.GetService(typeof(XAiProjectGraphQuery));
}
}
}
@@ -0,0 +1,19 @@
using System;
using xAiApi.AI.Models.Entities;
using xDataService.GraphQL;
namespace xAiApi.AI.DataHelper.GraphQL
{
public class XAiProjectGraphType : XBaseGraphObjectType<XAiProject, Guid>
{
public XAiProjectGraphType() : base()
{
Field(x => x.Title);
Field(x => x.Prompt);
Field(x => x.CreatedOn);
Field(x => x.UpdatedAt);
Field(x => x.Description);
Field(x => x.Conversations);
}
}
}