Files
stock/internal/routers/register.go
2026-01-13 13:23:54 +08:00

31 lines
628 B
Go

package routers
import (
"fmt"
"git.apinb.com/dataset/stock/internal/logic/hello"
"github.com/gin-gonic/gin"
)
// 完成请求地址: ip:port/srvKey/v1/group/xxx
func Register(srvKey string, engine *gin.Engine) {
v1_key := fmt.Sprintf("/%s/%s", srvKey, "v1")
registerAnonymous(v1_key, engine)
registerRouters(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.GET("/ping", hello.Ping)
}
}
func registerRouters(v1_key string, engine *gin.Engine) {
}