From ebad682a65f04dd07bbb04406a09676f56558732 Mon Sep 17 00:00:00 2001 From: Maxime Date: Wed, 24 Apr 2024 16:05:21 +0200 Subject: [PATCH] route for silvermobi frontend and backend --- handlers/application/group_module.go | 2 +- handlers/application/silvermobi.go | 18 +++++++++++------- main.go | 8 ++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/handlers/application/group_module.go b/handlers/application/group_module.go index e6da0aa..9a8b0ac 100755 --- a/handlers/application/group_module.go +++ b/handlers/application/group_module.go @@ -44,7 +44,7 @@ func (h *ApplicationHandler) Groups(w http.ResponseWriter, r *http.Request) { } resp, err := h.services.GRPC.GroupsManagement.GetGroups(context.TODO(), request) - if err != nil { + if err != nil { fmt.Println(err) w.WriteHeader(http.StatusInternalServerError) return diff --git a/handlers/application/silvermobi.go b/handlers/application/silvermobi.go index 9671b38..31a3f00 100644 --- a/handlers/application/silvermobi.go +++ b/handlers/application/silvermobi.go @@ -1,23 +1,27 @@ -package application +package application import ( "fmt" "net/http" ) -func (h *ApplicationHandler) SilvermobiBookingList(w http.ResponseWriter, r *http.Request ) { +func (h *ApplicationHandler) SilvermobiBookingList(w http.ResponseWriter, r *http.Request) { + + + h.Renderer.SilvermobiBookingList(w, r) - fmt.Println("SilverBookingR") + } -func (h *ApplicationHandler) SilvermobiBookingCreate(w http.ResponseWriter, r *http.Request){ +func (h *ApplicationHandler) SilvermobiBookingCreate(w http.ResponseWriter, r *http.Request) { fmt.Println("SilverBookingC") } -func (h *ApplicationHandler) SilvermobiBookingUpdate(w http.ResponseWriter, r *http.Request){ +func (h *ApplicationHandler) SilvermobiBookingUpdate(w http.ResponseWriter, r *http.Request) { fmt.Println("SilverBookingU") } -func (h *ApplicationHandler) SilvermobiBookingDelete(w http.ResponseWriter, r *http.Request){ +func (h *ApplicationHandler) SilvermobiBookingDelete(w http.ResponseWriter, r *http.Request) { fmt.Println("SilverBookingD") -} \ No newline at end of file +} + diff --git a/main.go b/main.go index 56c028f..d713e2d 100755 --- a/main.go +++ b/main.go @@ -138,10 +138,10 @@ func main() { /*********************** CODE GROUP **************************/ //=================================silvermobi==================================== - application.HandleFunc("/app/silvermobi/create", applicationHandler.SilvermobiBookingCreate) - application.HandleFunc("/app/silvermobi/", applicationHandler.SilvermobiBookingList) - application.HandleFunc("/app/silvermobi/update/{memberid}/{bookingid}", applicationHandler.SilvermobiBookingUpdate) - application.HandleFunc("/app/silvermobi/delete/{memberid}/{bookingid}", applicationHandler.SilvermobiBookingDelete) + application.HandleFunc("/silvermobi/create", applicationHandler.SilvermobiBookingCreate) + application.HandleFunc("/silvermobi/", applicationHandler.SilvermobiBookingList) + application.HandleFunc("/silvermobi/update/{memberid}/{bookingid}", applicationHandler.SilvermobiBookingUpdate) + application.HandleFunc("/silvermobi/delete/{memberid}/{bookingid}", applicationHandler.SilvermobiBookingDelete) appGroup := application.PathPrefix("/group_module").Subrouter() appGroup.HandleFunc("/", applicationHandler.Groups)