change in tokens and addtelemetry(addData)

This commit is contained in:
2025-12-20 00:51:50 +03:30
parent 10178de7c1
commit b69691c84f
4 changed files with 24 additions and 12 deletions

View File

@@ -25,12 +25,14 @@ public class TelemetryController : ControllerBase
}
[HttpGet("AddData")]
public async Task<ActionResult<int>> Create(string deviceName, decimal temperatureC, decimal humidityPercent,
public async Task<ActionResult<int>> Create(object deviceName, decimal temperatureC, decimal humidityPercent,
decimal soilPercent, int gasPPM, decimal lux, CancellationToken cancellationToken)
{
TelemetryDto dto = new TelemetryDto
{
DeviceName = deviceName,
DeviceName = deviceName.ToString() == "dr110"? "dr110":"",
Id= deviceName.ToString() == "dr110" ? 0 : Convert.ToInt32(deviceName),
TemperatureC = temperatureC,
HumidityPercent = humidityPercent,
SoilPercent = soilPercent,

View File

@@ -6,7 +6,7 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "http://0.0.0.0:5064"
"applicationUrl": "http://127.0.0.1:5064"
},
"https": {
"commandName": "Project",
@@ -14,7 +14,7 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "https://0.0.0.0:7274;http://0.0.0.0:5064"
"applicationUrl": "https://127.0.0.1:7274;http://127.0.0.1:5064"
},
"IIS Express": {
"commandName": "IISExpress",