trying around with different routing and controller structures

This commit is contained in:
2025-04-14 23:31:22 +02:00
parent 2b1e2f76c6
commit d6b3e88b5f
12 changed files with 381 additions and 132 deletions

View File

@@ -0,0 +1,27 @@
package routes
import (
"wagfarm-api/controllers/logs"
"github.com/gin-gonic/gin"
)
func RegisterLogRoutes(rg *gin.RouterGroup) {
group := rg.Group("/log")
{
RegisterLog(group, &logs.GenericLogController{})
RegisterLog(group.Group("/seeding"), &logs.SeedingLogController{})
}
}
}
func RegisterLog(rg *gin.RouterGroup controller logs.LogController) {
group := rg.Group(routePrefix)
{
group.GET("/", controller.GetAll)
group.GET("/:id", controller.GetOne)
group.POST("/", controller.Create)
group.PUT("/:id", controller.Update)
group.DELETE("/:id", controller.Delete)
}
}