shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

is it necessary to annotate @ShenyuspringCloudClient in the Controller layer?

Open 65725738 opened this issue 3 years ago • 5 comments

Question

To use Shenyu, is it necessary to annotate @ShenyuspringCloudClient (path = "/save") in the Controller layer?

For example,

@PostMapping("/save")
@ShenyuSpringCloudClient(path = "/save")
public OrderDTO save(@RequestBody final OrderDTO orderDTO) {
    orderDTO.setName("hello world spring cloud save order");
    return orderDTO;
}

If so, Shenyu's code will invade the normal business system. Coupled to the code of the business service. If you want to change the gateway. I need to delete all the code.

65725738 avatar Oct 20 '21 02:10 65725738

Why not use conventions?

Run @requestMapping ("/order") @getMapping ("/path/{ID}/name") to obtain information about the service interface to be registered

65725738 avatar Oct 20 '21 02:10 65725738

Can you optimize? obtain information about the @RequestMapping

yu199195 avatar Oct 20 '21 03:10 yu199195

Can you optimize? obtain information about the @RequestMapping

I think that is a good idea by @RequestMapping or @GetMapping or @PostMapping,but how do I filter the APIs that I don't want? Without any conditional processing, all application APIs will be registered according to the @RequestMappingor @PostMapping or @GetMapping configuration.

qicz avatar Oct 23 '21 17:10 qicz

Can you optimize? obtain information about the @RequestMapping

I think that is a good idea by @RequestMapping or @GetMapping or @PostMapping,but how do I filter the APIs that I don't want? Without any conditional processing, all application APIs will be registered according to the @RequestMappingor @PostMapping or @GetMapping configuration.

Based on convention over configuration,Such as @ RequestMapping (" matching/oa / ") @ RequestMapping ("/don't match/oa/").

65725738 avatar Oct 29 '21 02:10 65725738

@65725738 How about @ShenyuRequestMapping , @ShenyuGetMapping and etc?

loongs-zhang avatar Aug 04 '22 14:08 loongs-zhang

you can easily configurate it in http://localhost:9095/#/config/metadata like: image

uncarbon97 avatar Nov 30 '22 03:11 uncarbon97