Mercurial > gemma
diff pkg/controllers/routes.go @ 1627:b10aa02d7819
Refactored: Moved REST /api/imports/scheduler to /api/imports/config
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 19 Dec 2018 15:58:44 +0100 |
parents | c12cec1d7692 |
children | dd31be75ce6d |
line wrap: on
line diff
--- a/pkg/controllers/routes.go Wed Dec 19 15:07:14 2018 +0100 +++ b/pkg/controllers/routes.go Wed Dec 19 15:58:44 2018 +0100 @@ -21,6 +21,7 @@ "github.com/gorilla/mux" "gemma.intevation.de/gemma/pkg/auth" + "gemma.intevation.de/gemma/pkg/imports" "gemma.intevation.de/gemma/pkg/middleware" "gemma.intevation.de/gemma/pkg/models" ) @@ -176,30 +177,30 @@ })).Methods(http.MethodPost) // Import scheduler configuration - api.Handle("/imports/scheduler/{id:[0-9]+}", + api.Handle("/imports/config/{id:[0-9]+}", waterwayAdmin(&JSONHandler{ - Handle: modifySchedule, + Handle: modifyImportConfig, })).Methods(http.MethodPatch) - api.Handle("/imports/scheduler/{id:[0-9]+}", + api.Handle("/imports/config/{id:[0-9]+}", waterwayAdmin(&JSONHandler{ - Handle: deleteSchedule, + Handle: deleteImportConfig, })).Methods(http.MethodDelete) - api.Handle("/imports/scheduler/{id:[0-9]+}", + api.Handle("/imports/config/{id:[0-9]+}", waterwayAdmin(&JSONHandler{ - Handle: infoSchedule, + Handle: infoImportConfig, })).Methods(http.MethodGet) - api.Handle("/imports/scheduler", + api.Handle("/imports/config", waterwayAdmin(&JSONHandler{ - Input: func() interface{} { return new(models.ImportConfig) }, - Handle: addSchedule, + Input: func() interface{} { return new(imports.Config) }, + Handle: addImportConfig, })).Methods(http.MethodPost) - api.Handle("/imports/scheduler", + api.Handle("/imports/config", waterwayAdmin(&JSONHandler{ - Handle: listScheduler, + Handle: listImportConfigs, })).Methods(http.MethodGet) // Import queue