151 lines
4.8 KiB
C#
151 lines
4.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
|
|
{
|
|
[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 bool CanAddFolder { get; set; }
|
|
[DataMember] public bool CanAddPrompt { 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, shared_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>(),
|
|
Title = AiPromptbausteineTexts.OwnBibNodeTitle,
|
|
Version = 1,
|
|
CanAddFolder = 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>(),
|
|
Title = AiPromptbausteineTexts.PublicBibNodeTitle,
|
|
Version = 1,
|
|
IsExpanded = true,
|
|
IsNewFeature = true
|
|
};
|
|
}
|
|
|
|
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>(),
|
|
Title = AiPromptbausteineTexts.OwnsoftBibNodeDescription,
|
|
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>(),
|
|
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/"
|
|
};
|
|
}
|
|
}
|
|
}
|