# 示例:参数验证和业务分离

查看这两个视频

&#x20;[参数验证和业务分离（上）](http://www.jtthink.com/course/play/2797)

&#x20;[参数验证和业务分离（下）](http://www.jtthink.com/course/play/2798)

使用路由级中间件做统一验证。控制器的代码无脑取参数，不需要再写验证


---

# 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://65480539.gitbook.io/goft/lu-you-ji-zhong-jian-jian/shi-li-can-shu-yan-zheng-he-ye-wu-fen-li.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.
