用Kotlin建立一个Spring Boot项目

我开始了一个学习Kotlin的新项目,我在Spring Initializr中获得了一个项目模板,并创建了一个控制器来映射我的资源。

StudentController

@RestController class StudentController { @GetMapping("/students") fun getStudent(): Student { return Student("name", "test") } } 

应用

 @SpringBootApplication class DemoApplication fun main(args: Array) { SpringApplication.run(DemoApplication::class.java, *args) } 

application.properties

 debug=true 

我运行项目,当我发送GET请求到本地主机:8080 /学生,我收到了404。

 { "timestamp": 1501961340149, "status": 404, "error": "Not Found", "message": "No message available", "path": "/students" } 

我做错了什么?