@@ -39,10 +39,12 @@ class HeatmapController @Inject()(cc: ControllerComponents,
39
39
if (! anyReq.assertJsonBody()) return RESPONSE .BAD (RESPONSE .ERROR_JSON_PARSE )
40
40
val json = anyReq.getJsonBody()
41
41
LOG .D2 (" Heatmap: floorWifiAVG1: " + Utils .stripJsValueStr(json))
42
+
42
43
val checkRequirements = VALIDATE .checkRequirements(json, SCHEMA .fBuid, SCHEMA .fFloor)
43
44
if (checkRequirements != null ) return checkRequirements
44
45
val buid = (json \ SCHEMA .fBuid).as[String ]
45
46
val floor = (json \ SCHEMA .fFloor).as[String ]
47
+ if (! pds.db.floorHasFingerprints(buid, floor)) return RESPONSE .BAD_NO_FINGERPRINTS
46
48
try {
47
49
val radioPoints = pds.db.getRadioHeatmapByBuildingFloorAverage1(buid, floor)
48
50
if (radioPoints == null ) return RESPONSE .BAD_CANNOT_RETRIEVE_SPACE
@@ -71,6 +73,7 @@ class HeatmapController @Inject()(cc: ControllerComponents,
71
73
if (checkRequirements != null ) return checkRequirements
72
74
val buid = (json \ SCHEMA .fBuid).as[String ]
73
75
val floor = (json \ SCHEMA .fFloor).as[String ]
76
+ if (! pds.db.floorHasFingerprints(buid, floor)) return RESPONSE .BAD_NO_FINGERPRINTS
74
77
try {
75
78
val radioPoints = pds.db.getRadioHeatmapByBuildingFloorAverage2(buid, floor)
76
79
if (radioPoints == null ) return RESPONSE .BAD_CANNOT_RETRIEVE_SPACE
@@ -105,6 +108,7 @@ class HeatmapController @Inject()(cc: ControllerComponents,
105
108
if (checkRequirements != null ) return checkRequirements
106
109
val buid = (json \ SCHEMA .fBuid).as[String ]
107
110
val floor = (json \ SCHEMA .fFloor).as[String ]
111
+ if (! pds.db.floorHasFingerprints(buid, floor)) return RESPONSE .BAD_NO_FINGERPRINTS
108
112
try {
109
113
val radioPoints = pds.db.getRadioHeatmapByBuildingFloorAverage3(buid, floor)
110
114
if (radioPoints == null ) return RESPONSE .BAD_CANNOT_RETRIEVE_SPACE
@@ -138,6 +142,7 @@ class HeatmapController @Inject()(cc: ControllerComponents,
138
142
if (checkRequirements != null ) return checkRequirements
139
143
val buid = (json \ SCHEMA .fBuid).as[String ]
140
144
val floor = (json \ SCHEMA .fFloor).as[String ]
145
+ if (! pds.db.floorHasFingerprints(buid, floor)) return RESPONSE .BAD_NO_FINGERPRINTS
141
146
val tileX = (json \ SCHEMA .fX).as[Int ]
142
147
val tileY = (json \ SCHEMA .fY).as[Int ]
143
148
val zoomLevel = (json \ " z" ).as[Int ]
@@ -181,6 +186,7 @@ class HeatmapController @Inject()(cc: ControllerComponents,
181
186
if (checkRequirements != null ) return checkRequirements
182
187
val buid = (json \ SCHEMA .fBuid).as[String ]
183
188
val floor = (json \ SCHEMA .fFloor).as[String ]
189
+ if (! pds.db.floorHasFingerprints(buid, floor)) return RESPONSE .BAD_NO_FINGERPRINTS
184
190
val timestampX = (json \ SCHEMA .fTimestampX).as[String ]
185
191
val timestampY = (json \ SCHEMA .fTimestampY).as[String ]
186
192
try {
@@ -211,6 +217,7 @@ class HeatmapController @Inject()(cc: ControllerComponents,
211
217
if (checkRequirements != null ) return checkRequirements
212
218
val buid = (json \ SCHEMA .fBuid).as[String ]
213
219
val floor = (json \ SCHEMA .fFloor).as[String ]
220
+ if (! pds.db.floorHasFingerprints(buid, floor)) return RESPONSE .BAD_NO_FINGERPRINTS
214
221
val timestampX = (json \ SCHEMA .fTimestampX).as[String ]
215
222
val timestampY = (json \ SCHEMA .fTimestampY).as[String ]
216
223
try {
@@ -248,6 +255,7 @@ class HeatmapController @Inject()(cc: ControllerComponents,
248
255
if (checkRequirements != null ) return checkRequirements
249
256
val buid = (json \ SCHEMA .fBuid).as[String ]
250
257
val floor = (json \ SCHEMA .fFloor).as[String ]
258
+ if (! pds.db.floorHasFingerprints(buid, floor)) return RESPONSE .BAD_NO_FINGERPRINTS
251
259
val timestampX = (json \ SCHEMA .fTimestampX).as[String ]
252
260
val timestampY = (json \ SCHEMA .fTimestampY).as[String ]
253
261
@@ -284,6 +292,7 @@ class HeatmapController @Inject()(cc: ControllerComponents,
284
292
if (checkRequirements != null ) return checkRequirements
285
293
val buid = (json \ SCHEMA .fBuid).as[String ]
286
294
val floor = (json \ SCHEMA .fFloor).as[String ]
295
+ if (! pds.db.floorHasFingerprints(buid, floor)) return RESPONSE .BAD_NO_FINGERPRINTS
287
296
val timestampX = (json \ SCHEMA .fTimestampX).as[String ]
288
297
val timestampY = (json \ SCHEMA .fTimestampY).as[String ]
289
298
val x = (json \ SCHEMA .fX).as[Int ]
@@ -313,7 +322,6 @@ class HeatmapController @Inject()(cc: ControllerComponents,
313
322
case e : DatasourceException => return RESPONSE .ERROR (e)
314
323
}
315
324
}
316
-
317
325
inner(request)
318
326
}
319
327
0 commit comments