mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
* Use file adapters in sample instead of internal flow * Add Exception to signature of CommandLineRunner for implementation convenience * Updates for Security snapshots
24 lines
271 B
Groovy
24 lines
271 B
Groovy
package org.test
|
|
|
|
@Component
|
|
class Example implements CommandLineRunner {
|
|
|
|
@Autowired
|
|
private MyService myService
|
|
|
|
void run(String... args) {
|
|
print "Hello " + this.myService.sayWorld()
|
|
}
|
|
}
|
|
|
|
|
|
@Service
|
|
class MyService {
|
|
|
|
String sayWorld() {
|
|
return "World!"
|
|
}
|
|
}
|
|
|
|
|