-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
怎么添加HandlerFunc #11
Labels
good first issue
Good for newcomers
Comments
路有前? 这个框架主要帮助用户绑定对象。不用手动解析。不影响实际gin本身的框架逻辑。是gin框架的补充。 |
r := gin.New() |
r := gin.New()
apipath := r.Group("/api")
account := apipath.Group("/account")
account.Use(jwt.JWT())
{
base.Register(r, new(api.Account))
// account.GET("/profile", api.Profile)
// account.GET("/menu", api.Menu)
}
// ginrpc
base := ginrpc.New()
// router := gin.Default()
base.Register(r, new(Hello)) // object register like(go-micro)
r.POST("/test6", base.HandlerFunc(TestFun6)) // function register
base.RegisterHandlerFunc(r, []string{"post", "get"}, "/test", TestFun6)
r.Run(":8080") 这样的吧? ginrpc 主要监听:gin.Engine |
这个问题似乎存在。我这两天更新一下。 |
是的,我会非常迅速加进去的。感谢使用及提问 |
看了下应该很好解决:需要将ginrpc里面的 *gin.Engine 定义改成 gin.IRouter 定义就可以兼容两者了 |
代码已更新 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
怎么添加路由前的管道HandlerFunc?
The text was updated successfully, but these errors were encountered: