# HG changeset patch # User Thomas Junk # Date 1548407753 -3600 # Node ID 15db4fb07af42878dbb1cf17ad180987c3ecd9c5 # Parent 4c33bac70a11c77b0008ffc7803860252f413254# Parent 83108e90b223bf9b555e1119208d842f36c8e094 merge diff -r 4c33bac70a11 -r 15db4fb07af4 pkg/controllers/manualimports.go --- a/pkg/controllers/manualimports.go Fri Jan 25 10:15:29 2019 +0100 +++ b/pkg/controllers/manualimports.go Fri Jan 25 10:15:53 2019 +0100 @@ -159,7 +159,10 @@ } trys = qct.Trys waitRetry = qct.WaitRetry - email = qct.EMail + } + + if etg, ok := input.(models.EmailTypeGetter); ok { + email = etg.GetEmailType().Email } session, _ := auth.GetSession(req) diff -r 4c33bac70a11 -r 15db4fb07af4 pkg/models/importbase.go --- a/pkg/models/importbase.go Fri Jan 25 10:15:29 2019 +0100 +++ b/pkg/models/importbase.go Fri Jan 25 10:15:53 2019 +0100 @@ -24,16 +24,16 @@ // CronSpec is a string containing a cron line. CronSpec string + EmailType struct { + Email bool `json:"send-email,omitempty"` + } + QueueConfigurationType struct { + EmailType Trys *int `json:"trys,omitempty"` WaitRetry *time.Duration `json:"wait-retry,omitempty"` Due *time.Time `json:"due,omitempty"` Cron *CronSpec `json:"cron,omitempty"` - EMail bool `json:"send-email,omitempty"` - } - - QueueConfigurationGetter interface { - GetQueueConfiguration() *QueueConfigurationType } URLType struct { @@ -43,6 +43,14 @@ Password *string `json:"password,omitempty"` } + EmailTypeGetter interface { + GetEmailType() *EmailType + } + + QueueConfigurationGetter interface { + GetQueueConfiguration() *QueueConfigurationType + } + URLTypeGetter interface { GetURLType() *URLType } @@ -56,6 +64,10 @@ return ut } +func (et *EmailType) GetEmailType() *EmailType { + return et +} + // UnmarshalJSON checks if the incoming string is a valid cron line. func (cs *CronSpec) UnmarshalJSON(data []byte) error { var spec string diff -r 4c33bac70a11 -r 15db4fb07af4 pkg/models/imports.go --- a/pkg/models/imports.go Fri Jan 25 10:15:29 2019 +0100 +++ b/pkg/models/imports.go Fri Jan 25 10:15:53 2019 +0100 @@ -97,7 +97,7 @@ } StretchImport struct { - QueueConfigurationType + EmailType Name string `json:"name"` From Isrs `json:"from"`