申明路由器函数报错
如下,申明RouterFunction路由器函数时报错,信息是cannot resolve symbol RouterFunction,请问有大神知道为什么吗? public RouterFunction<ServletResponse> personFindAll(UserRepository userRepository){ Collection<User> users = userRepository.findAll(); }
如下,申明RouterFunction路由器函数时报错,信息是cannot resolve symbol RouterFunction,请问有大神知道为什么吗? public RouterFunction<ServletResponse> personFindAll(UserRepository userRepository){ Collection<User> users = userRepository.findAll(); }
2019-01-07
@Bean @Autowired //方法注入 public RouterFunction<ServerResponse> personFindAll(UserRepository userRepository){ return RouterFunctions.route(RequestPredicates.GET("/person/find/all"), request ->{ Collection<User> users = userRepository.findAll(); Flux<User> userFlux = Flux.fromIterable(users); return ServerResponse.ok().body(userFlux,User.class); }); }
参考对比一下这个
举报