diff --git a/gateway/src/PublishCommand.go b/gateway/src/PublishCommand.go index 528ee20..f2d3d79 100644 --- a/gateway/src/PublishCommand.go +++ b/gateway/src/PublishCommand.go @@ -11,7 +11,7 @@ import ( // Command represents the structure of the command to be published // @Description Command structure for publishing type Command struct { - Command string `json:"command" example:"MEASURE_NEW" binding:"required"` + Command string `json:"command" example:"measure" binding:"required"` } // @Summary Publish command @@ -55,7 +55,7 @@ func (gh *Gateway) publishCommand(c *gin.Context) error { } // Publish the command to the MQTT broker - topic := user + "/" + room + "/" + device + "/command/" + json.Command + topic := user + "/" + room + "/" + device + "/cmd/" + json.Command token := gh.mqtt.Publish(topic, 1, false, "") if token.Wait() && token.Error() != nil { return token.Error() diff --git a/gateway/src/docs/docs.go b/gateway/src/docs/docs.go index 3b790f0..78f2084 100644 --- a/gateway/src/docs/docs.go +++ b/gateway/src/docs/docs.go @@ -184,7 +184,7 @@ const docTemplate = `{ "properties": { "command": { "type": "string", - "example": "MEASURE_NEW" + "example": "measure" } } } diff --git a/gateway/src/docs/swagger.json b/gateway/src/docs/swagger.json index 692c210..86a6c32 100644 --- a/gateway/src/docs/swagger.json +++ b/gateway/src/docs/swagger.json @@ -178,7 +178,7 @@ "properties": { "command": { "type": "string", - "example": "MEASURE_NEW" + "example": "measure" } } } diff --git a/gateway/src/docs/swagger.yaml b/gateway/src/docs/swagger.yaml index 8747a00..a703ded 100644 --- a/gateway/src/docs/swagger.yaml +++ b/gateway/src/docs/swagger.yaml @@ -7,7 +7,7 @@ definitions: description: Command structure for publishing properties: command: - example: MEASURE_NEW + example: measure type: string required: - command