From 51922d7093b9c8f52417bfdd0fe9aa087d1fb5be Mon Sep 17 00:00:00 2001
From: xiazhengtongxue <133085197+xiazhengtongxue@users.noreply.github.com>
Date: 星期五, 01 五月 2026 18:31:01 +0800
Subject: [PATCH] feat: 优化仓库仪表盘界面并添加电池和空托盘统计功能
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/MemoryCacheService.cs | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/MemoryCacheService.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/MemoryCacheService.cs
index 60a2d72..c179eb5 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/MemoryCacheService.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/MemoryCacheService.cs
@@ -9,11 +9,11 @@
{
public class MemoryCacheService : ICacheService
{
- protected IMemoryCache _cache;
+ private readonly IMemoryCache _cache;
+
public MemoryCacheService(IMemoryCache cache)
{
- _cache = cache;
-
+ _cache = cache ?? throw new ArgumentNullException(nameof(cache));
}
public bool Add(string key, string value, int expireSeconds = -1, bool isSliding = false)
@@ -54,8 +54,7 @@
public void Dispose()
{
- if (_cache != null)
- _cache.Dispose();
+ _cache?.Dispose();
GC.SuppressFinalize(this);
}
@@ -68,7 +67,7 @@
return _cache.Get(key) != null;
}
- public T Get<T>(string key) where T : class
+ public T? Get<T>(string key) where T : class
{
if (key == null)
{
--
Gitblit v1.9.3