[WeOpen-Star] Add simpler client annotations with @AliasFor
See original GitHub issueHow to Participation
- reply: [WeOpen Star]I would like to help
- add this wechat. note : 摘星

Description
As a downstream of https://github.com/apache/shenyu/issues/3485, this task needs you to add(do not delete any existing annotations) more simpler client annotations.
For example, below is how we use client annotation now:
@RestController
@RequestMapping("/order")
@ShenyuSpringCloudClient("/order")
public class OrderController {
@PostMapping("/save")
@ShenyuSpringCloudClient("/save")
public OrderDTO save(@RequestBody final OrderDTO orderDTO) {
orderDTO.setName("hello world spring cloud save order");
return orderDTO;
}
}
Does it seem a little repetitive? We can realize combined annotation through @AliasFor and org.springframework.core.annotation.AnnotatedElementUtils#findMergedAnnotation.
Notice: the newly added annotation needs to be compatible with all functions of other frameworks !
Use simplified annotations like below:
@RestController
@ShenyuRequestMapping("/order")
public class OrderController {
@ShenyuPostMapping("/save")
public OrderDTO save(@RequestBody final OrderDTO orderDTO) {
orderDTO.setName("hello world spring cloud save order");
return orderDTO;
}
}
You are welcome to make suggestions !
Task List
-
- add
@ShenyuRequestMapping,@ShenyuGetMapping,@ShenyuPostMapping,@ShenyuPutMapping,@ShenyuDeleteMapping,@ShenyuPatchMappingforshenyu-client-springmvc; @ShawnJim
- add
-
- add
@ShenyuRequestMapping,@ShenyuGetMapping,@ShenyuPostMapping,@ShenyuPutMapping,@ShenyuDeleteMapping,@ShenyuPatchMappingforshenyu-client-springcloud; @ShawnJim
- add
-
- add
@ShenyuServiceforshenyu-client-alibaba-dubbo; @mangoGoForward
- add
-
- add
@ShenyuService,@ShenyuDubboServiceforshenyu-client-apache-dubbo; @mangoGoForward
- add
-
- add
@ShenyuMotanServiceforshenyu-client-motan; @runqi-zhao
- add
-
- add
@ShenyuTarsServantforshenyu-client-tars; @HeZean
- add
-
- add
@ShenyuServerEndpointforshenyu-client-websocket; @lahmXu
- add
How to contributor
You can see this : Contributor Guide
-
I suggest you subscribe to shenyu dev mailing list, and when you encounter any problems, or when you finish, you can send an email to dev@shenyu.apache.org
-
I suggest you git clone the source code and finish the changes. like this :
fork this to you repository : https://github.com/apache/shenyu.git
git clone git@github.com:${YOUR_USERNAME}/${TARGET_REPO}.git
git checkout -b a-dev-branch
git push origin a-dev-branch
Verification
After you modify file in verify local and you can see this : How to build shenyu .
After you pull request merged. You can verify to this : en-doc , zh-doc
Issue Analytics
- State:
- Created a year ago
- Comments:12 (10 by maintainers)

Top Related StackOverflow Question
Sorry for the delay, I’ll submit a PR today
Sorry for the delay, I’ll submit a PR today