refactor: use controller approach in handlers

This commit is contained in:
Stavros
2025-08-25 16:40:06 +03:00
parent e1d8ce3cb5
commit dfdc656145
23 changed files with 910 additions and 1428 deletions

View File

@@ -0,0 +1,24 @@
package controller
import "github.com/gin-gonic/gin"
type HealthController struct {
Router *gin.RouterGroup
}
func NewHealthController(router *gin.RouterGroup) *HealthController {
return &HealthController{
Router: router,
}
}
func (controller *HealthController) SetupRoutes() {
controller.Router.GET("/health", controller.healthHandler)
}
func (controller *HealthController) healthHandler(c *gin.Context) {
c.JSON(200, gin.H{
"status": "ok",
"message": "Healthy",
})
}