Develop service

This commit is contained in:
2025-08-08 00:47:26 +08:00
parent a6dfe8712c
commit 77ccc9aeb5
43 changed files with 4842 additions and 584 deletions

View File

@@ -111,4 +111,23 @@ public static class ServiceInjectionHelper
return services;
}
}
public static IServiceCollection AddDevelopService(this IServiceCollection services)
{
services.AddSingleton<CustomAppService.CustomAppServiceClient>(sp =>
{
var etcdClient = sp.GetRequiredService<IEtcdClient>();
var config = sp.GetRequiredService<IConfiguration>();
var clientCertPath = config["Service:ClientCert"]!;
var clientKeyPath = config["Service:ClientKey"]!;
var clientCertPassword = config["Service:CertPassword"];
return GrpcClientHelper
.CreateCustomAppServiceClient(etcdClient, clientCertPath, clientKeyPath, clientCertPassword)
.GetAwaiter()
.GetResult();
});
return services;
}
}