-
Notifications
You must be signed in to change notification settings - Fork 469
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
是否支持在定义路由方法前后自定义前置方法或后置方法 #906
Comments
这个需求倒是合理,不过请问用户故事是什么,以及为何handler chain设计无法满足需求。 |
监控、调用次数统计、日志等系统功能代码与业务代码解耦,类似JAVA AOP |
https://go-chassis.readthedocs.io/en/latest/middleware.html 那这个设计我理解完全满足你的这些场景 |
2位是否还有疑问,是否有其他的用户故事 handler chain无法满足 |
看了这个设计,其实并不能满足我们的需求。这个是框架级别的AOP。 |
Anyway,感谢你的耐心解答! |
@Reese1995 你可以设计一个这样的方案,合入到go chassis,这种重大特性足以让你成为go chassis的维护者。 相对于spring 的 aop,由于go没有注解,所以得通过配置文件的方式声明一些方法的切面处理方式 |
其实将go-restful router 的Filter 放出来即可。这样业务可以完成
|
在后续的多样的restful框架集成中,我们都遵循原生的写法了gin-go,还有go-fiber |
在Sayhello方法前后自定义前置方法和后置方法
https://go-chassis.readthedocs.io/en/latest/getstarted/writing-rest.html
The text was updated successfully, but these errors were encountered: