You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shenyu.apache.org by 李克国 <li...@163.com> on 2021/12/20 06:28:01 UTC

feature:Optimize [shenyu-client-springmvc] metadata registration logic

Before: client register metadata
Used  @ShenyuSpringMvcClient#path. 
eg:
@RequestMapping("shenyu/client/hello")
@ShenyuSpringMvcClient(path = "shenyu/client/hello", desc = "shenyu client annotation register")
public String hello() {
return "hello! " + HELLO_SUFFIX;
}
It @RequestMapping#path is same.
I will support using @RequestMapping to follow the solution to get some metadata.
After:client register metadata.
@PostMapping("shenyu/client/post/hi")
@ShenyuSpringMvcClient(desc = "shenyu client annotation register")
public String post(final String name) {
return "[post method result]:hi! " + name + "! " + HELLO_SUFFIX;
}
I will get the metadata from @ShenyuSpringMvcClient first, if not, then get the metadata from @XXXMapping.
This compatibility preserves the compatibility of previous versions and can simplify the writing of future versions.






Re: feature:Optimize [shenyu-client-springmvc] metadata registration logic

Posted by XiaoYu <xi...@apache.org>.
it good job~

李克国 <li...@163.com> 于2021年12月20日周一 14:28写道:
>
> Before: client register metadata
> Used  @ShenyuSpringMvcClient#path.
> eg:
> @RequestMapping("shenyu/client/hello")
> @ShenyuSpringMvcClient(path = "shenyu/client/hello", desc = "shenyu client annotation register")
> public String hello() {
> return "hello! " + HELLO_SUFFIX;
> }
> It @RequestMapping#path is same.
> I will support using @RequestMapping to follow the solution to get some metadata.
> After:client register metadata.
> @PostMapping("shenyu/client/post/hi")
> @ShenyuSpringMvcClient(desc = "shenyu client annotation register")
> public String post(final String name) {
> return "[post method result]:hi! " + name + "! " + HELLO_SUFFIX;
> }
> I will get the metadata from @ShenyuSpringMvcClient first, if not, then get the metadata from @XXXMapping.
> This compatibility preserves the compatibility of previous versions and can simplify the writing of future versions.
>
>
>
>
>