From 55cba1f3ea0001dd7538f78b6aa99ecf39746b54 Mon Sep 17 00:00:00 2001 From: Kerboul Date: Thu, 3 Apr 2025 15:25:49 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20documentation=20Swagger=20pou?= =?UTF-8?q?r=20les=20routes=20de=20gestion=20de=20la=20cam=C3=A9ra,=20y=20?= =?UTF-8?q?compris=20l'=C3=A9tat,=20le=20d=C3=A9marrage,=20l'arr=C3=AAt=20?= =?UTF-8?q?et=20le=20mode=20de=20maintenance.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/capture_system.js | 87 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/routes/capture_system.js b/routes/capture_system.js index e219b23..2f0a1f7 100644 --- a/routes/capture_system.js +++ b/routes/capture_system.js @@ -135,7 +135,92 @@ router.post('/camera/stop', async (req, res) => { } }); - +/** + * @swagger + * /camera/status: + * get: + * summary: Get the current camera settings + * responses: + * 200: + * description: Successfully retrieved camera settings + * content: + * application/json: + * schema: + * type: object + * properties: + * id: + * type: integer + * interval: + * type: integer + * nb_images: + * type: integer + * maintenance: + * type: boolean + * stop_flag: + * type: boolean + * idle: + * type: boolean + * 500: + * description: Error retrieving camera settings + * + * /procedure/start: + * post: + * summary: Start the camera procedure + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * interval: + * type: integer + * nb_images: + * type: integer + * responses: + * 200: + * description: Camera started successfully + * 400: + * description: Interval and number of images are required + * 500: + * description: Error starting camera procedure + * + * /procedure/stop: + * post: + * summary: Initiate the camera stop procedure + * responses: + * 200: + * description: Camera stop procedure initiated successfully + * 500: + * description: Error stopping camera procedure + * + * /camera/stop: + * post: + * summary: Confirm the camera stop procedure + * responses: + * 200: + * description: Camera stopped successfully + * 500: + * description: Error stopping camera + * + * /camera/maintenance: + * post: + * summary: Activate maintenance mode for the camera + * responses: + * 200: + * description: Camera in maintenance mode + * 500: + * description: Error activating maintenance mode + * + * /camera/maintenance/deactivate: + * post: + * summary: Deactivate maintenance mode for the camera + * responses: + * 200: + * description: Camera out of maintenance mode + * 500: + * description: Error deactivating maintenance mode + */ router.post('/camera/maintenance', async (req, res) => { try { await activate_maintenance();