mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
38f0cf1ed2
[Fixes #48658503]
24 lines
259 B
Groovy
24 lines
259 B
Groovy
@Controller
|
|
class Example {
|
|
|
|
@Autowired
|
|
private MyService myService;
|
|
|
|
@RequestMapping("/")
|
|
@ResponseBody
|
|
public String helloWorld() {
|
|
return myService.sayWorld();
|
|
}
|
|
|
|
}
|
|
|
|
@Service
|
|
class MyService {
|
|
|
|
public String sayWorld() {
|
|
return "World!";
|
|
}
|
|
}
|
|
|
|
|