Comments (6)
哈哈 是的。
@CicadaExcute
是之前预留的。
在上篇文章中有写到后续会有这个更新。
from cicada.
@crossoverJie
哈哈,竟然被我提前说出来了。
不过我还是比较想了解对于方法传参你准备怎么处理的?
之前我也写了一个mvc框架,感觉上面提到的两个方式都不是很好。
from cicada.
现在已经有一个大概的思路。其中的参数传递可以是自定义的 pojo
,比如:
@CicadaExcute("get")
public void get(CicadaContext context,User user){
context.json(user);
}
甚至 CicadaContext context
也可以不要,毕竟这个上下文可以在一次请求的任意一个地方获取。
同时也可以在参数中使用 Cicada
预设的 CicadaRequest、CicadaResponse、CicadaCookie
等。
只需要在路由过程中将数据反射写入具体的参数即可。
from cicada.
谢谢你的解答,期待其实现
from cicada.
@crossoverJie
自定义pojo的话,我觉得可以通过不同的注解到path、header、param或者content取值
from cicada.
嗯,实现都是一样的。只是注解可读性更强。
from cicada.
Related Issues (20)
- 项目初始化阶段基于注解的扫描建议 HOT 3
- Chain of responsibility HOT 2
- 并发问题 HOT 5
- 如果包路径和项目的包路径一样,configurationList中会有相同的元素 HOT 2
- @Inteceptor order一样的话,会导致先前扫描到的interceptor 被覆盖 HOT 2
- Interceptor加载优化 HOT 2
- 读取配置文件的操作可否从action的execute里面抽离 HOT 1
- Got a null NullPointerException when APP starting! HOT 2
- ClassScanner$getCustomRouteBean获取IOC容器过程复杂 HOT 1
- 为啥不做彻底一点,直接通过注解实例化bean HOT 1
- HttpDispter使用单独的EventGroup? HOT 3
- Performance Test HOT 1
- HttpDispatcher.responseContent是不是在try中合适? HOT 5
- fastjson version need update HOT 1
- 群加不了呢? HOT 1
- RingBufferWheel 请问如何保证最后一个 Task 在 调用了 stop(false) 后还能被执行 HOT 1
- 初始化方法好像有点问题...
- Is it better to use ChannelFutureListener at the end of HttpDispatcher HOT 2
- 请问10w并发是怎么测试的,需要一些额外的设置吗
- 写了半天。。。最终发现除了get 其他的都拿不到参数.... HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cicada.