Added create contact ednpoint

This commit is contained in:
Nedim
2023-10-06 10:47:26 +02:00
parent f32b5d5748
commit 314abe0462
15 changed files with 1278 additions and 146 deletions

View File

@@ -79,13 +79,14 @@ func GetDeviceInfoForContract (deviceID uint64, contract models.Contract) (model
}
}
deviceInfosResponse := models.ConvertDeviceInfoToResponse(deviceInfos)
// Loop through each deviceInfo to create GeoJSON features
for _, info := range deviceInfos {
for _, info := range deviceInfosResponse {
info.RawJSON = ""
feature := models.GeoJSONFeature{
Type: "Feature",
DeviceInfo: &info,
DeviceInfoResponse: &info,
Geometry: models.GeoJSONGeometry{
Type: "Point",
Coordinates: []float64{info.Lon, info.Lat},