Import from internal git

This commit is contained in:
2025-10-11 13:08:09 +02:00
commit 97aaa715dc
175 changed files with 7014 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
namespace Core.SpecConfig;
public enum GenerationType
{
Common = 0,
Server = 1,
Client = 2,
}

View File

@@ -0,0 +1,9 @@
namespace Core.SpecConfig;
public enum Language
{
Dotnet = 0,
Java = 1,
Javascript = 2
}

View File

@@ -0,0 +1,28 @@
namespace Core.SpecConfig;
public class PackageTypes
{
private readonly Dictionary<Language, List<GenerationType>> _types;
public PackageTypes()
{
_types = new Dictionary<Language, List<GenerationType>>();
}
public HashSet<Language> GetLanguages() => _types.Keys.ToHashSet();
public List<GenerationType> GetBy(Language language) => _types[language];
public void Add(Language language, List<GenerationType> types) => _types.Add(language, types);
public bool TryAdd(Language language, GenerationType types)
{
if (!_types.TryGetValue(language, out List<GenerationType>? value)) return false;
value.Add(types);
return true;
}
public bool Has(Language language, GenerationType type)
=> _types.ContainsKey(language) && _types[language].Contains(type);
}

View File

@@ -0,0 +1,17 @@
namespace Core.SpecConfig;
public class ProcessTask
{
public readonly Language Language;
public readonly GenerationType GenerationType;
public readonly PublishType PublishType;
public readonly Queue<ISpecFile> Tasks;
public ProcessTask(Language l, GenerationType g, PublishType p, Queue<ISpecFile> tasks)
{
Language = l;
GenerationType = g;
Tasks = tasks;
PublishType = p;
}
}

View File

@@ -0,0 +1,8 @@
namespace Core.SpecConfig;
public enum PublishType
{
No = 0,
Safe = 1,
Force = 2,
}

View File

@@ -0,0 +1,7 @@
namespace Core.SpecConfig;
public enum SpecType
{
Model = 0,
Api = 1,
}