feat: add announcement feature with admin management and home page display
Build and Push Docker Image / build-and-push (push) Successful in 1m3s
Build and Push Docker Image / deploy (push) Successful in 7s

This commit is contained in:
nuyue
2026-07-16 15:28:37 +08:00
parent c94641cda0
commit 43009ec3b9
9 changed files with 426 additions and 5 deletions
+11
View File
@@ -28,6 +28,7 @@ func SetupRoutes(r *gin.Engine) {
logHandler := handlers.NewLogHandler()
purchaseGroupHandler := handlers.NewPurchaseGroupHandler()
shippingTemplateHandler := handlers.NewShippingTemplateHandler()
announcementHandler := handlers.NewAnnouncementHandler()
r.Use(middlewares.CORSMiddleware())
@@ -62,6 +63,7 @@ func SetupRoutes(r *gin.Engine) {
}
api.GET("/banners", bannerHandler.List)
api.GET("/announcements", announcementHandler.List)
api.GET("/categories", categoryHandler.List)
api.GET("/brands", brandHandler.List)
@@ -262,6 +264,15 @@ func SetupRoutes(r *gin.Engine) {
adminShippingTemplates.PUT("/:id", shippingTemplateHandler.Update)
adminShippingTemplates.DELETE("/:id", shippingTemplateHandler.Delete)
}
adminAnnouncements := admin.Group("/announcements")
{
adminAnnouncements.GET("", announcementHandler.AdminList)
adminAnnouncements.POST("", announcementHandler.Create)
adminAnnouncements.PUT("/:id", announcementHandler.Update)
adminAnnouncements.DELETE("/:id", announcementHandler.Delete)
adminAnnouncements.PUT("/:id/toggle", announcementHandler.ToggleActive)
}
}
}
}