diff --git a/src/api/api.go b/src/api/api.go index 078a0d7..07ae0e4 100644 --- a/src/api/api.go +++ b/src/api/api.go @@ -6,15 +6,16 @@ import ( "encoding/base64" "encoding/json" "errors" + "os" + "os/exec" + "strings" + "time" + "github.com/gin-gonic/gin" uuid "github.com/gofrs/uuid" "github.com/h2non/filetype" log "github.com/sirupsen/logrus" qrcode "github.com/skip2/go-qrcode" - "os" - "os/exec" - "strings" - "time" ) const groupPrefix = "group." diff --git a/src/docs/docs.go b/src/docs/docs.go index cb80f03..0c33fe8 100644 --- a/src/docs/docs.go +++ b/src/docs/docs.go @@ -169,8 +169,18 @@ var doc = `{ }, "/v1/qrcodelink": { "get": { - "description": "test", + "parameters": [ + { + "in": "query", + "name": "device_name", + "type": "string", + "required": true, + "description": "The name of the device is being linked. This name will be shown in Signal as device." + } + ], + "description": "Returns a QR-Code image. In case of an error a JSON object will be returned. Due to security reason of Signal, the provided QR-Code will change with each request.", "produces": [ + "image/png". "application/json" ], "tags": [ @@ -179,9 +189,14 @@ var doc = `{ "summary": "Link device and generate QR code.", "responses": { "200": { - "description": "Image", + "description": "Ok", + "content": + "image" + }, + "400": { + "description": "Bad Request", "schema": { - "type": "string" + "$ref": "#/definitions/api.Error" } } }