comparison 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
comparison
equal deleted inserted replaced
5715:e29c942d3e8c 5718:3d497077f888
141 "stretch.zip", 141 "stretch.zip",
142 func(_ *http.Request, dir string) (imports.Job, error) { 142 func(_ *http.Request, dir string) (imports.Job, error) {
143 return &imports.StretchShape{Dir: dir}, nil 143 return &imports.StretchShape{Dir: dir}, nil
144 }, 144 },
145 ) 145 )
146
147 }
148
149 func importUploadedWaterwayGauge() http.HandlerFunc {
150 return uploadedImport(
151 imports.UWGJobKind,
152 "data.xml",
153 func(_ *http.Request, dir string) (imports.Job, error) {
154 return &imports.UploadedWaterwayGauge{Dir: dir}, nil
155 },
156 )
146 } 157 }
147 158
148 func (bup badUploadParameterError) Error() string { 159 func (bup badUploadParameterError) Error() string {
149 return string(bup) 160 return string(bup)
150 } 161 }