推荐 最新
感觉对了

spring shell component 无法使用 autowired 注入?

@ShellComponent public class SeederCommand extends Command { @Autowired private UserRepository userRepository; @ShellMethod(key = {"seed"}, value = "数据填充方法") public void run() { System.out.println(new Gson().toJson(this.userRepository.findAll())); } } 提示 "userRepository" 是 "null"。报错

0
1
0
浏览量15