deving
This commit is contained in:
37
internal/routers/register.go
Normal file
37
internal/routers/register.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/middleware"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/application"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/hello"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/permission"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/pub"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/role"
|
||||
"git.apinb.com/pro/rbac2/internal/logic/user"
|
||||
"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) {
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user