brokerService #6

Merged
Kharlamov merged 3 commits from brokerService into dev 2024-11-19 19:46:42 +04:00
Showing only changes of commit 5e73961ad5 - Show all commits

View File

@ -21,7 +21,7 @@ namespace Cloud.Controllers
_producerService = producerService;
}
[HttpPost("farm/{farmId}/greenhouse/{greenhouseId}/watering")]
[HttpPost("farm/{farmId}/greenhouse/{ghId}/watering")]
public async Task<IActionResult> 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}");*/
}
}
}