|
@@ -0,0 +1,45 @@
|
|
|
+using fis.Log;
|
|
|
+using fis.Managers.Interfaces;
|
|
|
+using System.Collections.Generic;
|
|
|
+
|
|
|
+namespace fis.Win.Managers
|
|
|
+{
|
|
|
+ internal class ReportTemplateCacheManager : IReportTemplateCacheManager
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private Dictionary<string, string> _templateInfos = new();
|
|
|
+
|
|
|
+ public void SetTemplateJson(string code,string json)
|
|
|
+ {
|
|
|
+ if (_templateInfos.ContainsKey(code))
|
|
|
+ {
|
|
|
+ _templateInfos[code] = json;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _templateInfos.Add(code, json);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public string GetTemplateByCode(string code)
|
|
|
+ {
|
|
|
+ if (_templateInfos.ContainsKey(code))
|
|
|
+ {
|
|
|
+ return _templateInfos[code];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Logger.Write("GetTemplateByCode error,code not exist: " + code);
|
|
|
+ }
|
|
|
+ return string.Empty;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void Dispose()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|