using EC.Entity.Video; using EC.Utils; using System; using System.Collections.Generic; namespace ECMonitor.Code { public class LoadFromAPIServer { public static string _apiUrl = ConfigHelper.APIServer(); /// /// 获取相机数据 /// /// public static List LoadCameraData() { List msVideoRecorderList = new List(); try { var respStr = HttpMethods.HttpGet(_apiUrl); var respObj = Json.ToJObject(respStr); var success = (bool)respObj["success"]; if (success) { var message = (string)respObj["message"]; var code = (int)respObj["code"]; var timestamp = (string)respObj["timestamp"]; msVideoRecorderList = Json.ToList(respObj["result"]?.ToString()); } } catch (Exception ex) { LogFactory.GetLogger().Error(ex); } return msVideoRecorderList; } } }