/** * Build parameter pair. * this is Resolve http body to get sofa param. * * @param body the body * @param parameterTypes the parameter types * @return the pair */ Pair<String[], Object[]> buildParameter(String body, String parameterTypes); }
body为http中body传的json字符串。
parameterTypes: 匹配到的方法参数类型列表,如果有多个,则使用,分割。
Pair中,left为参数类型,right为参数值,这是sofa泛化调用的标准。
把你的类注册成Spring的bean,覆盖默认的实现。
1 2 3 4
@Bean public SofaParamResolveService A() { return new A(); }