Пример #1
0
        public IHttpActionResult CancelTask([FromBody] VideoIntervalModel model)
        {
            Camera cam = cameraRep.Get(model.BrigadeCode, model.CameraNum);

            if (cam == null)
            {
                return(BadRequest($"The video registrator with brigadeCode={model.BrigadeCode} was not found"));
            }
            // Выполнение операции
            VideoTaskManager.Instance.CancelTask(cam, model.Interval);
            return(Ok());
        }
Пример #2
0
        public IHttpActionResult SyncByPeriod([FromBody] VideoIntervalModel model)//(int brigadeCode, string start, string end)
        {
            VideoReg reg = regRep.Get(model.BrigadeCode);

            if (reg == null)
            {
                return(BadRequest($"The video registrator with brigadeCode={model.BrigadeCode} was not found"));
            }
            // Выполнение операции
            if (VideoTaskManager.Instance.SyncChannelsByPeriod(reg, model.CameraNum, model.Interval))
            {
                return(Ok());
            }
            return(BadRequest($"{model.BrigadeCode} cam={model.CameraNum}({model.Interval}) - [ALREADY EXECUTE]"));
        }