trying around with different routing and controller structures
This commit is contained in:
27
wagfarm-api/routes/logs.go
Normal file
27
wagfarm-api/routes/logs.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user