添加项目文件。
This commit is contained in:
70
Epost.DAL/Cache/XgateCacheDAL.cs
Normal file
70
Epost.DAL/Cache/XgateCacheDAL.cs
Normal file
@ -0,0 +1,70 @@
|
||||
using ComposerSDK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL.Cache
|
||||
{
|
||||
public class XgateCacheDAL
|
||||
{
|
||||
private static object lockobj = new object();
|
||||
public static List<XGate> XgatesList = new List<XGate>();//
|
||||
|
||||
#region 获取Xgate列表
|
||||
public List<XGate> GetXgateList()
|
||||
{
|
||||
return XgatesList;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 初始Xgate列表
|
||||
public void ClearXgateList()
|
||||
{
|
||||
foreach (var item in XgatesList.ToArray())
|
||||
{
|
||||
XgatesList.Remove(item);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region xgate缓存处理方法
|
||||
/// <summary>
|
||||
/// xgate缓存处理方法
|
||||
/// </summary>
|
||||
/// <param name="JobParam"></param>
|
||||
/// <param name="EXgateCommend"></param>
|
||||
/// <returns></returns>
|
||||
public bool UpdateXgatesList(List<XGate> JobParam, EXgateCommend CommendType)
|
||||
{
|
||||
|
||||
lock (lockobj)
|
||||
{
|
||||
|
||||
if (CommendType.Equals(EXgateCommend.Create))
|
||||
{
|
||||
XgatesList.AddRange(JobParam);
|
||||
}
|
||||
|
||||
else if (CommendType.Equals(EXgateCommend.Execute))
|
||||
{
|
||||
JobParam.ForEach(m => XgatesList.Remove(m));
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user