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) {
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 = [
{
name: "floodZones",
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`
),
},
{
name: "rain",
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`
),
},
{
name: "riverFlood",
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`
),
},
{
name: "pluviometer",
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`
),
},
{
name: "susceptibilityAreas",
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`
),
},
{
name: "automaticPluviometer",
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`
),
},

Loading…
Cancel
Save