How to Solve @Autowired error with Red Wavy Line

When using springboot’s @Autowired injection, a red wavy line appears. The interface after Alt + enter is as follows

The solution is: add (required = false) after @Autowired, and the red wavy line will disappear

@Autowired(required = false)

Read More: