package routes

import (
	"github.com/gofiber/fiber/v2"

	"github.com/break/junhong_cmp_fiber/internal/bootstrap"
	"github.com/break/junhong_cmp_fiber/pkg/openapi"
)

// RegisterH5Routes 注册H5相关路由
func RegisterH5Routes(router fiber.Router, handlers *bootstrap.Handlers, middlewares *bootstrap.Middlewares, doc *openapi.Generator, basePath string) {
	// 认证路由已迁移到 /api/auth，参见 RegisterAuthRoutes
	authGroup := router.Group("", middlewares.H5Auth)

	if handlers.H5Order != nil {
		registerH5OrderRoutes(authGroup, handlers.H5Order, doc, basePath)
	}
	if handlers.H5Recharge != nil {
		registerH5RechargeRoutes(authGroup, handlers.H5Recharge, doc, basePath)
	}
	if handlers.EnterpriseDeviceH5 != nil {
		registerH5EnterpriseDeviceRoutes(authGroup, handlers.EnterpriseDeviceH5, doc, basePath)
	}
}
