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

@@ -1,4 +1,5 @@
using System.Net;
using DysonNetwork.Develop.Identity;
using DysonNetwork.Shared.Auth;
using Microsoft.AspNetCore.HttpOverrides;
using Prometheus;
@@ -24,6 +25,8 @@ public static class ApplicationConfiguration
app.UseMiddleware<PermissionMiddleware>();
app.MapControllers();
app.MapGrpcService<CustomAppServiceGrpc>();
return app;
}

View File

@@ -5,6 +5,7 @@ using NodaTime.Serialization.SystemTextJson;
using System.Text.Json;
using DysonNetwork.Develop.Identity;
using DysonNetwork.Shared.Cache;
using StackExchange.Redis;
namespace DysonNetwork.Develop.Startup;
@@ -17,6 +18,11 @@ public static class ServiceCollectionExtensions
services.AddDbContext<AppDatabase>();
services.AddSingleton<IClock>(SystemClock.Instance);
services.AddHttpContextAccessor();
services.AddSingleton<IConnectionMultiplexer>(_ =>
{
var connection = configuration.GetConnectionString("FastRetrieve")!;
return ConnectionMultiplexer.Connect(connection);
});
services.AddSingleton<ICacheService, CacheServiceRedis>();
services.AddHttpClient();