From a1146d182fafead4d3b2401958f37c781f6bf1ee Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Wed, 26 Apr 2023 19:28:20 -0400 Subject: [PATCH] Ajouter routes /admin et /admin/documents/upload --- cmd/server.go | 8 +++++++- public/html/admin-upload.gohtml | 14 ++++++++++++++ public/html/admin.gohtml | 17 +++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 public/html/admin-upload.gohtml create mode 100644 public/html/admin.gohtml diff --git a/cmd/server.go b/cmd/server.go index 724af2a..906cc2d 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -199,6 +199,8 @@ func RunServer() { groupAdmin.GET("", handleAdmin) + groupAdmin.GET("/documents/upload", handleAdminDocumentsUpload) + e.Logger.Fatal(e.Start( fmt.Sprintf(":%d", viper.GetInt("server.port")))) } @@ -717,7 +719,11 @@ func handlePublicDocumentation(c echo.Context) error { } func handleAdmin(c echo.Context) error { - return c.JSON(http.StatusNotImplemented, map[string]string{"message": "Not Implemented"}) + return c.Render(http.StatusOK, "admin-html", nil) +} + +func handleAdminDocumentsUpload(c echo.Context) error { + return c.Render(http.StatusOK, "admin-upload-html", nil) } // CSS Handlers diff --git a/public/html/admin-upload.gohtml b/public/html/admin-upload.gohtml new file mode 100644 index 0000000..e39f3b3 --- /dev/null +++ b/public/html/admin-upload.gohtml @@ -0,0 +1,14 @@ +{{ define "admin-upload-html" }} + + + + + AGECEM + {{ template "general-html" }} + + + {{ template "header-html" }} +

Upload

+ + +{{ end }} diff --git a/public/html/admin.gohtml b/public/html/admin.gohtml new file mode 100644 index 0000000..d7e0038 --- /dev/null +++ b/public/html/admin.gohtml @@ -0,0 +1,17 @@ +{{ define "admin-html" }} + + + + + AGECEM + {{ template "general-html" }} + + + {{ template "header-html" }} +

Admin

+ + + +{{ end }}