wei
2021-03-03 d4811b7d34b45ff6b21b97f11da128b5572ec526
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -37,34 +37,48 @@
        {
        }
        #region kaede ___________传感器历史数据__________________
        /// <summary>
        /// 获取传感器历史数据
        /// </summary>
        /// <param name="subnetId"></param>
        /// <param name="deviceId"></param>
        /// <param name="bigClass"></param>
        /// <param name="minClass"></param>
        /// <param name="queryType"></param>
        /// <param name="loopId"></param>
        /// <param name="nowMonth"></param>
        /// <param name="mac"></param>
        /// <param name="qType">时间查询类型:hour=近24小时、week=近一周、month = 近一月 </param>
        /// <param name="deviceId">设备ID</param>
        /// <param name="deviceKey">功能查询类型:pm25</param>
        /// <returns></returns>
        public ResponsePack GetSensorHistory(int subnetId, int deviceId, int bigClass, int minClass, int queryType, int loopId, int nowMonth, string mac)
        public ResponsePackNew GetSensorHistory(string qType, string deviceId,string deviceKey)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("SubnetID", subnetId);
            d.Add("DeviceID", deviceId);
            d.Add("LargeType", bigClass);
            d.Add("SmallType", minClass);
            d.Add("QueryType", queryType);
            d.Add("loopId", loopId);
            d.Add("NowMonth", nowMonth);
            d.Add("MAC", DB_ResidenceData.Instance.residenceGatewayMAC);
            d.Add("LocalTimeZone", 8);
            var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            return RequestHttps("https://developer.hdlcontrol.com/api/GetSensorPushHistory", jsonString, true);
            d.Add("type", qType);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceId", new List<string>() { deviceId });
            d.Add("key", new List<string>() { deviceKey });
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson);
        }
        /// <summary>
        /// 获取安防传感器历史数据
        /// </summary>
        /// <param name="deviceId">设备ID</param>
        /// <param name="pageSize">页面大小</param>
        /// <param name="pageNo">页号</param>
        /// <returns></returns>
        public ResponsePackNew GetArmSensorHistory( string deviceId,string pageSize, string pageNo)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceId", deviceId);
            d.Add("pageSize", pageSize);
            d.Add("pageNo", pageNo);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson);
        }
        #endregion
        //public string GetRequestResultMsg(string resultCode)
        //{