comparison pkg/imports/modelconvert.go @ 3171:c8ded555c2a8

Sections import: Added a sections import. Derived from the stretches import w/o the countries.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 06 May 2019 16:36:03 +0200
parents a10022399e24
children 51e90370eced
comparison
equal deleted inserted replaced
3170:5c8ecab9f2d4 3171:c8ded555c2a8
26 WGJobKind: func() interface{} { return new(models.WaterwayGaugeImport) }, 26 WGJobKind: func() interface{} { return new(models.WaterwayGaugeImport) },
27 DMVJobKind: func() interface{} { return new(models.DistanceMarksVirtualImport) }, 27 DMVJobKind: func() interface{} { return new(models.DistanceMarksVirtualImport) },
28 FDJobKind: func() interface{} { return new(models.FairwayDimensionImport) }, 28 FDJobKind: func() interface{} { return new(models.FairwayDimensionImport) },
29 DMAJobKind: func() interface{} { return new(models.DistanceMarksAshoreImport) }, 29 DMAJobKind: func() interface{} { return new(models.DistanceMarksAshoreImport) },
30 STJobKind: func() interface{} { return new(models.StretchImport) }, 30 STJobKind: func() interface{} { return new(models.StretchImport) },
31 SECJobKind: func() interface{} { return new(models.SectionImport) },
31 } 32 }
32 33
33 func ImportModelForJobKind(kind JobKind) func() interface{} { 34 func ImportModelForJobKind(kind JobKind) func() interface{} {
34 return kindToImportModel[kind] 35 return kindToImportModel[kind]
35 } 36 }
142 Source: sti.Source, 143 Source: sti.Source,
143 Date: sti.Date, 144 Date: sti.Date,
144 Countries: sti.Countries, 145 Countries: sti.Countries,
145 } 146 }
146 }, 147 },
148
149 SECJobKind: func(input interface{}) interface{} {
150 seci := input.(*models.SectionImport)
151 return &Section{
152 Name: seci.Name,
153 From: seci.From,
154 To: seci.To,
155 Tolerance: seci.Tolerance,
156 ObjNam: seci.ObjNam,
157 NObjNam: seci.NObjNam,
158 Source: seci.Source,
159 Date: seci.Date,
160 }
161 },
147 } 162 }
148 163
149 func nilString(s *string) string { 164 func nilString(s *string) string {
150 if s != nil { 165 if s != nil {
151 return *s 166 return *s