Feign inheritance support

We can also inherit interfaces to avoid boilerplate code for the same type of services. Feign allows grouping common operations into convenient base interfaces. Let's see the following example:

@FeignClient(name="account-service") 
public interface AccountService { 
    
   @GetMapping(value = "/account/customer/{customer}") 
   List<Account> findByCutomer (@PathVariable("customer") Integer 
customer); ... }

We can inherit this interface in the creation of another FeignClient service:

@FeignClient("users") 
public interface AdminAccountService extends AccountService { 
    
   ... 
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.240.252