feat: add user-based ticket endpoints
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Matrix42.Extensions.Scaffolder.Core\Matrix42.Extensions.Scaffolder.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="appsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"Scaffolder": {
|
||||
"ExtensionPath": "C:\\Projects\\Matrix42\\Titan_Linux\\ESM-FieldServiceManagement-Extension_demo",
|
||||
"ExtensionId": "c55407f9-9b46-4483-8b65-1bc1c3827efc",
|
||||
"ExtensionNamespace": "Matrix42.FieldServiceManagement"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user