Files
full/module/base/logs/internal/routers/register.go

30 lines
703 B
Go

package routers
import (
"fmt"
"bsm/full/module/base/logs/internal/logic/hello"
"bsm/full/module/base/logs/internal/logic/log"
"github.com/gin-gonic/gin"
)
func Register(srvKey string, engine *gin.Engine) {
v1_key := fmt.Sprintf("/%s/%s", srvKey, "v1")
registerAnonymous(v1_key, engine)
}
// registerAnonymous 不需要auth的接口
func registerAnonymous(v1_key string, engine *gin.Engine) {
// Anonymous router.
fmt.Println(v1_key)
anonymous := engine.Group(v1_key)
{
// anonymous.Use(middleware.JwtAuth(impl.RedisCache))
anonymous.GET("/ping", hello.Ping)
anonymous.POST("/create", log.Create)
anonymous.POST("/fetch", log.LogFetch)
anonymous.POST("/total", log.Total)
}
}