From e82f192f8eca6ea0104d9ab83e2f541a1fff9ae1 Mon Sep 17 00:00:00 2001 From: SeekDaSky Date: Thu, 7 Dec 2017 23:40:05 +0100 Subject: [PATCH] =?UTF-8?q?Impl=C3=A9mentation=20de=20l'interop=20pour=20l?= =?UTF-8?q?a=20suppression=20de=20message=20(promis=20c'est=20le=20dernier?= =?UTF-8?q?=20commit=20sur=20master)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/api/module/message.php | 20 ++++++++++++++++++++ config/modules.json | 15 +++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/build/api/module/message.php b/build/api/module/message.php index b975883..3978654 100644 --- a/build/api/module/message.php +++ b/build/api/module/message.php @@ -24,6 +24,26 @@ class message "message" => $message, "username" => $username, "location" => $location, + //TODO implémenter la récupération d'id depuis la bdd + "id" => uniqid(), + "channelType" => "Emergency", + "channelName" => is_null($URL_0) ? "" : "$URL_0" + ]); + + $wsi->close(); + + return ["sent" => true]; + //TODO: tout poster dans la BDD + } + + public function DELETE_emergency($argv){ + extract($argv); + + $wsi = new wsinterop("localhost",9998); + + $wsi->send([ + "operation" => "DelMessage", + "id" => $id, "channelType" => "Emergency", "channelName" => is_null($URL_0) ? "" : "$URL_0" ]); diff --git a/config/modules.json b/config/modules.json index 4673c94..87d84d1 100755 --- a/config/modules.json +++ b/config/modules.json @@ -107,6 +107,21 @@ "type": "array" } } + }, + "DELETE emergency": { + "description" : "", + "permissions": [], + "parameters": { + "URL_0": { + "description": "code departement, si le paramètre n'est pas fourni le message est envoyé en broadcast", + "type" : "numeric", + "optional" : true + }, + "id": { + "description": "message a publier", + "type": "text" + } + } } },