Mercurial > gemma
annotate pkg/controllers/uploadedimports.go @ 4265:2596a028dc3a
Feature_info: display partial legend information for bottlenecks
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 27 Aug 2019 11:46:51 +0200 |
parents | 4394daeea96a |
children | f9bb06f2dbe3 |
rev | line source |
---|---|
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 // This is Free Software under GNU Affero General Public License v >= 3.0 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 // without warranty, see README.md and license for details. |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 // |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 // SPDX-License-Identifier: AGPL-3.0-or-later |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 // License-Filename: LICENSES/AGPL-3.0.txt |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 // |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 // Copyright (C) 2018 by via donau |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 // – Österreichische Wasserstraßen-Gesellschaft mbH |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 // Software engineering by Intevation GmbH |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 // |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 // Author(s): |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 // * Sascha L. Teichmann <sascha.teichmann@intevation.de> |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 package controllers |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 import ( |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
17 "fmt" |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 "log" |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 "net/http" |
2536
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
20 "os" |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
21 "strconv" |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 "time" |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 "gemma.intevation.de/gemma/pkg/auth" |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 "gemma.intevation.de/gemma/pkg/common" |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 "gemma.intevation.de/gemma/pkg/imports" |
4244
4394daeea96a
Moved JSONHandler into middleware package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4183
diff
changeset
|
27 mw "gemma.intevation.de/gemma/pkg/middleware" |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 "gemma.intevation.de/gemma/pkg/misc" |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 ) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 const maxUploadSize = 25 * 1024 * 1024 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
33 // badUploadParameterError is a local type to find bad request parameters. |
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
34 type badUploadParameterError string |
2536
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
35 |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
36 func importWaterwayProfiles() http.HandlerFunc { |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
37 return uploadedImport( |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
38 imports.WPJobKind, |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
39 "wp.csv", |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
40 func(req *http.Request, dir string) (imports.Job, error) { |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
41 url := req.FormValue("url") |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
42 if url == "" { |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
43 return nil, badUploadParameterError("missing 'url' parameter") |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
44 } |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
45 |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
46 featureType := req.FormValue("feature-type") |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
47 if featureType == "" { |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
48 return nil, badUploadParameterError("missing 'feature-type' parameter") |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
49 } |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
50 |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
51 sortBy := req.FormValue("sort-by") |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
52 |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
53 var precision *float64 |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
54 if p := req.FormValue("precision"); p != "" { |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
55 v, err := strconv.ParseFloat(p, 64) |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
56 if err != nil { |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
57 return nil, badUploadParameterError( |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
58 fmt.Sprintf("Invalid 'precision' parameter: %v", err)) |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
59 } |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
60 precision = &v |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
61 } |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
62 |
2723
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2586
diff
changeset
|
63 user := req.FormValue("user") |
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2586
diff
changeset
|
64 password := req.FormValue("password") |
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2586
diff
changeset
|
65 |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
66 return &imports.WaterwayProfiles{ |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
67 Dir: dir, |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
68 URL: url, |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
69 FeatureType: featureType, |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
70 SortBy: sortBy, |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
71 Precision: precision, |
2723
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2586
diff
changeset
|
72 User: user, |
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2586
diff
changeset
|
73 Password: password, |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
74 }, nil |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
75 }, |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
76 ) |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
77 } |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
78 |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
79 func importApprovedGaugeMeasurements() http.HandlerFunc { |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
80 return uploadedImport( |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
81 imports.AGMJobKind, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 "agm.csv", |
2562
ce39e9954e85
Make upload of AGM require only "fk_gauge_id" "measure_date" and "value"
Sascha Wilde <wilde@intevation.de>
parents:
2537
diff
changeset
|
83 func(req *http.Request, dir string) (imports.Job, error) { |
ce39e9954e85
Make upload of AGM require only "fk_gauge_id" "measure_date" and "value"
Sascha Wilde <wilde@intevation.de>
parents:
2537
diff
changeset
|
84 originator := req.FormValue("originator") |
ce39e9954e85
Make upload of AGM require only "fk_gauge_id" "measure_date" and "value"
Sascha Wilde <wilde@intevation.de>
parents:
2537
diff
changeset
|
85 if originator == "" { |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
86 return nil, badUploadParameterError("missing 'originator' parameter") |
2562
ce39e9954e85
Make upload of AGM require only "fk_gauge_id" "measure_date" and "value"
Sascha Wilde <wilde@intevation.de>
parents:
2537
diff
changeset
|
87 } |
ce39e9954e85
Make upload of AGM require only "fk_gauge_id" "measure_date" and "value"
Sascha Wilde <wilde@intevation.de>
parents:
2537
diff
changeset
|
88 |
ce39e9954e85
Make upload of AGM require only "fk_gauge_id" "measure_date" and "value"
Sascha Wilde <wilde@intevation.de>
parents:
2537
diff
changeset
|
89 return &imports.ApprovedGaugeMeasurements{ |
ce39e9954e85
Make upload of AGM require only "fk_gauge_id" "measure_date" and "value"
Sascha Wilde <wilde@intevation.de>
parents:
2537
diff
changeset
|
90 Dir: dir, |
ce39e9954e85
Make upload of AGM require only "fk_gauge_id" "measure_date" and "value"
Sascha Wilde <wilde@intevation.de>
parents:
2537
diff
changeset
|
91 Originator: originator, |
ce39e9954e85
Make upload of AGM require only "fk_gauge_id" "measure_date" and "value"
Sascha Wilde <wilde@intevation.de>
parents:
2537
diff
changeset
|
92 }, nil |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
93 }, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 ) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 } |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 func importUploadedBottleneck() http.HandlerFunc { |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 return uploadedImport( |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 imports.UBNJobKind, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 "data.xml", |
2586
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
101 func(req *http.Request, dir string) (imports.Job, error) { |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
102 |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
103 var tolerance float64 |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
104 if t := req.FormValue("tolerance"); t != "" { |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
105 v, err := strconv.ParseFloat(t, 64) |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
106 if err != nil { |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
107 return nil, badUploadParameterError( |
2586
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
108 fmt.Sprintf("Invalid 'tolerance' parameter: %v", err)) |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
109 } |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
110 tolerance = v |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
111 } |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
112 |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
113 return &imports.UploadedBottleneck{Dir: dir, Tolerance: tolerance}, nil |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
114 }, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 ) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
116 } |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
117 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
118 func importUploadedFairwayAvailability() http.HandlerFunc { |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 return uploadedImport( |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 imports.UFAJobKind, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
121 "data.xml", |
2536
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
122 func(_ *http.Request, dir string) (imports.Job, error) { |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
123 return &imports.UploadedFairwayAvailability{Dir: dir}, nil |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
124 }, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
125 ) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 } |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
127 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 func importUploadedGaugeMeasurement() http.HandlerFunc { |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 return uploadedImport( |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
130 imports.UGMJobKind, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
131 "data.xml", |
2536
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
132 func(_ *http.Request, dir string) (imports.Job, error) { |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
133 return &imports.UploadedGaugeMeasurement{Dir: dir}, nil |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
134 }, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
135 ) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
136 } |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
137 |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
138 func (bup badUploadParameterError) Error() string { |
2536
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
139 return string(bup) |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
140 } |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
141 |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
142 func uploadedImport( |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
143 kind imports.JobKind, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
144 fname string, |
2536
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
145 create func(*http.Request, string) (imports.Job, error), |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
146 ) http.HandlerFunc { |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
147 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
148 return func(rw http.ResponseWriter, req *http.Request) { |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
149 dir, err := misc.StoreUploadedFile( |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
150 req, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
151 string(kind), |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
152 fname, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
153 maxUploadSize) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
154 if err != nil { |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
155 log.Printf("error: %v\n", err) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
156 http.Error(rw, "error: "+err.Error(), http.StatusInternalServerError) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
157 return |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
158 } |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
159 |
2536
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
160 job, err := create(req, dir) |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
161 if err != nil { |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
162 if err2 := os.RemoveAll(dir); err2 != nil { |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
163 log.Printf("warn: %v\n", err2) |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
164 } |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
165 if err2, ok := err.(badUploadParameterError); ok { |
2536
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
166 http.Error(rw, string(err2), http.StatusBadRequest) |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
167 return |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
168 } |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
169 log.Printf("error: %v\n", err) |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
170 http.Error(rw, "error: "+err.Error(), http.StatusInternalServerError) |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
171 return |
0a3debcfbe8f
Upload imports: Increased power of upload imports to be able to cope parameterized imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2256
diff
changeset
|
172 } |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
173 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
174 serialized, err := common.ToJSONString(job) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
175 if err != nil { |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
176 log.Printf("error: %v\n", err) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
177 http.Error(rw, "error: "+err.Error(), http.StatusInternalServerError) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
178 return |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
179 } |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
180 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
181 session, _ := auth.GetSession(req) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
182 |
2995
5222bfe5b4af
Upload imports: spell form field 'send-email' instead of 'email'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
183 sendEmail := req.FormValue("send-email") != "" |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
184 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
185 jobID, err := imports.AddJob( |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
186 kind, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
187 time.Time{}, // due |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
188 nil, // trys |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
189 nil, // retry wait |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
190 session.User, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
191 sendEmail, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
192 serialized) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
193 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
194 if err != nil { |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
195 log.Printf("error: %v\n", err) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
196 http.Error(rw, "error: "+err.Error(), http.StatusInternalServerError) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
197 return |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
198 } |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
199 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
200 log.Printf("info: added import #%d to queue\n", jobID) |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
201 |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
202 result := struct { |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
203 ID int64 `json:"id"` |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
204 }{ |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
205 ID: jobID, |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
206 } |
4244
4394daeea96a
Moved JSONHandler into middleware package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4183
diff
changeset
|
207 mw.SendJSON(rw, http.StatusCreated, &result) |
2256
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
208 } |
0d272d7bcfb9
Uploaded imports: Unified agm, ubn, ufa and ugm import endpoints and removed a lot c&p code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
209 } |