Ejemplo n.º 1
0
        public BasicResponse <List <JC_MbInfo> > GetAllAlarmCache(RatioAlarmCacheGetAllRequest alarmCacheRequest)
        {
            var alarmCache         = RatioAlarmCache.AlarmCacheInstance.Query();
            var alarmCacheResponse = new BasicResponse <List <JC_MbInfo> >();

            alarmCacheResponse.Data = alarmCache;
            return(alarmCacheResponse);
        }
        /// <summary>
        /// 结束所有内存报警,在线程stop前执行此操作
        /// </summary>
        private void EndAllAlarmByCache(DateTime etime)
        {
            List <JC_MbInfo>             alarmItems = new List <JC_MbInfo>();
            RatioAlarmCacheGetAllRequest ratioAlarmCacheGetAllRequest = new RatioAlarmCacheGetAllRequest();
            var result = ratioAlarmCacheService.GetAllAlarmCache(ratioAlarmCacheGetAllRequest);

            if (result.Data != null && result.IsSuccess)
            {
                alarmItems = result.Data;
                alarmItems.ForEach(a =>
                {
                    a.Etime = etime;
                });
                EndAlarmItems(result.Data);
            }
        }
        /// <summary>
        /// 获取所有报警缓存
        /// </summary>
        /// <param name="alarmCacheRequest"></param>
        /// <returns></returns>
        public BasicResponse <List <JC_MbInfo> > GetAllAlarmCache(RatioAlarmCacheGetAllRequest alarmCacheRequest)
        {
            var responsestr = HttpClientHelper.Post(Webapi + "/v1/ratioalarm/GetAllAlarmCache?token=" + Token, JSONHelper.ToJSONString(alarmCacheRequest));

            return(JSONHelper.ParseJSONString <BasicResponse <List <JC_MbInfo> > >(responsestr));
        }
 public BasicResponse <List <JC_MbInfo> > GetAllAlarmCache(RatioAlarmCacheGetAllRequest alarmCacheRequest)
 {
     return(alarmService.GetAllAlarmCache(alarmCacheRequest));
 }