Skip to content
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

method宏是否需要数据注入,如/test/1212/api,提供参数获取1212数据 #54

Open
Yangandmore opened this issue Jun 26, 2022 · 7 comments
Assignees

Comments

@Yangandmore
Copy link
Contributor

No description provided.

@Yangandmore Yangandmore self-assigned this Jun 26, 2022
@Jzow
Copy link
Member

Jzow commented Jun 27, 2022

数据注入 目前最大化能做到哪种程度

@Yangandmore
Copy link
Contributor Author

目前还没开始,主要是针对,/test/:user/add,这样的user数据获取,然后在get(“url”)的宏下做好数据补充,就可以在标注宏的函数下使用

@Yangandmore
Copy link
Contributor Author

但是目前主要是需要一个方案实现这样的功能

@Jzow
Copy link
Member

Jzow commented Jun 27, 2022

但是目前主要是需要一个方案实现这样的功能

我提议meetup, back-end team 大家过一下,不然他们不知道我们这么做的目的

@Yangandmore
Copy link
Contributor Author

这个没有问题,过一下是好的,但是目前summer-boot下面的url配置已经完成了这样的做法,已经运行提供
/test/:user/add,那么如果我在正常使用该url下的接口函数,我该如何去在request中找到这个user数据呢?

@Jzow Jzow pinned this issue Jun 27, 2022
@Jzow
Copy link
Member

Jzow commented Jun 27, 2022

我该如何去在request中找到这个user数据呢?

你需要从request中通过body_from表单,或者body_json json数据,body_string 字符串数据,body_bytes 目前不太稳定,它得从缓冲区拿数据,如果上传文件 我没有从这里做足够多的单元测试

@Jzow
Copy link
Member

Jzow commented Jun 27, 2022

在拿取数据的前一步使用http_types 可以获取header的请求数据格式 然后通过match调用 body_json 或 body_string

@Jzow Jzow unpinned this issue Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants