Mercurial > gemma
annotate pkg/controllers/uploadedimports.go @ 4188:f8b7db7e392a
Added an "import" job to delete a section from the database.
TODO: wire it to the manual imports.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 07 Aug 2019 13:11:16 +0200 |
parents | 34623265eac1 |
children | 4394daeea96a |
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" |
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
|
27 "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
|
28 ) |
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 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
|
31 |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
32 // 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
|
33 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
|
34 |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
35 func importWaterwayProfiles() http.HandlerFunc { |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
36 return uploadedImport( |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
37 imports.WPJobKind, |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
38 "wp.csv", |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
39 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
|
40 url := req.FormValue("url") |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
41 if url == "" { |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
42 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
|
43 } |
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 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
|
46 if featureType == "" { |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
47 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
|
48 } |
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 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
|
51 |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
52 var precision *float64 |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
53 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
|
54 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
|
55 if err != nil { |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
56 return nil, badUploadParameterError( |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
57 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
|
58 } |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
59 precision = &v |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
60 } |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
61 |
2723
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2586
diff
changeset
|
62 user := req.FormValue("user") |
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2586
diff
changeset
|
63 password := req.FormValue("password") |
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2586
diff
changeset
|
64 |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
65 return &imports.WaterwayProfiles{ |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
66 Dir: dir, |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
67 URL: url, |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
68 FeatureType: featureType, |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
69 SortBy: sortBy, |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
70 Precision: precision, |
2723
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2586
diff
changeset
|
71 User: user, |
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2586
diff
changeset
|
72 Password: password, |
2537
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
73 }, nil |
07f892bc4bb0
WP import: Made WP import an uploaded import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2536
diff
changeset
|
74 }, |
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 |
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
|
78 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
|
79 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
|
80 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
|
81 "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
|
82 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
|
83 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
|
84 if originator == "" { |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
85 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
|
86 } |
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 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
|
89 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
|
90 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
|
91 }, 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
|
92 }, |
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 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
|
97 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
|
98 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
|
99 "data.xml", |
2586
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
100 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
|
101 |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
102 var tolerance float64 |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
103 if t := req.FormValue("tolerance"); t != "" { |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
104 v, err := strconv.ParseFloat(t, 64) |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
105 if err != nil { |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
106 return nil, badUploadParameterError( |
2586
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
107 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
|
108 } |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
109 tolerance = v |
bc1b43885a4d
Expose axis snapping tolerance in bottleneck upload import
Tom Gottfried <tom@intevation.de>
parents:
2563
diff
changeset
|
110 } |
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 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
|
113 }, |
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 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
|
118 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
|
119 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
|
120 "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
|
121 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
|
122 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
|
123 }, |
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 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
|
128 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
|
129 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
|
130 "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
|
131 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
|
132 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
|
133 }, |
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 |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
137 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
|
138 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
|
139 } |
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 |
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
|
141 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
|
142 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
|
143 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
|
144 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
|
145 ) 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
|
146 |
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 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
|
148 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
|
149 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
|
150 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
|
151 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
|
152 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
|
153 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
|
154 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
|
155 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
|
156 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
|
157 } |
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 |
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
|
159 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
|
160 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
|
161 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
|
162 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
|
163 } |
4183
34623265eac1
Made 'golint' happy (again) with the controllers package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2995
diff
changeset
|
164 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
|
165 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
|
166 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
|
167 } |
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 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
|
169 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
|
170 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
|
171 } |
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
|
172 |
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 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
|
174 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
|
175 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
|
176 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
|
177 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
|
178 } |
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 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
|
181 |
2995
5222bfe5b4af
Upload imports: spell form field 'send-email' instead of 'email'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
182 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
|
183 |
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 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
|
185 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
|
186 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
|
187 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
|
188 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
|
189 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
|
190 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
|
191 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
|
192 |
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 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
|
194 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
|
195 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
|
196 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
|
197 } |
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 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
|
200 |
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 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
|
202 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
|
203 }{ |
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 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
|
205 } |
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 SendJSON(rw, http.StatusCreated, &result) |
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
|
207 } |
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 } |