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
Added custom object support for controller parameters in http-server. #321
Added custom object support for controller parameters in http-server. #321
Conversation
这个修改为后面 jsonrpc-http 增加参数识别。同时也可以基于这个实现类似 spring mvc 中 @ModelAttribute 功能
a61ec32
to
f70b882
Compare
@wenbinye 这个 PR 能提供一下供我测试的 Demo 吗?或者提供解决的场景 |
在 jsonrpc 有实际用途,目前 http 的参数都是从路由上得到,都是简单参数,用不上 |
JSONRPC 上的用途场景可以描述一下吗? |
以下面这个服务为例: interface CalculatorServiceInterface
{
/**
* @param Integer[] $a
* @return Integer
*/
public function squareSum(array $a): Integer;
} 其中 Integer 类如下: class Integer
{
/**
* @var int
*/
public $value;
} jsonrpc 传入的参数是: [{"value":3},{"value":4}] 对于 CalculatorServiceInterface 的实现接收到的参数就是 Integer 类的示例构成的数组。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@huangzhhui 有时间看一下,我这边觉得 OK 了。
这个修改为后面 jsonrpc-http 增加参数识别。同时也可以基于这个实现类似
spring mvc 中 @ModelAttribute 功能