From 79c74e98324f93fd311b6f56339c3b5e48695cba Mon Sep 17 00:00:00 2001 From: SeekDaSky Date: Thu, 7 Dec 2017 21:06:09 +0100 Subject: [PATCH] upd: Postmessage channel emergency interop --- build/api/module/message.php | 7 +++++-- config/modules.json | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build/api/module/message.php b/build/api/module/message.php index d0f103d..b975883 100644 --- a/build/api/module/message.php +++ b/build/api/module/message.php @@ -17,16 +17,19 @@ class message public function POST_emergency($argv){ extract($argv); - $wsi = new wsinterop("localhost",9997); + $wsi = new wsinterop("localhost",9998); $wsi->send([ "operation" => "PostMessage", "message" => $message, "username" => $username, + "location" => $location, "channelType" => "Emergency", - "channelName" => $URL_0 + "channelName" => is_null($URL_0) ? "" : "$URL_0" ]); + $wsi->close(); + return ["sent" => true]; //TODO: tout poster dans la BDD } diff --git a/config/modules.json b/config/modules.json index 852f7c0..5065b8b 100755 --- a/config/modules.json +++ b/config/modules.json @@ -108,7 +108,7 @@ "parameters": { "URL_0": { "description": "code departement, si le paramètre n'est pas fourni le message est envoyé en broadcast", - "type" : "varchar(2,2)", + "type" : "numeric", "optional" : true }, @@ -126,7 +126,7 @@ "location": { "description": "coordonés GPS du message, des coordonnées invalide ne seront pas affiché", - "type": "array" + "type": "array" } } }