Add a white border around the QR Image

This commit is contained in:
Danijel Fischer
2020-10-04 12:57:29 +02:00
parent 7e9c0a0653
commit 0dc5c0f4d7
2 changed files with 23 additions and 7 deletions

View File

@@ -6,15 +6,16 @@ import (
"encoding/base64" "encoding/base64"
"encoding/json" "encoding/json"
"errors" "errors"
"os"
"os/exec"
"strings"
"time"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
uuid "github.com/gofrs/uuid" uuid "github.com/gofrs/uuid"
"github.com/h2non/filetype" "github.com/h2non/filetype"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
qrcode "github.com/skip2/go-qrcode" qrcode "github.com/skip2/go-qrcode"
"os"
"os/exec"
"strings"
"time"
) )
const groupPrefix = "group." const groupPrefix = "group."

View File

@@ -169,8 +169,18 @@ var doc = `{
}, },
"/v1/qrcodelink": { "/v1/qrcodelink": {
"get": { "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": [ "produces": [
"image/png".
"application/json" "application/json"
], ],
"tags": [ "tags": [
@@ -179,9 +189,14 @@ var doc = `{
"summary": "Link device and generate QR code.", "summary": "Link device and generate QR code.",
"responses": { "responses": {
"200": { "200": {
"description": "Image", "description": "Ok",
"content":
"image"
},
"400": {
"description": "Bad Request",
"schema": { "schema": {
"type": "string" "$ref": "#/definitions/api.Error"
} }
} }
} }