mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(server): register IP ban routes in admin group
Initialize the IP ban service and handler, and wire up the CRUD endpoints to the admin router group.
This commit is contained in:
@@ -233,6 +233,8 @@ func main() {
|
||||
internalHandler := api.NewInternalHandler(db)
|
||||
featureHandler := api.NewFeatureHandler(rdb)
|
||||
authHandler := api.NewAuthHandler(db, rdb, adminService, masterService)
|
||||
ipBanService := service.NewIPBanService(db, rdb)
|
||||
ipBanHandler := api.NewIPBanHandler(ipBanService)
|
||||
modelRegistryService := service.NewModelRegistryService(db, rdb, service.ModelRegistryConfig{
|
||||
Enabled: cfg.ModelRegistry.Enabled,
|
||||
RefreshEvery: time.Duration(cfg.ModelRegistry.RefreshSeconds) * time.Second,
|
||||
@@ -391,6 +393,12 @@ func main() {
|
||||
adminGroup.DELETE("/bindings/:id", handler.DeleteBinding)
|
||||
adminGroup.POST("/bindings/batch", handler.BatchBindings)
|
||||
adminGroup.POST("/sync/snapshot", handler.SyncSnapshot)
|
||||
// IP Ban routes
|
||||
adminGroup.POST("/ip-bans", ipBanHandler.Create)
|
||||
adminGroup.GET("/ip-bans", ipBanHandler.List)
|
||||
adminGroup.GET("/ip-bans/:id", ipBanHandler.Get)
|
||||
adminGroup.PUT("/ip-bans/:id", ipBanHandler.Update)
|
||||
adminGroup.DELETE("/ip-bans/:id", ipBanHandler.Delete)
|
||||
}
|
||||
|
||||
// Master Routes
|
||||
|
||||
Reference in New Issue
Block a user