From a297a8928719784098acd24a743879ad50a91455 Mon Sep 17 00:00:00 2001 From: SeekDaSky Date: Fri, 8 Dec 2017 00:43:58 +0100 Subject: [PATCH] merge --- build/api/module/message.php | 19 +++++++++++++++++++ config/modules.json | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/build/api/module/message.php b/build/api/module/message.php index 3978654..ddc9bc1 100644 --- a/build/api/module/message.php +++ b/build/api/module/message.php @@ -54,4 +54,23 @@ class message //TODO: tout poster dans la BDD } + public function PUT_emergency($argv){ + extract($argv); + + $wsi = new wsinterop("localhost",9998); + + $wsi->send([ + "operation" => "UpdMessage", + "id" => $id, + "message" => $message, + "channelType" => "Emergency", + "channelName" => is_null($URL_0) ? "" : "$URL_0" + ]); + + $wsi->close(); + + return ["sent" => true]; + //TODO: tout poster dans la BDD + } + } \ No newline at end of file diff --git a/config/modules.json b/config/modules.json index d10214e..4b1f7f5 100755 --- a/config/modules.json +++ b/config/modules.json @@ -123,6 +123,21 @@ } }, "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" + } + } + }, + "PUT emergency": { "description" : "", "permissions": [], "parameters": { @@ -134,9 +149,15 @@ "id": { "description": "message a publier", "type": "text" + }, + "message": { + "description": "message a publier", + "type": "text", + "optional": false } } } + }, "RESTexample": {