Browse Source

updating websockets endpoints

master
analuizaff 3 years ago
parent
commit
2f9e71b656
  1. 19
      src/app/hooks/useFiltering.js

19
src/app/hooks/useFiltering.js

@ -1,44 +1,51 @@
import moment from "moment";
function useFiltering(location) { function useFiltering(location) {
const initialDate = moment().format("YYYY-MM-DDTHH:mm:ss");
console.log("Inicio: "+ initialDate+"\n");
const finalDate = moment().subtract(1, "days").format("YYYY-MM-DDTHH:mm:ss");
console.log("Fim "+finalDate);
const filters = [ const filters = [
{ {
name: "floodZones", name: "floodZones",
socketUrl: new WebSocket( socketUrl: new WebSocket(
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/data?" +
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/formsanswers?" +
`type=FLOODZONES_FORM&lat=${location.lat}&lon=${location.long}&buffer=5000&limit=5` `type=FLOODZONES_FORM&lat=${location.lat}&lon=${location.long}&buffer=5000&limit=5`
), ),
}, },
{ {
name: "rain", name: "rain",
socketUrl: new WebSocket( socketUrl: new WebSocket(
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/data?" +
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/formsanswers?" +
`type=RAIN_FORM&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=30` `type=RAIN_FORM&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=30`
), ),
}, },
{ {
name: "riverFlood", name: "riverFlood",
socketUrl: new WebSocket( socketUrl: new WebSocket(
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/data?" +
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/formsanswers?" +
`type=RIVERFLOOD_FORM&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=5` `type=RIVERFLOOD_FORM&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=5`
), ),
}, },
{ {
name: "pluviometer", name: "pluviometer",
socketUrl: new WebSocket( socketUrl: new WebSocket(
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/data?" +
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/formsanswers?" +
`type=PLUVIOMETER_REGISTRATION&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=5` `type=PLUVIOMETER_REGISTRATION&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=5`
), ),
}, },
{ {
name: "susceptibilityAreas", name: "susceptibilityAreas",
socketUrl: new WebSocket( socketUrl: new WebSocket(
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/data?" +
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/formsanswers?" +
`type=FLOODZONES_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=3` `type=FLOODZONES_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=3`
), ),
}, },
{ {
name: "automaticPluviometer", name: "automaticPluviometer",
socketUrl: new WebSocket( socketUrl: new WebSocket(
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/data?" +
"wss://waterproofing.geog.uni-heidelberg.de/wss/hot/formsanswers?" +
`type=PLUVIOMETERS_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=5` `type=PLUVIOMETERS_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=5`
), ),
}, },

Loading…
Cancel
Save