You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
271 B
Groovy
24 lines
271 B
Groovy
12 years ago
|
package org.test
|
||
|
|
||
12 years ago
|
@Component
|
||
12 years ago
|
class Example implements CommandLineRunner {
|
||
12 years ago
|
|
||
12 years ago
|
@Autowired
|
||
12 years ago
|
private MyService myService
|
||
12 years ago
|
|
||
12 years ago
|
void run(String... args) {
|
||
|
print "Hello " + this.myService.sayWorld()
|
||
12 years ago
|
}
|
||
|
}
|
||
|
|
||
|
|
||
12 years ago
|
@Service
|
||
12 years ago
|
class MyService {
|
||
|
|
||
12 years ago
|
String sayWorld() {
|
||
|
return "World!"
|
||
12 years ago
|
}
|
||
|
}
|
||
|
|
||
|
|