From c2f7238a6f000aecdc45894bd48abd0cd6cb8e54 Mon Sep 17 00:00:00 2001 From: Torgrim <sir_alexiner@hotmail.com> Date: Wed, 10 Apr 2024 23:47:04 +0200 Subject: [PATCH] Started Development on Notifications Endpoint --- Go/cmd/globeboard/app.go | 2 +- .../dashboard/notifications_id_handler.go | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 Go/internal/handlers/endpoint/dashboard/notifications_id_handler.go diff --git a/Go/cmd/globeboard/app.go b/Go/cmd/globeboard/app.go index cc5934e..c07d94b 100644 --- a/Go/cmd/globeboard/app.go +++ b/Go/cmd/globeboard/app.go @@ -43,7 +43,7 @@ func main() { mux.HandleFunc(Endpoints.RegistrationsID, dashboard.RegistrationsIdHandler) mux.HandleFunc(Endpoints.Registrations, dashboard.RegistrationsHandler) mux.HandleFunc(Endpoints.Dashboards, dashboard.DashboardsHandler) - mux.HandleFunc(Endpoints.NotificationsID, dashboard.NotificationsHandler) + mux.HandleFunc(Endpoints.NotificationsID, dashboard.NotificationsIdHandler) mux.HandleFunc(Endpoints.Notifications, dashboard.NotificationsHandler) mux.HandleFunc(Endpoints.Status, dashboard.StatusHandler) diff --git a/Go/internal/handlers/endpoint/dashboard/notifications_id_handler.go b/Go/internal/handlers/endpoint/dashboard/notifications_id_handler.go new file mode 100644 index 0000000..f059363 --- /dev/null +++ b/Go/internal/handlers/endpoint/dashboard/notifications_id_handler.go @@ -0,0 +1,22 @@ +// Package dashboard provides handlers for dashboard-related endpoints. +package dashboard + +import ( + "net/http" +) + +// NotificationsIdHandler handles requests to retrieve readership dashboard for a specific language. +func NotificationsIdHandler(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodGet: + handleNotifGetAllRequest(w, r) + default: + http.Error(w, "REST Method: "+r.Method+" not supported. Currently no methods are supported.", http.StatusNotImplemented) + return + } +} + +// handleGetRequest handles GET requests to retrieve readership dashboard for a specific language. +func handleNotifGetAllRequest(w http.ResponseWriter, r *http.Request) { + //TODO::Complete HTTP Method Requests +} -- GitLab