comparison pkg/imports/modelconvert.go @ 4392:024b16a1c253

Implemented deletion of stretches.
author Sascha Wilde <wilde@intevation.de>
date Thu, 12 Sep 2019 20:08:29 +0200
parents 2ac52d89619e
children 3b36c4d810b0
comparison
equal deleted inserted replaced
4391:d9088bb96ce1 4392:024b16a1c253
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 SECJobKind: func() interface{} { return new(models.SectionImport) },
32 DSECJobKind: func() interface{} { return new(models.SectionDelete) }, 32 DSECJobKind: func() interface{} { return new(models.SectionDelete) },
33 DSTJobKind: func() interface{} { return new(models.StretchDelete) },
33 } 34 }
34 35
35 // ImportModelForJobKind returns the constructor function to 36 // ImportModelForJobKind returns the constructor function to
36 // de-serialize an incoming JSON REST represention of an import. 37 // de-serialize an incoming JSON REST represention of an import.
37 func ImportModelForJobKind(kind JobKind) func() interface{} { 38 func ImportModelForJobKind(kind JobKind) func() interface{} {
162 Date: seci.Date, 163 Date: seci.Date,
163 } 164 }
164 }, 165 },
165 166
166 DSECJobKind: func(input interface{}) interface{} { 167 DSECJobKind: func(input interface{}) interface{} {
167 ds := input.(*models.SectionDelete) 168 dsec := input.(*models.SectionDelete)
168 return &DeleteSection{ID: ds.ID} 169 return &DeleteSection{ID: dsec.ID}
170 },
171
172 DSTJobKind: func(input interface{}) interface{} {
173 dst := input.(*models.StretchDelete)
174 return &DeleteStretch{ID: dst.ID}
169 }, 175 },
170 } 176 }
171 177
172 func nilString(s *string) string { 178 func nilString(s *string) string {
173 if s != nil { 179 if s != nil {