Пример #1
0
        public override void ExecuteCommand(AppSession session, StringRequestInfo requestInfo)
        {
            List <CameraList>       cameraList;
            List <StreamMediaList>  streamMediaList;
            List <StreamServerList> streamServerList;
            List <StationList>      stationList;
            //获取数据库的所有设备信息,登录设备
            CameraListRepository camera = new CameraListRepository();

            cameraList = camera.GetList();
            StreamMediaListRepository streamMedia = new StreamMediaListRepository();

            streamMediaList = streamMedia.GetList();
            StreamServerListRepository streamServer = new StreamServerListRepository();

            streamServerList = streamServer.GetList();
            StationListRepository station = new StationListRepository();

            stationList = station.GetList();
            //组装数据
            DeviceData data = new DeviceData();

            data.cameraList       = cameraList;
            data.streamMediaList  = streamMediaList;
            data.streamServerList = streamServerList;
            data.stationList      = stationList;
            //转json
            string str = JsonConvert.SerializeObject(data);

            session.Send(str);
        }
Пример #2
0
        public void InsertTes()
        {
            StreamServerListRepository repo       = new StreamServerListRepository();
            StreamServerList           ServerList = new StreamServerList();

            ServerList.DeviceID       = repo.GetGuid();
            ServerList.StreamServerIP = "192.0.0.66";

            Guid result = repo.Insert(ServerList);
        }