Files
junhong_cmp_fiber/internal/routes/routes.go
huang d66323487b refactor: align framework cleanup with new bootstrap flow
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-11-19 12:47:25 +08:00

30 lines
662 B
Go

package routes
import (
"github.com/gofiber/fiber/v2"
"github.com/break/junhong_cmp_fiber/internal/bootstrap"
)
// RegisterRoutes 路由注册总入口
// 按业务模块调用各自的路由注册函数
func RegisterRoutes(app *fiber.App, handlers *bootstrap.Handlers) {
// API 路由组
api := app.Group("/api/v1")
// 注册各模块路由
registerHealthRoutes(app)
registerTaskRoutes(api)
// RBAC 路由
if handlers.Account != nil {
registerAccountRoutes(api, handlers.Account)
}
if handlers.Role != nil {
registerRoleRoutes(api, handlers.Role)
}
if handlers.Permission != nil {
registerPermissionRoutes(api, handlers.Permission)
}
}