diff pkg/imports/sr.go @ 978:544a5cfe07cd

Started with endpoint for uploading sounding result and trigger respective import job.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 18 Oct 2018 18:37:19 +0200
parents 4a2ca0e20006
children 7934b5c1a910
line wrap: on
line diff
--- a/pkg/imports/sr.go	Thu Oct 18 17:30:53 2018 +0200
+++ b/pkg/imports/sr.go	Thu Oct 18 18:37:19 2018 +0200
@@ -14,6 +14,7 @@
 	"log"
 	"os"
 	"path"
+	"path/filepath"
 	"strconv"
 	"strings"
 	"time"
@@ -25,7 +26,7 @@
 
 type SoundingResult struct {
 	who string
-	zip string
+	dir string
 }
 
 const SoundingResultDateFormat = "2006-01-02"
@@ -132,7 +133,7 @@
 }
 
 func (sr *SoundingResult) CleanUp() error {
-	return os.RemoveAll(sr.zip)
+	return os.RemoveAll(sr.dir)
 }
 
 func find(needle string, haystack []*zip.File) *zip.File {
@@ -275,7 +276,7 @@
 
 func (sr *SoundingResult) Do(conn *sql.Conn) error {
 
-	z, err := zip.OpenReader(sr.zip)
+	z, err := zip.OpenReader(filepath.Join(sr.dir, "sr.zip"))
 	if err != nil {
 		return err
 	}