change - 注释缓存逻辑,直接调用数据库

dev
WenJY 16 hours ago
parent d065a2b9ba
commit c76bb985fe

@ -60,9 +60,9 @@ builder.Services.Scan(scan => scan.FromAssemblies(assemblies)
builder.Services.AddSingleton(typeof(SerilogHelper)); builder.Services.AddSingleton(typeof(SerilogHelper));
builder.Services.AddSqlSugarSetup(); builder.Services.AddSqlSugarSetup();
builder.Services.AddFusionCache() // builder.Services.AddFusionCache()
.WithSerializer(new FusionCacheNewtonsoftJsonSerializer()) // .WithSerializer(new FusionCacheNewtonsoftJsonSerializer())
.WithDistributedCache(new SqliteCache(new SqliteCacheOptions { CachePath = apolloConfig["cachePath"]! })); // .WithDistributedCache(new SqliteCache(new SqliteCacheOptions { CachePath = apolloConfig["cachePath"]! }));
// ---- Swagger ---- // ---- Swagger ----
builder.Services.AddEndpointsApiExplorer(); builder.Services.AddEndpointsApiExplorer();

@ -61,9 +61,9 @@ builder.Services.Scan(scan => scan.FromAssemblies(assemblies)
builder.Services.AddSingleton(typeof(SerilogHelper)); builder.Services.AddSingleton(typeof(SerilogHelper));
builder.Services.AddSqlSugarSetup(); builder.Services.AddSqlSugarSetup();
builder.Services.AddPlcSetup(); builder.Services.AddPlcSetup();
builder.Services.AddFusionCache() // builder.Services.AddFusionCache()
.WithSerializer(new FusionCacheNewtonsoftJsonSerializer()) // .WithSerializer(new FusionCacheNewtonsoftJsonSerializer())
.WithDistributedCache(new SqliteCache(new SqliteCacheOptions { CachePath = apolloConfig["cachePath"]! })); // .WithDistributedCache(new SqliteCache(new SqliteCacheOptions { CachePath = apolloConfig["cachePath"]! }));
// ---- Swagger ---- // ---- Swagger ----
builder.Services.AddEndpointsApiExplorer(); builder.Services.AddEndpointsApiExplorer();

@ -71,12 +71,12 @@ public partial class App : Application
// 4. SqlSugar + FusionCache // 4. SqlSugar + FusionCache
services.AddSqlSugarSetup(); services.AddSqlSugarSetup();
services.AddFusionCache() // services.AddFusionCache()
.WithSerializer(new FusionCacheNewtonsoftJsonSerializer()) // .WithSerializer(new FusionCacheNewtonsoftJsonSerializer())
.WithDistributedCache(new SqliteCache(new SqliteCacheOptions // .WithDistributedCache(new SqliteCache(new SqliteCacheOptions
{ // {
CachePath = apolloConfig["cachePath"]! // CachePath = apolloConfig["cachePath"]!
})); // }));
// 5. 注册 ViewModel // 5. 注册 ViewModel
services.AddSingleton<ViewModels.NavigationViewModel>(); services.AddSingleton<ViewModels.NavigationViewModel>();

Loading…
Cancel
Save