mirror of
https://github.com/JeffLi1993/springboot-learning-example.git
synced 2026-03-14 06:03:52 +08:00
Spring Boot 入门、Spring Boot 配置、Web 开发、模板引擎、数据存储、数据缓存 案例更新
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package demo.springboot.web;
|
||||
|
||||
import demo.springboot.config.BookProperties;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* Spring Boot Hello案例
|
||||
*
|
||||
* Created by bysocket on 26/09/2017.
|
||||
*/
|
||||
@RestController
|
||||
public class HelloBookController {
|
||||
|
||||
@Autowired
|
||||
BookProperties bookProperties;
|
||||
|
||||
@GetMapping("/book/hello")
|
||||
public String sayHello() {
|
||||
return "Hello, " + bookProperties.getWriter() + " is writing "
|
||||
+ bookProperties.getName() + " !";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user