1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: move route registration into the handler classes themselves (resolve #57)

This commit is contained in:
Ferdinand Mütsch
2021-01-30 10:34:52 +01:00
parent a6aff07b21
commit 417d4789ab
12 changed files with 109 additions and 39 deletions

View File

@ -24,6 +24,12 @@ func NewAllTimeHandler(summaryService services.ISummaryService) *AllTimeHandler
}
}
func (h *AllTimeHandler) RegisterRoutes(router *mux.Router) {}
func (h *AllTimeHandler) RegisterAPIRoutes(router *mux.Router) {
router.Path("/all_time_since_today").Methods(http.MethodGet).HandlerFunc(h.ApiGet)
}
func (h *AllTimeHandler) ApiGet(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
values, _ := url.ParseQuery(r.URL.RawQuery)