| | |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Text; |
| | | using System.Text; |
| | | |
| | | namespace IStation.BLL |
| | | { |
| | | /// <summary> |
| | | /// 水库水位 |
| | | /// 水库水位 |
| | | /// </summary> |
| | | public class ReservoirWaterLevel |
| | | { |
| | | public static double GetRealValue() |
| | | { |
| | | if(!ServiceParas.IsRemote) |
| | | if (!ServiceParas.IsRemote) |
| | | { |
| | | return -100; |
| | | } |
| | | |
| | | |
| | | if (string.IsNullOrEmpty(ServiceParas.ApiServiceUrl)) |
| | | { |
| | | return -100; |
| | | } |
| | | string url = string.Format(@"{0}/ReservoirWaterLevel/GetRealValue", ServiceParas.ApiServiceUrl); |
| | | |
| | | |
| | | //先根据用户请求的uri构造请求地址 |
| | | //string serviceUrl = string.Format("{0}/{1}", this.BaseUri, uri); |
| | |
| | | |
| | | myRequest.Method = "GET"; |
| | | //myRequest.Accept = "application/json"; |
| | | //myRequest.ContentType = "application/json"; // //Content-Type: application/x-www-form-urlencoded |
| | | //myRequest.ContentType = "application/json"; // //Content-Type: application/x-www-form-urlencoded |
| | | myRequest.AutomaticDecompression = DecompressionMethods.GZip; |
| | | myRequest.Accept = Accept; |
| | | //myRequest.ContentType = ContentType; |
| | |
| | | reader.Close(); |
| | | myResponse.Close(); |
| | | |
| | | |
| | | return ret.Data; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取 预测值 |
| | | /// </summary> |
| | | /// 获取 预测值 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<IStation.Model.WaterPredictRecord> GetPredictRecordByHourRange(DateTime start_time, DateTime end_time) |
| | | { |
| | |
| | | { |
| | | return null; |
| | | } |
| | | string url = string.Format(@"{0}/ReservoirWaterLevel/GetPredictRecordByHourRange?start_time={1}&end_time={2}", |
| | | string url = string.Format(@"{0}/ReservoirWaterLevel/GetPredictRecordByHourRange?start_time={1}&end_time={2}", |
| | | apiServiceUrl, |
| | | start_time.ToString("yyyy-MM-dd HH:mm:00"), |
| | | end_time.ToString("yyyy-MM-dd HH:mm:00")); |
| | | |
| | | |
| | | //先根据用户请求的uri构造请求地址 |
| | | //string serviceUrl = string.Format("{0}/{1}", this.BaseUri, uri); |
| | |
| | | |
| | | myRequest.Method = "GET"; |
| | | //myRequest.Accept = "application/json"; |
| | | //myRequest.ContentType = "application/json"; // //Content-Type: application/x-www-form-urlencoded |
| | | //myRequest.ContentType = "application/json"; // //Content-Type: application/x-www-form-urlencoded |
| | | myRequest.AutomaticDecompression = DecompressionMethods.GZip; |
| | | myRequest.Accept = Accept; |
| | | //myRequest.ContentType = ContentType; |
| | |
| | | reader.Close(); |
| | | myResponse.Close(); |
| | | |
| | | |
| | | return ret.Data; |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// 获取今日预测值(24点时) |
| | | ///// </summary> |
| | | ///// 获取今日预测值(24点时) |
| | | ///// </summary> |
| | | ///// <returns></returns> |
| | | //public static double GetTodayEndPredictiveValue() |
| | | //{ |
| | |
| | | // return -100; |
| | | // } |
| | | // string url = string.Format(@"{0}/ReservoirWaterLevel/GetTodayEndPredictiveValue", apiServiceUrl); |
| | | |
| | | |
| | | // //先根据用户请求的uri构造请求地址 |
| | | // //string serviceUrl = string.Format("{0}/{1}", this.BaseUri, uri); |
| | |
| | | |
| | | // myRequest.Method = "GET"; |
| | | // //myRequest.Accept = "application/json"; |
| | | // //myRequest.ContentType = "application/json"; // //Content-Type: application/x-www-form-urlencoded |
| | | // //myRequest.ContentType = "application/json"; // //Content-Type: application/x-www-form-urlencoded |
| | | // myRequest.AutomaticDecompression = DecompressionMethods.GZip; |
| | | // myRequest.Accept = Accept; |
| | | // //myRequest.ContentType = ContentType; |
| | |
| | | // reader.Close(); |
| | | // myResponse.Close(); |
| | | |
| | | |
| | | // return ret.Data; |
| | | //} |
| | | } |
| | | } |
| | | } |