|
@@ -2,6 +2,7 @@
|
|
|
using Ai.AgentServer.Server.FuelDto;
|
|
|
using AutoMapper;
|
|
|
using Newtonsoft.Json;
|
|
|
+using System.Net.Http.Json;
|
|
|
using System.Text;
|
|
|
|
|
|
namespace Ai.AgentServer.Server
|
|
@@ -64,11 +65,16 @@ namespace Ai.AgentServer.Server
|
|
|
var request = new FuelCommRequest();
|
|
|
request.GLid = deviceId;
|
|
|
request.NozzleNo = mqttMessageDto.data.nozzleNum;
|
|
|
+
|
|
|
try
|
|
|
{
|
|
|
Console.WriteLine($"LockNozzle HttpClient: {Sysurl}");
|
|
|
- httpclient.PostAsync($"/nozzles/lock", new StringContent(JsonConvert.SerializeObject(mqttMessageDto), Encoding.UTF8, "application/json")).Wait();
|
|
|
-
|
|
|
+ var reponse = httpclient.PostAsJsonAsync<FuelCommRequest>("/aiFueling/internal/sendData", request).Result;
|
|
|
+ //httpclient.PostAsync($"/aiFueling/internal/sendData", new StringContent(JsonConvert.SerializeObject(mqttMessageDto), Encoding.UTF8, "application/json")).Result;
|
|
|
+ if (reponse != null&& reponse.IsSuccessStatusCode)
|
|
|
+ {
|
|
|
+ Console.WriteLine($"LockNozzle send success");
|
|
|
+ }
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|