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

30 lines
707 B
Go
Raw Normal View History

package routers
import (
"fmt"
"git.apinb.com/bsm-apps/logs/internal/logic/hello"
"git.apinb.com/bsm-apps/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)
}
}