Skip to content

Commit

Permalink
Merge pull request #392 from rookie-luochao/master
Browse files Browse the repository at this point in the history
fix(controllers.md): fix 文字重复错误
  • Loading branch information
zuohuadong authored Mar 30, 2024
2 parents f61a896 + f632804 commit 0528f5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 10/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ export class CatsController {

?> 为了在 `express` 中使用 `Typescript` (如 `request: Request` 上面的参数示例所示),请安装 `@types/express`

`Request` 对象代表 `HTTP` 请求,并具有查询字符串,请求参数参数,HTTP 标头(HTTP header) 和 正文(HTTP body)的属性(在[这里](https://expressjs.com/en/api.html#req)阅读更多)。在多数情况下,不必手动获取它们。 我们可以使用专用的装饰器,比如开箱即用的 `@Body()``@Query()` 。 下面是 Nest 提供的装饰器及其代表的底层平台特定对象的对照列表。
`Request` 对象代表 `HTTP` 请求,并具有查询字符串,请求参数,HTTP 标头(HTTP header) 和 正文(HTTP body)的属性(在[这里](https://expressjs.com/en/api.html#req)阅读更多)。在多数情况下,不必手动获取它们。 我们可以使用专用的装饰器,比如开箱即用的 `@Body()``@Query()` 。 下面是 Nest 提供的装饰器及其代表的底层平台特定对象的对照列表。

| | |
| ------------------------- | --------------------------------- |
| `@Request(),@Req()` | `req` |
| `@Response(),@Res()*` | `res` |
| `@Response(),@Res()` | `res` |
| `@Next()` | `next` |
| `@Session()` | `req.session` |
| `@Param(key?: string)` | `req.params`/`req.params[key]` |
Expand Down

0 comments on commit 0528f5d

Please sign in to comment.