mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 18:52:56 +00:00
dev day #90 🥳
This commit is contained in:
@@ -301,10 +301,7 @@ func SetupRoutes(api *gin.RouterGroup, db *gorm.DB) {
|
||||
admin.DELETE("/competition-aliases/:code", baseController.DeleteCompetitionAlias)
|
||||
admin.POST("/competition-aliases/reorder", baseController.ReorderCompetitionAliases)
|
||||
|
||||
// Categories (admin)
|
||||
admin.POST("/categories", baseController.CreateCategory)
|
||||
admin.PUT("/categories/:id", baseController.UpdateCategory)
|
||||
admin.DELETE("/categories/:id", baseController.DeleteCategory)
|
||||
// Categories admin removed: categories are derived from competition aliases
|
||||
|
||||
// Settings (singleton)
|
||||
admin.GET("/settings", baseController.GetSettings)
|
||||
@@ -621,7 +618,7 @@ func SetupRoutes(api *gin.RouterGroup, db *gorm.DB) {
|
||||
api.GET("/matches", baseController.GetMatches)
|
||||
api.GET("/matches/history", baseController.GetMatchesHistory)
|
||||
api.GET("/standings", baseController.GetStandings)
|
||||
|
||||
|
||||
api.GET("/gallery/albums", galleryController.GetGalleryAlbums)
|
||||
api.GET("/gallery/albums/:id", galleryController.GetGalleryAlbum)
|
||||
api.GET("/gallery/proxy-image", galleryController.ProxyImage)
|
||||
@@ -634,10 +631,14 @@ func SetupRoutes(api *gin.RouterGroup, db *gorm.DB) {
|
||||
api.GET("/sweepstakes/current", sweepstakesController.GetCurrent)
|
||||
api.GET("/sweepstakes/:id/visual", sweepstakesController.PublicVisualData)
|
||||
|
||||
api.GET("/polls", pollController.GetPolls)
|
||||
api.GET("/polls/:id", pollController.GetPoll)
|
||||
api.POST("/polls/:id/vote", middleware.RateLimit(10, time.Minute), pollController.Vote)
|
||||
api.GET("/polls/:id/results", pollController.GetPollResults)
|
||||
pollsPub := api.Group("/polls")
|
||||
pollsPub.Use(middleware.JWTOptional(db))
|
||||
{
|
||||
pollsPub.GET("", pollController.GetPolls)
|
||||
pollsPub.GET("/:id", pollController.GetPoll)
|
||||
pollsPub.POST("/:id/vote", middleware.RateLimit(10, time.Minute), pollController.Vote)
|
||||
pollsPub.GET("/:id/results", pollController.GetPollResults)
|
||||
}
|
||||
|
||||
api.POST("/contact", middleware.RateLimit(10, time.Minute), contactController.SubmitContactForm)
|
||||
api.POST("/newsletter/subscribe", middleware.RateLimit(30, time.Minute), contactController.SubscribeToNewsletter)
|
||||
|
||||
Reference in New Issue
Block a user