由于@AutoWired 告诉应用程序上下文在此处注入 UserService 的实例,是否需要 UserController 构造函数?
@Autowired
private UserService service;
public UserController(UserService service) {
this.service = service;
}
由于@AutoWired 告诉应用程序上下文在此处注入 UserService 的实例,是否需要 UserController 构造函数?
@Autowired
private UserService service;
public UserController(UserService service) {
this.service = service;
}