Coder Social home page Coder Social logo

Comments (6)

crossoverJie avatar crossoverJie commented on July 16, 2024

@zzzzbw

哈哈 是的。

@CicadaExcute 是之前预留的。

在上篇文章中有写到后续会有这个更新。

from cicada.

zzzzbw avatar zzzzbw commented on July 16, 2024

@crossoverJie
哈哈,竟然被我提前说出来了。
不过我还是比较想了解对于方法传参你准备怎么处理的?
之前我也写了一个mvc框架,感觉上面提到的两个方式都不是很好。

from cicada.

crossoverJie avatar crossoverJie commented on July 16, 2024

@zzzzbw

现在已经有一个大概的思路。其中的参数传递可以是自定义的 pojo,比如:

    @CicadaExcute("get")
    public void get(CicadaContext context,User user){
        context.json(user);
    }

甚至 CicadaContext context 也可以不要,毕竟这个上下文可以在一次请求的任意一个地方获取。

同时也可以在参数中使用 Cicada 预设的 CicadaRequest、CicadaResponse、CicadaCookie 等。

只需要在路由过程中将数据反射写入具体的参数即可。

from cicada.

zzzzbw avatar zzzzbw commented on July 16, 2024

谢谢你的解答,期待其实现

from cicada.

cjqCN avatar cjqCN commented on July 16, 2024

@crossoverJie
自定义pojo的话,我觉得可以通过不同的注解到path、header、param或者content取值

from cicada.

crossoverJie avatar crossoverJie commented on July 16, 2024

@cjqCN

嗯,实现都是一样的。只是注解可读性更强。

from cicada.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.