Mercurial > gemma
comparison pkg/controllers/routes.go @ 1667:aaa05d3c4aac
Deduplicated code for triggering manual imports.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 23 Dec 2018 20:38:52 +0100 |
parents | d8ca44615bfc |
children | 53304db85888 |
comparison
equal
deleted
inserted
replaced
1666:56b29406a163 | 1667:aaa05d3c4aac |
---|---|
171 api.Handle("/imports/soundingresult", waterwayAdmin( | 171 api.Handle("/imports/soundingresult", waterwayAdmin( |
172 http.HandlerFunc(importSoundingResult))).Methods(http.MethodPost) | 172 http.HandlerFunc(importSoundingResult))).Methods(http.MethodPost) |
173 | 173 |
174 api.Handle("/imports/bottleneck", waterwayAdmin(&JSONHandler{ | 174 api.Handle("/imports/bottleneck", waterwayAdmin(&JSONHandler{ |
175 Input: func() interface{} { return new(models.BottleneckImport) }, | 175 Input: func() interface{} { return new(models.BottleneckImport) }, |
176 Handle: importBottleneck, | 176 Handle: manualImport(imports.BNJobKind, importBottleneck), |
177 NoConn: true, | |
177 })).Methods(http.MethodPost) | 178 })).Methods(http.MethodPost) |
178 | 179 |
179 api.Handle("/imports/gaugemeasurement", waterwayAdmin(&JSONHandler{ | 180 api.Handle("/imports/gaugemeasurement", waterwayAdmin(&JSONHandler{ |
180 Input: func() interface{} { return new(models.GaugeMeasurementImport) }, | 181 Input: func() interface{} { return new(models.GaugeMeasurementImport) }, |
181 Handle: importGaugeMeasurement, | 182 Handle: manualImport(imports.GMJobKind, importGaugeMeasurement), |
183 NoConn: true, | |
182 })).Methods(http.MethodPost) | 184 })).Methods(http.MethodPost) |
183 | 185 |
184 api.Handle("/imports/fairwayavailability", waterwayAdmin(&JSONHandler{ | 186 api.Handle("/imports/fairwayavailability", waterwayAdmin(&JSONHandler{ |
185 Input: func() interface{} { return new(models.FairwayAvailabilityImport) }, | 187 Input: func() interface{} { return new(models.FairwayAvailabilityImport) }, |
186 Handle: importFairwayAvailability, | 188 Handle: manualImport(imports.FAJobKind, importFairwayAvailability), |
189 NoConn: true, | |
187 })).Methods(http.MethodPost) | 190 })).Methods(http.MethodPost) |
188 | 191 |
189 // Import scheduler configuration | 192 // Import scheduler configuration |
190 api.Handle("/imports/config/{id:[0-9]+}", | 193 api.Handle("/imports/config/{id:[0-9]+}", |
191 waterwayAdmin(&JSONHandler{ | 194 waterwayAdmin(&JSONHandler{ |