diff pkg/controllers/uploadedimports.go @ 5718:3d497077f888 uploadwg

Implemented direct file upload as alternative import method for WG. For testing and data corrections it is useful to be able to import waterway gauges data directly by uploading a xml file.
author Sascha Wilde <wilde@sha-bang.de>
date Thu, 18 Apr 2024 19:23:19 +0200
parents 5f47eeea988d
children
line wrap: on
line diff
--- a/pkg/controllers/uploadedimports.go	Thu Mar 21 08:19:21 2024 +0100
+++ b/pkg/controllers/uploadedimports.go	Thu Apr 18 19:23:19 2024 +0200
@@ -143,6 +143,17 @@
 			return &imports.StretchShape{Dir: dir}, nil
 		},
 	)
+
+}
+
+func importUploadedWaterwayGauge() http.HandlerFunc {
+	return uploadedImport(
+		imports.UWGJobKind,
+		"data.xml",
+		func(_ *http.Request, dir string) (imports.Job, error) {
+			return &imports.UploadedWaterwayGauge{Dir: dir}, nil
+		},
+	)
 }
 
 func (bup badUploadParameterError) Error() string {