docs(gateway): updated swagger doc

Signed-off-by: Klagarge <remi@heredero.ch>
This commit is contained in:
2025-04-15 00:26:05 +02:00
parent af893618c2
commit 0b57f26688
5 changed files with 495 additions and 5 deletions

View File

@@ -1,11 +1,133 @@
basePath: /
definitions:
gin.H:
additionalProperties: {}
type: object
main.Command:
description: Command structure for publishing
properties:
command:
example: UP
type: string
required:
- command
type: object
main.GarageDoorExample:
description: Example response for Garage Door status
properties:
IsClosed:
description: 'example: true'
type: boolean
IsDownButtonPressed:
description: 'example: false'
type: boolean
IsIRSensor:
description: 'example: false'
type: boolean
IsOpen:
description: 'example: false'
type: boolean
IsUpButtonPressed:
description: 'example: false'
type: boolean
type: object
host: rest.mse.kb28.ch
info:
contact: {}
description: REST API for the SoftwEng course in MSE
title: Swagger SoftwEng API
version: "1.0"
paths: {}
paths:
/ping:
get:
consumes:
- application/json
description: get ping response
produces:
- application/json
responses:
"200":
description: pong
schema:
type: string
summary: Ping test endpoint
tags:
- ping
/raclette:
get:
consumes:
- application/json
description: Request data from InfluxDB for a specific device in a room
parameters:
- description: Room name
example: Garage
in: query
name: room
required: true
type: string
- description: Device name
example: Door
in: query
name: device
required: true
type: string
produces:
- application/json
responses:
"200":
description: Returns a map of field names to their latest values.
schema:
$ref: '#/definitions/main.GarageDoorExample'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/gin.H'
security:
- BasicAuth: []
summary: Request Influx data
tags:
- request
post:
consumes:
- application/json
description: Publish a command to a specific device in a room
parameters:
- description: Room name
example: Garage
in: query
name: room
required: true
type: string
- description: Device name
example: Door
in: query
name: device
required: true
type: string
- description: Command to publish
in: body
name: command
required: true
schema:
$ref: '#/definitions/main.Command'
produces:
- application/json
responses:
"200":
description: status:ok
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/gin.H'
security:
- BasicAuth: []
summary: Publish command
tags:
- commands
securityDefinitions:
BasicAuth:
type: basic