package routers

import (
	"fmt"

	"bsm/full/module/base/fts/internal/logic"
	"github.com/gin-gonic/gin"
	swaggerfiles "github.com/swaggo/files"
	ginSwagger "github.com/swaggo/gin-swagger"
)

func Register(srvKey string, engine *gin.Engine) {
	v1_key := fmt.Sprintf("/%s/%s", srvKey, "v1")
	registerAnonymous(v1_key, engine)
	registerUploader(v1_key, engine)
}

// registerAnonymous  不需要auth的接口
func registerAnonymous(v1_key string, engine *gin.Engine) {
	// Anonymous router.
	anonymous := engine.Group(v1_key)
	{
		anonymous.GET("/ping", logic.Ping)
		anonymous.GET("/config", logic.Config)
		anonymous.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler)) // 文档

	}
}
