Esempio n. 1
0
        static void Main(string[] args)
        {
            if (args == null || args.Length < 1)
            {
                throw new ArgumentNullException($"Please provide the required arguments for input and output file");
            }

            var sourceFileName = args[0];
            var resultFileName = args[1];

            ValidateInputParameters(sourceFileName, resultFileName);

            Console.WriteLine($"Loading information from {sourceFileName}");

            var sourceFile = FileManager.LoadJsonFile(sourceFileName);

            var robotInput = JsonSerializer.Deserialize(sourceFile);

            var cleaningService = new CleaningService();

            Console.WriteLine("Executing cleaning plan");

            var results     = cleaningService.ExecuteCleaningProcess(robotInput);
            var jsonResults = JsonSerializer.Serialize(results);

            Console.WriteLine($"Exporting results to { resultFileName }");

            FileManager.ExportJsonFile(jsonResults, resultFileName);

            Console.WriteLine($"Results exported to { resultFileName }");
            Console.WriteLine("Press any key to close the window");

            Console.ReadLine();
        }
        public ActionResult Post([FromBody] RobotDto robotInput)
        {
            var results = _cleaningService.ExecuteCleaningProcess(robotInput);

            return(Ok(results));
        }