Annotation Interface ApiFindController


@Retention(RUNTIME) @Target(TYPE) @RestController public @interface ApiFindController
Marks an interface as a dynamic REST controller whose methods are intercepted at runtime by the proxy-api-controller framework.

Interfaces annotated with @ApiFindController are registered as Spring beans through a Java dynamic proxy (Proxy). Each method call is handled by ApiFindInterceptor, which resolves the target JpaService, builds the QueryParameter, and returns the mapped results.

This annotation is meta-annotated with RestController, so Spring picks up the proxied bean as a standard REST controller and maps its @RequestMapping endpoints automatically.

Typical usage


 @ApiFindController
 @ApiFind(entity = Order.class, id = Long.class)
 @RequestMapping("/api/orders")
 public interface OrderController {

     @PostMapping("/search")
     @ApiMapper(value = OrderMapper.class, method = "toDto")
     List<OrderDto> search(@RequestBody OrderFilter filter);
 }
 
Author:
Francesco Baldi
See Also: