直接创建不选择web下的springweb直接创建
之后在启动类的同级下创建项目service和实现类通过@Service交个spring容器,
public static void main(String[] args) {
ConfigurableApplicationContext application = SpringApplication.run(Application.class, args);
StudentService studentService = (StudentService) application.getBean("studentServiceImpl");
String sayHello = studentService.sayHello();
System.out.println(sayHello);
}
'
在启动类中,即可调用