175 lines
5.8 KiB
C#
175 lines
5.8 KiB
C#
using BS.Shared.DataContracts.Compact;
|
|
using BS.Shared.Text;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace BS.Shared.DataContracts.Feature.AI
|
|
{
|
|
[DataContract]
|
|
public class AiPromptbausteinFolderDC : BeWoDataContract
|
|
{
|
|
[DataMember] public string Title { get; set; }
|
|
[DataMember] public string Description { get; set; }
|
|
[DataMember] public long? ParentFolderOid { get; set; }
|
|
[DataMember] public CompactEmployeeDC Creator { get; set; }
|
|
[DataMember] public bool IsPublic { get; set; }
|
|
[DataMember] public int Position { get; set; }
|
|
[DataMember] public bool IsExpanded { get; set; }
|
|
[DataMember] public AiActionType ActionType { get; set; }
|
|
[DataMember] public List<AiPromptbausteinFolderDC> SubFolders { get; set; }
|
|
[DataMember] public List<AiPromptbausteinPromptDC> SubPrompts { get; set; }
|
|
[DataMember] public List<AiPromptbausteinRoutineDC> SubRoutines { get; set; }
|
|
|
|
[DataMember] public bool CanAddFolder { get; set; }
|
|
[DataMember] public bool CanAddPrompt { get; set; }
|
|
[DataMember] public bool CanAddRoutine { get; set; }
|
|
[DataMember] public bool CanEdit { get; set; }
|
|
[DataMember] public bool IsNewFeature { get; set; }
|
|
}
|
|
|
|
public static class PredefinedAiPromptbausteinFolders
|
|
{
|
|
public static IEnumerable<AiPromptbausteinFolderDC> CreateSubTree(AiActionType aiActionType)
|
|
{
|
|
var example_node = CreateExampleNode(aiActionType);
|
|
example_node.SubPrompts.Add(CreateExamplePrompt(aiActionType));
|
|
example_node.SubPrompts.Add(CreateExamplePrompt(aiActionType));
|
|
example_node.SubPrompts.Add(CreateExamplePrompt(aiActionType));
|
|
var own_bib = CreateOwnBibNode(aiActionType);
|
|
own_bib.SubFolders.Add(example_node);
|
|
example_node.ParentFolderOid = own_bib.Oid;
|
|
//own_bib.SubPrompts.Add(CreateExamplePrompt(aiActionType));
|
|
//own_bib.SubPrompts.Add(CreateExamplePrompt(aiActionType));
|
|
//own_bib.SubPrompts.Add(CreateExamplePrompt(aiActionType));
|
|
//var shared_bib = CreateSharedBibNode(aiActionType);
|
|
var public_bib = CreatePublicBibNode(aiActionType);
|
|
|
|
return new List<AiPromptbausteinFolderDC>() {
|
|
own_bib, public_bib
|
|
};
|
|
}
|
|
|
|
public static AiPromptbausteinFolderDC CreateOwnBibNode(AiActionType aiActionType)
|
|
{
|
|
return new AiPromptbausteinFolderDC()
|
|
{
|
|
ActionType = aiActionType,
|
|
Description = AiPromptbausteineTexts.OwnBibNodeDescription,
|
|
Oid = -1,
|
|
ParentFolderOid = null,
|
|
SubFolders = new List<AiPromptbausteinFolderDC>(),
|
|
SubPrompts = new List<AiPromptbausteinPromptDC>(),
|
|
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
|
|
Title = AiPromptbausteineTexts.OwnBibNodeTitle,
|
|
Version = 1,
|
|
CanAddFolder = true,
|
|
CanAddPrompt = true,
|
|
CanAddRoutine = true,
|
|
IsExpanded = true,
|
|
};
|
|
}
|
|
|
|
//public static AiPromptbausteinFolderDC CreateSharedBibNode(AiActionType aiActionType)
|
|
//{
|
|
// return new AiPromptbausteinFolderDC()
|
|
// {
|
|
// ActionType = aiActionType,
|
|
// Description = AiPromptbausteineTexts.SharedBibNodeDescription,
|
|
// Oid = -2,
|
|
// ParentFolderOid = null,
|
|
// SubFolders = new List<AiPromptbausteinFolderDC>(),
|
|
// SubPrompts = new List<AiPromptbausteinPromptDC>(),
|
|
// Title = AiPromptbausteineTexts.SharedBibNodeTitle,
|
|
// Version = 1,
|
|
// IsExpanded = true,
|
|
// IsNewFeature = true
|
|
// };
|
|
//}
|
|
|
|
public static AiPromptbausteinFolderDC CreatePublicBibNode(AiActionType aiActionType)
|
|
{
|
|
return new AiPromptbausteinFolderDC()
|
|
{
|
|
ActionType = aiActionType,
|
|
Description = AiPromptbausteineTexts.PublicBibNodeDescription,
|
|
Oid = -3,
|
|
ParentFolderOid = null,
|
|
SubFolders = new List<AiPromptbausteinFolderDC>(),
|
|
SubPrompts = new List<AiPromptbausteinPromptDC>(),
|
|
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
|
|
Title = AiPromptbausteineTexts.PublicBibNodeTitle,
|
|
Version = 1,
|
|
IsExpanded = true
|
|
};
|
|
}
|
|
|
|
public static AiPromptbausteinFolderDC CreatePublicSharedBibNode(AiActionType aiActionType, string display)
|
|
{
|
|
return new AiPromptbausteinFolderDC()
|
|
{
|
|
ActionType = aiActionType,
|
|
Description = string.Format(AiPromptbausteineTexts.PublicSharedBibNodeDescription, display),
|
|
Oid = -31,
|
|
ParentFolderOid = null,
|
|
SubFolders = new List<AiPromptbausteinFolderDC>(),
|
|
SubPrompts = new List<AiPromptbausteinPromptDC>(),
|
|
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
|
|
Title = string.Format(AiPromptbausteineTexts.PublicSharedBibNodeTitle, display),
|
|
Version = 1,
|
|
IsExpanded = false
|
|
};
|
|
}
|
|
|
|
public static AiPromptbausteinFolderDC CreateOwnsoftBibNode(AiActionType aiActionType)
|
|
{
|
|
return new AiPromptbausteinFolderDC()
|
|
{
|
|
ActionType = aiActionType,
|
|
Description = AiPromptbausteineTexts.OwnsoftBibNodeDescription,
|
|
Oid = -4,
|
|
ParentFolderOid = null,
|
|
SubFolders = new List<AiPromptbausteinFolderDC>(),
|
|
SubPrompts = new List<AiPromptbausteinPromptDC>(),
|
|
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
|
|
Title = AiPromptbausteineTexts.OwnsoftBibNodeTitle,
|
|
Version = 1,
|
|
IsExpanded = true,
|
|
IsNewFeature = false
|
|
};
|
|
}
|
|
|
|
public static AiPromptbausteinFolderDC CreateExampleNode(AiActionType aiActionType)
|
|
{
|
|
return new AiPromptbausteinFolderDC()
|
|
{
|
|
ActionType = aiActionType,
|
|
Description = "Beispielbeschreibung",
|
|
Oid = -100,
|
|
ParentFolderOid = null,
|
|
SubFolders = new List<AiPromptbausteinFolderDC>(),
|
|
SubPrompts = new List<AiPromptbausteinPromptDC>(),
|
|
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
|
|
Title = "Beispiel Ordner",
|
|
Version = 1,
|
|
CanAddFolder = true,
|
|
CanAddPrompt = true,
|
|
CanEdit = true
|
|
};
|
|
}
|
|
|
|
public static AiPromptbausteinPromptDC CreateExamplePrompt(AiActionType aiActionType)
|
|
{
|
|
return new AiPromptbausteinPromptDC()
|
|
{
|
|
Oid = -101,
|
|
Description = "Beispielbeschreibung",
|
|
Title = "Beispieltitel",
|
|
Prompt = "Beispielprompt",
|
|
IsOwnsoftPrompt = true,
|
|
OwnsoftRefLink = "https://help.bewoplaner.de/"
|
|
};
|
|
}
|
|
}
|
|
}
|