auch test
This commit is contained in:
parent
308c198bf7
commit
120ddb5c01
2 changed files with 4 additions and 1 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"os"
|
||||
|
@ -75,7 +76,7 @@ func UploadTicket(ticket db.SpeedingTicket) error {
|
|||
respBody, _ := io.ReadAll(resp.Body)
|
||||
return fmt.Errorf("server returned %s: %s", resp.Status, string(respBody))
|
||||
}
|
||||
|
||||
log.Printf("uploaded picture")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
"git.ctdo.de/henne/blitzer-v2/camera"
|
||||
"git.ctdo.de/henne/blitzer-v2/db"
|
||||
"git.ctdo.de/henne/blitzer-v2/printer"
|
||||
"git.ctdo.de/henne/blitzer-v2/upload"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
@ -32,4 +33,5 @@ func HandleTest(ctx *gin.Context) {
|
|||
}
|
||||
printer.PrintTicket(speedingTicket)
|
||||
ctx.Redirect(http.StatusTemporaryRedirect, "/")
|
||||
go upload.UploadTicket(speedingTicket)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue