feat: add user-based ticket endpoints
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
using Matrix42.Extensions.Scaffolder.Core;
|
||||
using Matrix42.Extensions.Scaffolder.Core.Project;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Matrix42.Extensions.Scaffolder.ConsoleApp
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var config = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory()) // required for appsettings.json
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||
.Build();
|
||||
|
||||
var extensionPath = config["Scaffolder:ExtensionPath"];
|
||||
var extensionIdStr = config["Scaffolder:ExtensionId"];
|
||||
var extensionNamespace = config["Scaffolder:ExtensionNamespace"];
|
||||
|
||||
if (string.IsNullOrWhiteSpace(extensionPath))
|
||||
throw new Exception("Scaffolder:ExtensionPath is missing in appsettings.json");
|
||||
|
||||
var extensionId = Guid.TryParse(extensionIdStr, out var gid) ? gid : Guid.NewGuid();
|
||||
|
||||
var options = new ExtensionScaffoldingOptions
|
||||
{
|
||||
ExtensionPath = extensionPath,
|
||||
ExtensionId = extensionId,
|
||||
ExtensionNamespace = extensionNamespace,
|
||||
Projects = [
|
||||
new ProjectDefinition
|
||||
{
|
||||
Prefix = "Services",
|
||||
Runtimes = RuntimeTargets.WinCore | RuntimeTargets.LinuxCore,
|
||||
Functionality = ProjectFunctionality.WebApi
|
||||
},
|
||||
|
||||
new ProjectDefinition
|
||||
{
|
||||
Prefix = "Contracts",
|
||||
Runtimes = RuntimeTargets.All,
|
||||
Functionality = ProjectFunctionality.Custom
|
||||
},
|
||||
new ProjectDefinition
|
||||
{
|
||||
Prefix = "BizLogic",
|
||||
Runtimes = RuntimeTargets.All,
|
||||
Functionality = ProjectFunctionality.Custom
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var scaffolder = new ExtensionScaffolder();
|
||||
var projects = scaffolder.Generate(options);
|
||||
|
||||
Console.WriteLine("Generated projects:");
|
||||
foreach (var p in projects)
|
||||
Console.WriteLine(" - " + p);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user