diff pkg/models/imports.go @ 2025:070ac9dd61a1 unify_imports

Bring manual imports to new import modeling.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 24 Jan 2019 18:19:43 +0100
parents 6d9fbc62c5a6
children 8d006afa7c1b
line wrap: on
line diff
--- a/pkg/models/imports.go	Thu Jan 24 17:38:31 2019 +0100
+++ b/pkg/models/imports.go	Thu Jan 24 18:19:43 2019 +0100
@@ -12,97 +12,67 @@
 //  * Sascha L. Teichmann <sascha.teichmann@intevation.de>
 package models
 
-import "gemma.intevation.de/gemma/pkg/common"
-
 type (
 	BottleneckImport struct {
-		URL        string            `json:"url"`
-		Insecure   bool              `json:"insecure"`
-		SendEmail  bool              `json:"send-email"`
-		Attributes common.Attributes `json:"attributes,omitempty"`
+		URLType
+		QueueConfigurationType
 	}
 
 	// GaugeMeasurementImport contains data used to define the endpoint
 	GaugeMeasurementImport struct {
-		URL       string `json:"url"`
-		Insecure  bool   `json:"insecure"`
-		SendEmail bool   `json:"send-email"`
-		// Attributes are optional attributes.
-		Attributes common.Attributes `json:"attributes,omitempty"`
+		URLType
+		QueueConfigurationType
 	}
 
 	// FairwayAvailabilityImport contains data used to define the endpoint
 	FairwayAvailabilityImport struct {
-		URL       string `json:"url"`
-		Insecure  bool   `json:"insecure"`
-		SendEmail bool   `json:"send-email"`
-		// Attributes are optional attributes.
-		Attributes common.Attributes `json:"attributes,omitempty"`
+		URLType
+		QueueConfigurationType
 	}
 
 	// WaterwayAxisImport specifies an import of the waterway axis.
 	WaterwayAxisImport struct {
-		// URL is the capabilities URL of the WFS.
-		URL string `json:"url"`
+		URLType
+		QueueConfigurationType
+
 		// FeatureType is the layer to use.
 		FeatureType string `json:"feature-type"`
 		// SortBy sorts the feature by this key.
 		SortBy string `json:"sort-by"`
-		// SendEmail is set to true if an email should be send after
-		// importing the axis.
-		SendEmail bool `json:"send-email"`
-		// Attributes are optional attributes.
-		Attributes common.Attributes `json:"attributes,omitempty"`
 	}
 
 	// WaterwayAreaImport specifies an import of the waterway area.
 	WaterwayAreaImport struct {
-		// URL is the capabilities URL of the WFS.
-		URL string `json:"url"`
+		URLType
+		QueueConfigurationType
+
 		// FeatureType is the layer to use.
 		FeatureType string `json:"feature-type"`
 		// SortBy sorts the feature by this key.
 		SortBy string `json:"sort-by"`
-		// SendEmail is set to true if an email should be send after
-		// importing the axis.
-		SendEmail bool `json:"send-email"`
-		// Attributes are optional attributes.
-		Attributes common.Attributes `json:"attributes,omitempty"`
 	}
 
 	// WaterwayAxisImport specifies an import of waterway gauges.
 	WaterwayGaugeImport struct {
-		// URL is the SOAP service URL.
-		URL string `json:"url"`
-		// SendEmail is set to true if an email should be send after
-		// importing the waterway gauges.
-		SendEmail bool `json:"send-email"`
-		// Attributes are optional attributes.
-		Attributes common.Attributes `json:"attributes,omitempty"`
+		URLType
+		QueueConfigurationType
 	}
 
 	// DistanceMarksVirtualImport specifies an import of distance marks virtual.
 	DistanceMarksVirtualImport struct {
-		// URL is the SOAP service URL.
-		URL string `json:"url"`
-		// SendEmail is set to true if an email should be send after
-		// importing the waterway gauges.
-		SendEmail bool `json:"send-email"`
-		// Attributes are optional attributes.
-		Attributes common.Attributes `json:"attributes,omitempty"`
+		URLType
+		QueueConfigurationType
 	}
 
 	// FairwayDimensionImport specifies an import of the waterway axis.
 	FairwayDimensionImport struct {
-		// URL is the capabilities URL of the WFS.
-		URL string `json:"url"`
+		URLType
+		QueueConfigurationType
+
 		// FeatureType is the layer to use.
 		FeatureType string `json:"feature-type"`
 		// SortBy sorts the feature by this key.
 		SortBy string `json:"sort-by"`
-		// SendEmail is set to true if an email should be send after
-		// importing the axis.
-		SendEmail bool `json:"send-email"`
 		// LOS is the level of service provided by the wfs
 		LOS int `json:"los"`
 		// MinWidth is the minimum width of the fairway for the specified LOS
@@ -113,26 +83,22 @@
 		Depth int `json:"depth"`
 		// SourceOrganization specifies the source of the entry
 		SourceOrganization string `json:"source-organization"`
-		// Attributes are optional attributes.
-		Attributes common.Attributes `json:"attributes,omitempty"`
 	}
 
 	// DistanceMarksAshoreImport specifies an import of the distance marks.
 	DistanceMarksAshoreImport struct {
-		// URL is the capabilities URL of the WFS.
-		URL string `json:"url"`
+		URLType
+		QueueConfigurationType
+
 		// FeatureType is the layer to use.
 		FeatureType string `json:"feature-type"`
 		// SortBy sorts the feature by this key.
 		SortBy string `json:"sort-by"`
-		// SendEmail is set to true if an email should be send after
-		// importing the axis.
-		SendEmail bool `json:"send-email"`
-		// Attributes are optional attributes.
-		Attributes common.Attributes `json:"attributes,omitempty"`
 	}
 
 	StretchImport struct {
+		QueueConfigurationType
+
 		Name      string          `json:"name"`
 		From      Isrs            `json:"from"`
 		To        Isrs            `json:"to"`
@@ -141,8 +107,5 @@
 		Source    string          `json:"source-organization"`
 		Date      Date            `json:"date-info"`
 		Countries UniqueCountries `json:"countries"`
-
-		SendEmail  bool              `json:"send-email"`
-		Attributes common.Attributes `json:"attributes,omitempty"`
 	}
 )