Exemplo n.º 1
0
        public HttpResponseMessage GetToken(string staff)
        {
            ResultMessage msg      = null;
            int           staffMsg = 0;

            //检测staff合法性
            if (string.IsNullOrEmpty(staff) || !int.TryParse(staff, out staffMsg))
            {
                msg            = new ResultMessage();
                msg.StatusCode = (int)StatusCodeEnum.ParameterError;
                msg.Info       = StatusCodeEnum.ParameterError.GetEnumText();
                msg.Data       = string.Empty;

                return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(msg)));
            }

            //从Cache中获取Token,如果为空则创建Token
            Token token = (Token)HttpRuntime.Cache.Get(staffMsg.ToString());

            if (null == token)
            {
                token            = new Token();
                token.StaffId    = staffMsg;
                token.SignToken  = Guid.NewGuid();
                token.ExpireTime = DateTime.Now.AddDays(1);
                HttpRuntime.Cache.Insert(staffMsg.ToString(), token, null, token.ExpireTime, TimeSpan.Zero);
            }

            //返回信息
            msg.StatusCode = (int)StatusCodeEnum.Success;
            msg.Info       = token.StaffId.ToString();
            msg.Data       = token;
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(msg)));
        }
Exemplo n.º 2
0
        public HttpResponseMessage QueryRealtimeAlarmEx([FromBody] RealtimeAlarmQueryParam RealtimeAlarmQueryParams)
        {
            QueryResultBase queryResult = new QueryResultBase();

            List <AlarmInfoEx> queryAlarm = CompanyManagerHelper.QueryRealtimeAlarmEx(RealtimeAlarmQueryParams);

            //List<AlarmInfo> testAlarm = new List<AlarmInfo>();

            //if (queryAlarm.Count() >0)
            //{
            //    testAlarm.Add(queryAlarm[0].AlarmInfoObject);

            //    queryResult = new QueryResultBase();
            //    queryResult.ResultCode = QueryResultCodeEnum.QUERY_SUCCESS;
            //    queryResult.QueryData = testAlarm;
            //    return HttpResponseExtension.toJson(JsonConvert.SerializeObject(queryResult));
            //}



            queryResult            = new QueryResultBase();
            queryResult.ResultCode = QueryResultCodeEnum.QUERY_SUCCESS;
            queryResult.QueryData  = queryAlarm;
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(queryResult)));
        }
        public HttpResponseMessage GetCompanyAlarmUpdateState(string CompanyCode)
        {
            ResultMsg resultMsg = null;
            bool      res       = true;
            string    strCompanyAlarmUpdateUuid = "";

            LoggerManager.Log.Info("Get Company Alarm Update State!\n");

            try
            {
                var    client         = RedisManager.GetClient();
                string RedisHashName  = $"DeviceStatusTable";
                string keyAlarmUpdate = $"[{CompanyCode}]-AlarmUpdateCode";
                // Dictionary<string, string> TagDictionary = UploadDatas.Datas.ToDictionary(x => x.TagName, y => y.TagValue);
                strCompanyAlarmUpdateUuid = client.HGet(RedisHashName, keyAlarmUpdate);
            }
            catch (Exception ex)
            {
                //return res;
            }

            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = "";
            resultMsg.Data       = strCompanyAlarmUpdateUuid;

            // LoggerManager.Log.Info(JsonConvert.SerializeObject(resultMsg) + "\n");

            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 根据用户名获取token
        /// </summary>
        /// <param name="staffId"></param>
        /// <returns></returns>
        public HttpResponseMessage GetToken(string appkey)
        {
            ResultMsg resultMsg = null;

            //判断参数是否合法
            if (string.IsNullOrEmpty(appkey))
            {
                resultMsg            = new ResultMsg();
                resultMsg.StatusCode = (int)StatusCodeEnum.ParameterError;
                resultMsg.Info       = StatusCodeEnum.ParameterError.GetEnumText();
                resultMsg.Data       = "";
                return(HttpResponseExtension.toJson(Newtonsoft.Json.JsonConvert.SerializeObject(resultMsg)));
            }

            //插入缓存
            Token token = (Token)HttpRuntime.Cache.Get(appkey);

            if (HttpRuntime.Cache.Get(appkey) == null)
            {
                token            = new Token();
                token.StaffId    = appkey;
                token.SignToken  = Guid.NewGuid();
                token.ExpireTime = DateTime.Now.AddDays(1);
                HttpRuntime.Cache.Insert(token.StaffId.ToString(), token, null, token.ExpireTime, TimeSpan.Zero);
            }

            //返回token信息
            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = "";
            resultMsg.Data       = token;

            return(HttpResponseExtension.toJson(Newtonsoft.Json.JsonConvert.SerializeObject(resultMsg).ToLower()));
        }
Exemplo n.º 5
0
        //[EnableCors("http://localhost:8805","*","*")]
        public HttpResponseMessage LoginOn(string userName, string passWord, string timestamp, bool remeberMe = false,
                                           string returnUrl = "")
        {
            var UserValidate = MemberShipBase.GetMemberShipServiceInstance().ValidateLogin(userName, passWord);

            if (!UserValidate.Item1)
            {
                resultMsg            = new ResultMsg();
                resultMsg.StatusCode = (int)StatusCodeEnum.Unauthorized;
                resultMsg.Info       = StatusCodeEnum.Unauthorized.GetEnumText();
                resultMsg.Data       = UserValidate.Item2;
                return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
            }


            var data = MemberShipBase.GetMemberShipServiceInstance().GetToken(userName, timestamp, remeberMe);

            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = StatusCodeEnum.Success.GetEnumText();
            resultMsg.Data       = data;

            //var getRole=
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 6
0
        public HttpResponseMessage GetUserInfoById(dynamic obj)
        {
            var id   = Guid.Parse((obj.Id).ToString());
            var data = server.GetUserInfoById(id);

            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(data)));
        }
        public HttpResponseMessage InsertData([FromBody] InsertParamsFileUpload InsertParams)
        {
            ResultMsg             resultMsg = null;
            List <FileUploadInfo> queryFileUploadInfoList = null;
            bool res = true;


            FileUploadInfoQueryHelper tempQueryHelper = new FileUploadInfoQueryHelper();

            tempQueryHelper.Initialize(InsertParams.CompanyCode, InsertParams.DeviceCode);

            res = tempQueryHelper.InsertFileUploadInfo(InsertParams.FileUploadObject);

            if (res == true)
            {
                resultMsg            = new ResultMsg();
                resultMsg.StatusCode = (int)StatusCodeEnum.Success;
                resultMsg.Info       = "";
            }
            else
            {
                resultMsg            = new ResultMsg();
                resultMsg.StatusCode = (int)StatusCodeEnum.InsertRecordError;
                resultMsg.Info       = StatusCodeEnum.InsertRecordError.GetEnumText();;
                resultMsg.Data       = queryFileUploadInfoList;
            }



            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 8
0
        public HttpResponseMessage GetToken(string staffId)
        {
            ResultMsg resultMsg = null;
            int       id        = 0;

            //判断参数是否合法
            if (string.IsNullOrEmpty(staffId) || (!int.TryParse(staffId, out id)))
            {
                //不合法
                resultMsg            = new ResultMsg();
                resultMsg.StatusCode = (int)StatusCodeEnum.ParameterError;
                resultMsg.Info       = StatusCodeEnum.ParameterError.GetEnumText();
                resultMsg.Data       = "";
                return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
            }
            //插入缓存
            Token token = (Token)HttpRuntime.Cache.Get(id.ToString());

            if (HttpRuntime.Cache.Get(id.ToString()) == null)
            {
                token            = new Token();
                token.StaffId    = id;
                token.SignToken  = Guid.NewGuid();
                token.ExpireTime = DateTime.Now.AddDays(1);
                HttpRuntime.Cache.Insert(token.StaffId.ToString(), token, null, token.ExpireTime, TimeSpan.Zero);
            }
            //返回token信息
            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = "";
            resultMsg.Data       = token;

            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 9
0
 public HttpResponseMessage GetProduct(string id)
 {
     resultMsg            = new ResultMsg();
     resultMsg.StatusCode = (int)StatusCodeEnum.Success;
     resultMsg.Info       = StatusCodeEnum.Success.GetEnumText();
     resultMsg.Data       = "";
     return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
 }
Exemplo n.º 10
0
        public HttpResponseMessage UploadTest1()
        {
            QueryResultBase queryResult = null;

            queryResult            = new QueryResultBase();
            queryResult.ResultCode = QueryResultCodeEnum.QUERY_ERROR_GET_DEVICE_STORE_CONFIG;

            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(queryResult)));
        }
Exemplo n.º 11
0
        public HttpResponseMessage GetAllUserList(String CompanyCode)
        {
            QueryResultBase queryResult = new QueryResultBase();

            queryResult.QueryData  = UserManagerHelper.GetAllUserList(CompanyCode);
            queryResult.ResultCode = QueryResultCodeEnum.QUERY_SUCCESS;


            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(queryResult)));
        }
Exemplo n.º 12
0
        public HttpResponseMessage SaveFileToSql(dynamic obj)
        {
            ImgFilesDTO dto = new ImgFilesDTO();

            dto.imgId   = Guid.Parse(Convert.ToString(obj.imgId));
            dto.imgName = Convert.ToString(obj.imgName);
            dto.imgUrl  = Convert.ToString(obj.imgUrl);
            service.SaveImg(dto);
            return(HttpResponseExtension.toJson("上传成功!"));
        }
Exemplo n.º 13
0
        public HttpResponseMessage AddProudct(Product product)
        {
            ResultMsg resultMsg = null;

            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = StatusCodeEnum.Success.GetEnumText();
            resultMsg.Data       = product;
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 14
0
        public HttpResponseMessage GetList(string id)
        {
            var a = AccountService.GetInstance().GetModelById(1);

            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = StatusCodeEnum.Success.GetEnumText();
            resultMsg.Data       = a;
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 15
0
        public HttpResponseMessage GetUserInfo(string userName)
        {
            var data = MemberShipBase.GetMemberShipServiceInstance().GetUserInfo(userName);

            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = StatusCodeEnum.Success.GetEnumText();
            resultMsg.Data       = data;
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 16
0
        public HttpResponseMessage AddProduct([FromBody] Product product)
        {
            ResultMsg msg = new ResultMsg()
            {
                StatusCode = (int)StatusCodeEnum.Success,
                Info       = StatusCodeEnum.Success.GetEnumText(),
                Data       = product
            };

            return(HttpResponseExtension.toJson(msg));
        }
Exemplo n.º 17
0
        public HttpResponseMessage QueryRealtimeAlarm([FromBody] AlarmQueryParam QueryParams)
        {
            QueryResultBase queryResult = new QueryResultBase();

            List <AlarmInfo> queryAlarm = CompanyManagerHelper.QueryRealtimeAlarm(QueryParams);

            queryResult            = new QueryResultBase();
            queryResult.ResultCode = QueryResultCodeEnum.QUERY_SUCCESS;
            queryResult.QueryData  = queryAlarm;
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(queryResult)));
        }
Exemplo n.º 18
0
 public HttpResponseMessage GetBlogsInfo([FromBody] string Id)
 {
     try
     {
         var result = service.GetBlogsInfo(Guid.Parse(Id));
         return(HttpResponseExtension.toJson(result));
     }
     catch (Exception)
     {
         return(HttpResponseExtension.toJson("请先登录!"));
     }
 }
Exemplo n.º 19
0
        public HttpResponseMessage GetHospital(string id)
        {
            var data = BLLFactory <MedHospitalMgr> .Instance.FindByID("70adc6ee-68fc-413e-bfda-cc1c4a97859a");

            ResultMsg resultMsg = null;

            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = StatusCodeEnum.Success.GetEnumText();
            resultMsg.Data       = data;
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 20
0
        public HttpResponseMessage GetProduct(string id)
        {
            var product = new Product {
                Id = 110, Name = "HH", Price = 92, Count = 1
            };

            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = StatusCodeEnum.Success.GetEnumText();
            resultMsg.Data       = product;
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 21
0
 public HttpResponseMessage Modify(Sys_UserDTO udto)
 {
     try
     {
         server.Modify(udto);
         return(HttpResponseExtension.toJson(new { info = "成功", content = "恭喜你修改成功了哦!" }));
     }
     catch (Exception ex)
     {
         UnitExtension.Log(ex);
         return(HttpResponseExtension.toJson(new { info = "错误", content = "更新信息出错啦!" }));
     }
 }
Exemplo n.º 22
0
        public HttpResponseMessage GetProduct(string id)
        {
            var product = new Product()
            {
                Id = 1, Name = "哇哈哈", Count = 10, Price = 38.8
            };
            ResultMsg resultMsg = null;

            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = StatusCodeEnum.Success.GetEnumText();
            resultMsg.Data       = product;
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg).ToLower()));
        }
Exemplo n.º 23
0
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
            ResultMsg resultMsg = null;
            string    appId     = string.Empty;
            string    sign      = string.Empty;

            if (actionContext.Request.Headers.Contains("appid"))
            {
                appId = HttpUtility.UrlDecode(actionContext.Request.Headers.GetValues("appid").FirstOrDefault());
            }
            if (actionContext.Request.Headers.Contains("sign"))
            {
                sign = HttpUtility.UrlDecode(actionContext.Request.Headers.GetValues("sign").FirstOrDefault());
            }
            //判断操作的controller名称是否是图片上传
            if (actionContext.ActionDescriptor.ActionName == "SaveFileToSql")
            {
                base.OnActionExecuting(actionContext);
                return;
            }

            //判断请求头是否包含以下参数
            if (string.IsNullOrEmpty(appId) || string.IsNullOrEmpty(sign))
            {
                resultMsg              = new ResultMsg();
                resultMsg.StatusCode   = (int)StatusCodeEnum.ParameterError;
                resultMsg.Info         = StatusCodeEnum.ParameterError.GetEnumText();
                resultMsg.Data         = "";
                actionContext.Response = HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg));
                base.OnActionExecuting(actionContext);
                return;
            }
            //验证签名算法
            bool result = SignExtension.Validate(appId, sign);

            if (!result)
            {
                resultMsg              = new ResultMsg();
                resultMsg.StatusCode   = (int)StatusCodeEnum.HttpRequestError;
                resultMsg.Info         = StatusCodeEnum.HttpRequestError.GetEnumText();
                resultMsg.Data         = "";
                actionContext.Response = HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg));
                base.OnActionExecuting(actionContext);
                return;
            }
        }
        public HttpResponseMessage StopDeviceDataRecord(string CompanyCode, string DeviceCode)
        {
            ResultMsg resultMsg = null;

            LoggerManager.Log.Info($"Company<{CompanyCode}>-Device<{DeviceCode}> stop data record.......!\n");

            string mqttTopic = CompanyCode + "/" + DeviceCode + "/StopDataRecord";

            MqttManager.client_MqttMsgPublist(mqttTopic, "");


            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = "";
            resultMsg.Data       = "";
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 25
0
        public HttpResponseMessage GetToken([FromBody] LoginUserInfo loginUser)
        {
            ResultMsg resultMsg = null;
            int       id        = 0;

            //判断参数是否合法
            if (string.IsNullOrEmpty(loginUser.Timestamp) || (int.TryParse(loginUser.Timestamp, out id)))
            {
                resultMsg            = new ResultMsg();
                resultMsg.StatusCode = (int)StatusCodeEnum.ParameterError;
                resultMsg.Info       = StatusCodeEnum.ParameterError.GetEnumText();
                resultMsg.Data       = "";
                return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
            }

            UserInfo currUserInfo = UserManagerHelper.CheckUser(loginUser);

            if (currUserInfo == null)
            {
                resultMsg            = new ResultMsg();
                resultMsg.StatusCode = (int)StatusCodeEnum.UnknownUserOrPassword;
                resultMsg.Info       = StatusCodeEnum.UnknownUserOrPassword.GetEnumText();
                resultMsg.Data       = "";
                return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
            }

            //插入缓存
            Token token = (Token)HttpRuntime.Cache.Get(id.ToString());

            if (HttpRuntime.Cache.Get(id.ToString()) == null)
            {
                token            = new Token();
                token.StaffId    = id;
                token.SignToken  = Guid.NewGuid();
                token.ExpireTime = DateTime.Now.AddDays(1);
                HttpRuntime.Cache.Insert(token.StaffId.ToString(), token, null, token.ExpireTime, TimeSpan.Zero);
            }

            //返回token信息
            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = getJsonByObject(currUserInfo);
            resultMsg.Data       = token;

            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 26
0
        /// <summary>
        /// 根据用户名获取token
        /// </summary>
        /// <param name="staffId"></param>
        /// <returns></returns>
        public HttpResponseMessage GetToken(string staffId)
        {
            ResultMsg resultMsg = null;

            try
            {
                string id = "";

                //判断参数是否合法
                if (string.IsNullOrEmpty(staffId))
                {
                    resultMsg            = new ResultMsg();
                    resultMsg.StatusCode = (int)StatusCodeEnum.ParameterError;
                    resultMsg.Info       = StatusCodeEnum.ParameterError.GetEnumText();
                    resultMsg.Data       = "";
                    Console.WriteLine(resultMsg.ToString());
                    return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
                }

                //插入缓存
                Token token = (Token)HttpRuntime.Cache.Get(staffId);
                //Console.WriteLine(token.ToString());
                if (HttpRuntime.Cache.Get(staffId) == null)
                {
                    token            = new Token();
                    token.StaffId    = staffId;
                    token.SignToken  = Guid.NewGuid();
                    token.ExpireTime = DateTime.Now.AddDays(1);
                    //Console.WriteLine(resultMsg.ToString());
                    HttpRuntime.Cache.Insert(token.StaffId, token, null, token.ExpireTime, TimeSpan.Zero);
                }

                //返回token信息
                resultMsg            = new ResultMsg();
                resultMsg.StatusCode = (int)StatusCodeEnum.Success;
                resultMsg.Info       = "";
                resultMsg.Data       = token;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + "\t" + ex.StackTrace);
            }
            Console.WriteLine(resultMsg.ToString());
            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
Exemplo n.º 27
0
        public HttpResponseMessage UpdateUser(UserInfo UpdateUser)
        {
            QueryResultBase queryResult = new QueryResultBase();

            bool Res = UserManagerHelper.ModifyUser(UpdateUser);

            if (Res == true)
            {
                queryResult.ResultCode = QueryResultCodeEnum.QUERY_SUCCESS;
            }
            else
            {
                queryResult.ResultCode = QueryResultCodeEnum.QUERY_ERROR_DB_SQL;
            }


            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(queryResult)));
        }
Exemplo n.º 28
0
        public HttpResponseMessage GetProduct(string id)
        {
            Product product = new Product()
            {
                Id    = 1,
                Name  = "江南红衣",
                Count = 1,
                Price = 9999
            };
            ResultMsg resultMsg = new ResultMsg()
            {
                StatusCode = (int)StatusCodeEnum.Success,
                Info       = StatusCodeEnum.Success.GetEnumText(),
                Data       = product
            };

            return(HttpResponseExtension.toJson(resultMsg));
        }
Exemplo n.º 29
0
        public HttpResponseMessage GetDeviceAlarmStat([FromBody] AlarmStatQueryParam QueryParams)
        {
            ResultMsg resultMsg = null;
            bool      res       = true;

            //string[] tempAlarmStatList = ;

            List <AlarmStatQueryResponse> AlarmStatDataList = new List <AlarmStatQueryResponse>();


            LoggerManager.Log.Info("Get device alarm stat data!\n");

            try
            {
                var client = RedisManager.GetClient();
                foreach (string deviceID in QueryParams.DeviceCode)
                {
                    string RedisHashName = $"[{QueryParams.CompanyCode}]-[{deviceID}]";

                    AlarmStatQueryResponse tempAlarmStatData = new AlarmStatQueryResponse();

                    tempAlarmStatData.AlarmStatValue = client.HMGet(RedisHashName, QueryParams.AlarmStatName);

                    AlarmStatDataList.Add(tempAlarmStatData);
                }


                //string keyAlarmUpdate = $"[{CompanyCode}]-AlarmUpdateCode";
                // Dictionary<string, string> TagDictionary = UploadDatas.Datas.ToDictionary(x => x.TagName, y => y.TagValue);
            }
            catch (Exception ex)
            {
                //return res;
            }

            resultMsg            = new ResultMsg();
            resultMsg.StatusCode = (int)StatusCodeEnum.Success;
            resultMsg.Info       = "";
            resultMsg.Data       = AlarmStatDataList;

            // LoggerManager.Log.Info(JsonConvert.SerializeObject(resultMsg) + "\n");

            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(resultMsg)));
        }
        public HttpResponseMessage StatQueryData([FromBody] DataStatParamInfo StatParams)
        {
            //DataQueryParamObject queryParam = null;
            QueryResultBase queryResult = null;


            if (StatParams == null)
            {
                queryResult            = new QueryResultBase();
                queryResult.ResultCode = QueryResultCodeEnum.QUERY_ERROR_PARAM;

                return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(queryResult)));
            }
            IotDataStatInterface dataStatInterfaceObject = new IotDataStatInterface();

            queryResult = dataStatInterfaceObject.HandleStatInterface(StatParams);

            return(HttpResponseExtension.toJson(JsonConvert.SerializeObject(queryResult)));
        }