简体   繁体   中英

How to Enable/Disable specific rest end point in spring boot?

I have tried to using @ConditionalOnProperty for disable/enable the spring boot endpoint, but its not working as expected. I want to disable/enable specific end points based on conditional values not the entire controller.

Extract those methods to a new Controller. Then add the @ConditionalOnProperty to that Controller.

@ConditionalOnProperty works for @Bean, @Controller, @Service, ... objects, not for methods.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM