From 46e98339480d853fc78a014c34d7ff9fcaf13890 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 05 十二月 2024 14:09:02 +0800
Subject: [PATCH] 产线协议

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/ICaching.cs |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 59 insertions(+), 0 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/ICaching.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/ICaching.cs"
new file mode 100644
index 0000000..052615c
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/ICaching.cs"
@@ -0,0 +1,59 @@
+锘縰sing Microsoft.Extensions.Caching.Distributed;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_Core.Caches
+{
+    /// <summary>
+    /// 缂撳瓨鎶借薄鎺ュ彛,鍩轰簬IDistributedCache灏佽
+    /// </summary>
+    public interface ICaching
+    {
+        public IDistributedCache Cache { get; }
+        void AddCacheKey(string cacheKey);
+        Task AddCacheKeyAsync(string cacheKey);
+
+        void DelByPattern(string key);
+        Task DelByPatternAsync(string key);
+
+        void DelCacheKey(string cacheKey);
+        Task DelCacheKeyAsync(string cacheKey);
+
+        bool Exists(string cacheKey);
+        Task<bool> ExistsAsync(string cacheKey);
+
+        List<string> GetAllCacheKeys();
+        Task<List<string>> GetAllCacheKeysAsync();
+
+        T Get<T>(string cacheKey);
+        Task<T> GetAsync<T>(string cacheKey);
+
+        object Get(Type type, string cacheKey);
+        Task<object> GetAsync(Type type, string cacheKey);
+
+        string GetString(string cacheKey);
+        Task<string> GetStringAsync(string cacheKey);
+
+        void Remove(string key);
+        Task RemoveAsync(string key);
+
+        void RemoveAll();
+        Task RemoveAllAsync();
+
+        void Set<T>(string cacheKey, T value, TimeSpan? expire = null);
+        Task SetAsync<T>(string cacheKey, T value);
+        Task SetAsync<T>(string cacheKey, T value, TimeSpan expire);
+
+        void SetPermanent<T>(string cacheKey, T value);
+        Task SetPermanentAsync<T>(string cacheKey, T value);
+
+        void SetString(string cacheKey, string value, TimeSpan? expire = null);
+        Task SetStringAsync(string cacheKey, string value);
+        Task SetStringAsync(string cacheKey, string value, TimeSpan expire);
+
+        Task DelByParentKeyAsync(string key);
+    }
+}

--
Gitblit v1.9.3