Пример #1
0
     public object Post(ValidationRequest request)
     {
         TaskQueue.RepresentedModel model;
         if (request.MType == null)
         {
             return new ServiceStack.HttpResult()
                    {
                        StatusCode = HttpStatusCode.NotAcceptable
                    }
         }
         ;
         else if (request.ChannelName == null)
         {
             // MType
             model = QueueService.ModProducer.broker.GetValidationModel(request.MType);
         }
         else
         {
             // channel + MType
             model = QueueService.ModProducer.broker.GetValidationModel(request.MType, request.ChannelName);
         }
         if (model == null)
         {
             return new ServiceStack.HttpResult()
                    {
                        StatusCode = HttpStatusCode.NotAcceptable
                    }
         }
         ;
         return(new ValidationResponse()
         {
             ModelScheme = model.schema.ToDictionary(),
             ModelHashSum = model.CalculateSchemeHash()
         });
     }
 }
Пример #2
0
 public object Post(ValidationRequest request)
 {
     TaskQueue.RepresentedModel model;
     if (request.MType == null)
         return new ServiceStack.HttpResult()
         {
             StatusCode = HttpStatusCode.NotAcceptable
         };
     else if (request.ChannelName == null)
     {
         // MType
         model = QueueService.ModProducer.broker.GetValidationModel(request.MType);
     }
     else
     {
         // channel + MType
         model = QueueService.ModProducer.broker.GetValidationModel(request.MType, request.ChannelName);
     }
     if (model == null)
         return new ServiceStack.HttpResult()
         {
             StatusCode = HttpStatusCode.NotAcceptable
         };
     return new ValidationResponse()
     {
         ModelScheme = model.schema.ToDictionary(),
         ModelHashSum = model.CalculateSchemeHash()
     };
 }