2023-09-15 17:10:57 -04:00
|
|
|
// Package webhandler provides handlers for the web app routes
|
|
|
|
package webhandler
|
2023-09-17 01:12:46 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"git.agecem.com/agecem/bottin-ag/webresponse"
|
|
|
|
"github.com/labstack/echo/v4"
|
|
|
|
)
|
|
|
|
|
|
|
|
func DeclareRoutes(e *echo.Echo, h *WebHandler) {
|
|
|
|
e.GET("/", h.IndexGET)
|
|
|
|
}
|
|
|
|
|
|
|
|
type WebHandler struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func New() WebHandler {
|
|
|
|
return WebHandler{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *WebHandler) IndexGET(c echo.Context) error {
|
|
|
|
var r webresponse.IndexGET
|
|
|
|
|
|
|
|
r.Message = "foo"
|
|
|
|
r.StatusCode = http.StatusOK
|
|
|
|
|
|
|
|
return c.Render(r.StatusCode, "index-html", r)
|
|
|
|
}
|