BotSharp/src/Infrastructure/BotSharp.Abstraction/Plugins/Models/PluginMenuDef.cs
Jicheng Lu e96b217dfe 1. split knowledge menu
2. refine vector db
2024-08-20 13:32:22 -05:00

41 lines
1,023 B
C#

namespace BotSharp.Abstraction.Plugins.Models;
public class PluginMenuDef
{
[JsonIgnore]
public string Id { get; set; }
public string Label { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Icon { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Link { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? IsHeader { get; set; }
[JsonIgnore]
public int Weight { get; set; }
[JsonIgnore]
public List<string>? Roles { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<PluginMenuDef>? SubMenu { get; set; }
public PluginMenuDef(string label, string? link = null, string? icon = null, int weight = 0)
{
Label = label;
Link = link;
Icon = icon;
Weight = weight;
}
public override string ToString()
{
return $"{Label} {Link} {Weight}";
}
}