Files
springboot-learning-example/chapter-2-spring-boot-config/src/main/java/demo/springboot/web/HelloBookController.java

25 lines
637 B
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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() + " ";
}
}