| | |
| | | /// </summary> |
| | | public class MonitorRecordCacheHelper |
| | | { |
| | | public MonitorRecordCacheHelper() |
| | | { |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //Redis客户端辅助类对象 |
| | | private readonly RedisClientHelper _redisClient = new RedisClientHelper(); |
| | | private readonly RedisClientHelper _redisClient = null; |
| | | |
| | | |
| | | private static string CreateRedisKey(long monitorPointId) |
| | | { |
| | |
| | | /// <summary> |
| | | /// 设置最后一条记录 |
| | | /// </summary> |
| | | public void SetLastRecord(Model.MonitorRecord model) |
| | | public void SetLastRecord(Model.MonitorRecord model, out bool redis, out string info) |
| | | { |
| | | if (model == null) |
| | | return; |
| | | var redisKey = CreateRedisKey(model.MonitorPointID); |
| | | _redisClient.HashSetJosn(redisKey, _lastRecord, model); |
| | | info = string.Empty; |
| | | redis = false; |
| | | var redisKey = CreateRedisKey(model.MonitorPointID); |
| | | redis = _redisClient.HashSetJosn(redisKey, _lastRecord, model, out info); |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设置最后一条记录 |
| | | /// </summary> |
| | | public void SetLastRecord(IEnumerable<Model.MonitorRecord> list) |
| | | public void SetLastRecord(IEnumerable<Model.MonitorRecord> list, out string info) |
| | | { |
| | | info = "IStation.RedisCache.LinuxTest"; |
| | | if (list == null || list.Count() < 1) |
| | | return; |
| | | foreach (var item in list) |
| | | { |
| | | SetLastRecord(item); |
| | | SetLastRecord(item,out bool redis,out info); |
| | | } |
| | | } |
| | | |