package interfaces import ( "58team_blog/internal/application/services" "58team_blog/internal/interfaces/api/controllers" "github.com/gin-gonic/gin" ) func BindPostAdmin(service *services.PostService, group *gin.RouterGroup) { post := controllers.CreatePostController(service) g := group.Group("/post") g.GET("/", post.GetAll) g.GET("/offset/:offset", post.GetAllWithOffset) g.GET("/:id", post.GetById) g.POST("/", post.Post) g.PUT("/:id", post.Put) g.DELETE("/:id", post.Delete) } func BindUser(service *services.UserService, group *gin.RouterGroup) { user := controllers.CreateUserController(service) g := group.Group("/user/") g.POST("/", user.Post) g.GET("/", user.GetAll) g.GET("/:id", user.FindById) g.GET("/name/:name", user.FindByName) g.PUT("/:id", user.Put) g.DELETE("/:id", user.Delete) }