-
Notifications
You must be signed in to change notification settings - Fork 211
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
Action类是通过实现WorkAction接口的execute()方法来实现路由的,这样一个类只能实现一个路由,实际使用起来未必会有点麻烦吧
Describe the solution you'd like
如果能够像spring mvc那样一个controller下可以有多个RequestMapping就比较好吧。
Describe alternatives you've considered
Action类不用实现WorkAction接口,直接扫描所有被@CicadaAction注解的类,然后再反射获取这个类中被@CicadaExcute注解的方法(我看到有@CicadaExcute这个注解,但没有被使用,是否是准备用于这方面的?),再反射调用这个方法。
不过这样的话就是比较难约束用户对于被@CicadaExcute注解的方法传入的参数,我想到有两种方式约束:
- 约束必须传入且只能传入
CicadaContext和Param,否则就抛出异常 - 可以任意传入参数,如果检查到有
CicadaContext或Param就在invoke的时候传进去,如果没有就不传,如果有其他参数就传null值。