# 6.4 小结

* Spring MVC 可以创建端点，控制器遵循与以浏览器为目标的控制器相同的编程模型。
* 控制器处理程序方法可以使用 @ResponseBody 进行注解，也可以返回 ResponseEntity 对象，从而绕过模型，直接将数据写入响应体。
* @RestController 注解简化了 REST 控制器，无需在处理程序方法上使用 @ResponseBody。
* Spring HATEOAS 启用了能够从 Spring MVC 控制器返回的资源的超链接。
* Spring Data 存储仓库可以使用 Spring Data REST 自动公开为 REST API。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://potoyang.gitbook.io/spring-in-action-v5/di-6-zhang-chuang-jian-rest-fu-wu/6.4-xiao-jie.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
