Пример #1
0
        // POST api/processing
        public async Task <JobOrderDTO> Post([FromBody] ProcessOrderDTO processOrderDTO)
        {
            InputImageEntity imageEntity = InputImageModel.Get(processOrderDTO.ImageId);

            if (imageEntity == null)
            {
                // return this.Request.CreateResponse(HttpStatusCode.NotFound);
                return(null);
            }

            Guid   g       = System.Guid.NewGuid();
            string orderId = g.ToString("N").Substring(0, 15);

            ImageProcessJobModel.Crate(orderId, imageEntity.RowKey);

            // send job
            QueueModel.SendMessage(orderId, processOrderDTO.ImageId, "default");

            return(new JobOrderDTO()
            {
                OrderId = orderId
            });
        }