mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
dev day #75
This commit is contained in:
@@ -199,6 +199,15 @@ func SetupRoutes(api *gin.RouterGroup, db *gorm.DB) {
|
||||
sponsors.DELETE("/:id", baseController.DeleteSponsor)
|
||||
}
|
||||
|
||||
// Banners (protected CRUD)
|
||||
banners := protected.Group("/banners")
|
||||
banners.Use(middleware.RoleAuth("admin"))
|
||||
{
|
||||
banners.POST("", baseController.CreateBanner)
|
||||
banners.PUT("/:id", baseController.UpdateBanner)
|
||||
banners.DELETE("/:id", baseController.DeleteBanner)
|
||||
}
|
||||
|
||||
// Admin routes (single consolidated group)
|
||||
admin := protected.Group("/admin")
|
||||
admin.Use(middleware.RoleAuth("admin"))
|
||||
@@ -488,6 +497,8 @@ func SetupRoutes(api *gin.RouterGroup, db *gorm.DB) {
|
||||
api.GET("/players", baseController.GetPlayers)
|
||||
api.GET("/players/:id", baseController.GetPlayer)
|
||||
api.GET("/sponsors", baseController.GetSponsors)
|
||||
// Public banners
|
||||
api.GET("/banners", baseController.GetBanners)
|
||||
api.GET("/matches", baseController.GetMatches)
|
||||
api.GET("/matches/history", baseController.GetMatchesHistory)
|
||||
api.GET("/standings", baseController.GetStandings)
|
||||
|
||||
Reference in New Issue
Block a user