title: How to dynamically disable specific API in spring?
body: <p>I have a flag <code>DISABLE_FLAG</code> and I want to use it to control multiple specific APIs in different controllers.</p>
  
  <pre><code>@RestController
  public final class Controller1 {
      @RequestMapping(value = "/foo1", method = RequestMethod.POST)
      public String foo1()
  }
  @RestController
  public final class Controller2 {
      @RequestMapping(value = "/foo2", method = RequestMethod.POST)
      public String foo2()
  }
  </code></pre>
  
  <p>I can use an interceptor to handle all the urls. Is there a easy way to do that like annotation?</p>