Suppression du fichier Swagger pour le schéma de mesure et mise à jour des descriptions dans les routes d'images et de projets

This commit is contained in:
2025-02-11 18:30:32 +01:00
parent 08fa489f4c
commit 042ea5cc50
5 changed files with 310 additions and 247 deletions

View File

@@ -13,7 +13,7 @@ const serverError = require('../utils/serverError');
* summary: Retrieve a smile image
* responses:
* 200:
* description: Smile image retrieved successfully
* description: A smile image
* content:
* image/jpeg:
* schema:
@@ -37,32 +37,30 @@ router.get('/smile', (req, res) => {
* @swagger
* /images/{projectId}/{orderId}:
* get:
* summary: Retrieve an image by project ID and order ID
* summary: Retrieve an image by project and order ID
* parameters:
* - in: path
* name: projectId
* required: true
* schema:
* type: string
* description: The ID of the project
* description: The project ID
* - in: path
* name: orderId
* required: true
* schema:
* type: string
* description: The ID of the order
* description: The order ID
* responses:
* 200:
* description: Image retrieved successfully
* description: An image file
* content:
* image/jpeg:
* application/octet-stream:
* schema:
* type: string
* format: binary
* 404:
* description: Image not found
* 500:
* description: Internal server error
*/
router.get('/images/:projectId/:orderId', (req, res) => {
const projectId = req.params.projectId;

View File

@@ -18,7 +18,21 @@ const serverError = require('../utils/serverError');
* schema:
* type: array
* items:
* $ref: '#/components/schemas/Measurement'
* type: object
* properties:
* id:
* type: integer
* project_id:
* type: integer
* timestamp:
* type: string
* format: date-time
* image_path:
* type: string
* temperature:
* type: number
* humidity:
* type: number
* 500:
* description: Erreur serveur.
*/
@@ -51,7 +65,21 @@ router.get('/measurements', (req, res) => {
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Measurement'
* type: object
* properties:
* id:
* type: integer
* project_id:
* type: integer
* timestamp:
* type: string
* format: date-time
* image_path:
* type: string
* temperature:
* type: number
* humidity:
* type: number
* 400:
* description: ID de mesure invalide.
* 500:
@@ -96,7 +124,21 @@ router.get('/measurements/:id', (req, res) => {
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Measurement'
* type: object
* properties:
* id:
* type: integer
* project_id:
* type: integer
* timestamp:
* type: string
* format: date-time
* image_path:
* type: string
* temperature:
* type: number
* humidity:
* type: number
* 400:
* description: ID de projet ou de commande invalide.
* 500:

View File

@@ -17,7 +17,7 @@ const serverError = require('../utils/serverError');
* schema:
* type: array
* items:
* $ref: '#/components/schemas/Project'
* type: object
* 500:
* description: Erreur serveur.
*/
@@ -49,7 +49,7 @@ router.get('/projects', async (req, res) => {
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Project'
* type: object
* 400:
* description: ID de projet invalide.
* 500:
@@ -89,7 +89,7 @@ router.get('/projects/:id', async (req, res) => {
* schema:
* type: array
* items:
* $ref: '#/components/schemas/Video'
* type: object
* 400:
* description: ID de projet invalide.
* 500:
@@ -129,7 +129,7 @@ router.get('/projects/:id/videos', async (req, res) => {
* schema:
* type: array
* items:
* $ref: '#/components/schemas/Measurement'
* type: object
* 400:
* description: ID de projet invalide.
* 500:

View File

@@ -1,27 +0,0 @@
components:
schemas:
Measurement:
type: object
properties:
id:
type: integer
description: The unique identifier for a measurement.
project_id:
type: integer
description: The ID of the project associated with the measurement.
timestamp:
type: string
format: date-time
description: The timestamp of the measurement.
image_path:
type: string
description: The path to the image associated with the measurement.
temperature:
type: number
description: The temperature recorded in the measurement.
humidity:
type: number
description: The humidity recorded in the measurement.
completed:
type: boolean
description: Indicates whether the measurement is completed.

View File

@@ -17,7 +17,32 @@ const serverError = require('../utils/serverError');
* schema:
* type: array
* items:
* $ref: '#/components/schemas/Video'
* type: object
* properties:
* id:
* type: integer
* project_id:
* type: integer
* measurement_ids:
* type: string
* video_path:
* type: string
* start_timestamp:
* type: string
* end_timestamp:
* type: string
* image_count:
* type: integer
* resolution:
* type: string
* duration:
* type: number
* fps:
* type: number
* status:
* type: integer
* name:
* type: string
* 500:
* description: Erreur serveur.
*/
@@ -50,7 +75,32 @@ router.get('/videos', (req, res) => {
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Video'
* type: object
* properties:
* id:
* type: integer
* project_id:
* type: integer
* measurement_ids:
* type: string
* video_path:
* type: string
* start_timestamp:
* type: string
* end_timestamp:
* type: string
* image_count:
* type: integer
* resolution:
* type: string
* duration:
* type: number
* fps:
* type: number
* status:
* type: integer
* name:
* type: string
* 400:
* description: ID de vidéo invalide.
* 500: