From 5e73961ad593fba43cf1f82bd390f74d32842978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC=20=D0=A5=D0=B0=D1=80=D0=BB?= =?UTF-8?q?=D0=B0=D0=BC=D0=BE=D0=B2?= Date: Tue, 19 Nov 2024 19:36:05 +0400 Subject: [PATCH] Add Valve Controller --- Cloud/Controllers/ValveController.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Cloud/Controllers/ValveController.cs b/Cloud/Controllers/ValveController.cs index 5708820..dbc081a 100644 --- a/Cloud/Controllers/ValveController.cs +++ b/Cloud/Controllers/ValveController.cs @@ -21,7 +21,7 @@ namespace Cloud.Controllers _producerService = producerService; } - [HttpPost("farm/{farmId}/greenhouse/{greenhouseId}/watering")] + [HttpPost("farm/{farmId}/greenhouse/{ghId}/watering")] public async Task interactValve([FromBody] ValveRequest request, int farmId, int ghId) { var kafkaRequest = new @@ -32,10 +32,11 @@ namespace Cloud.Controllers }; var message = JsonSerializer.Serialize(kafkaRequest); + return Ok(kafkaRequest); - await _producerService.ProduceMessageAsync("InventoryUpdates", message); + /*await _producerService.ProduceMessageAsync("ValvesHeatersRequest", message); - return Ok($"Valve status is {request.Action}"); + return Ok($"Valve status is {request.Action}");*/ } } }