Skip to content

Commit 30c23ac

Browse files
authored
docs: typo in controller and quick guide (#4599)
1 parent f8c63df commit 30c23ac

5 files changed

Lines changed: 17 additions & 17 deletions

File tree

site/docs/controller.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,12 @@ import { Controller, Post, Body } from '@midwayjs/core';
296296
export class UserController {
297297
@Post('/')
298298
async updateUser(@Body('uid') uid: string): Promise<User> {
299-
// id 等价于 ctx.request.body.uid
299+
// uid 等价于 ctx.request.body.uid
300300
}
301301
}
302302
```
303303

304-
**示例:获取整个 body **
304+
**示例:获取整个 body**
305305

306306
```typescript
307307
// src/controller/user.ts
@@ -933,7 +933,7 @@ import { Context } from '@midwayjs/koa';
933933
export class HomeController {
934934
@Inject()
935935
ctx: Context;
936-
936+
937937
@Get('/')
938938
async home() {
939939
this.ctx.status = 200;
@@ -942,7 +942,7 @@ export class HomeController {
942942
await sleep(100);
943943
this.ctx.res.write('abc'.repeat(100));
944944
}
945-
945+
946946
this.ctx.res.end();
947947
}
948948
}
@@ -958,7 +958,7 @@ export class HomeController {
958958

959959
## 内部重定向
960960

961-
从 v3.12.0 开始,框架提供了一个内部重定向 API `ctx.forward(url)`,仅支持 koa/egg 类型。
961+
从 v3.12.0 开始,框架提供了一个内部重定向 API `ctx.forward(url)`,仅支持 koa/egg 类型。
962962

963963
和外部重定向不同的地方在于,内部重定向不会修改浏览器的 URL,只在程序内部流转。
964964

@@ -974,7 +974,7 @@ export class HomeController {
974974
async home() {
975975
return this.ctx.forward('/api');
976976
}
977-
977+
978978
@Get('/api')
979979
async api() {
980980
return 'abc';

site/docs/quick_guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ export class MainConfiguration {
463463
import {
464464
Mock,
465465
ISimulation,
466-
App,
466+
MainApp,
467467
Inject,
468468
IMidwayApplication,
469469
MidwayMockService,
@@ -472,7 +472,7 @@ import { WeatherService } from '../service/weather.service';
472472

473473
@Mock()
474474
export class WeatherDataMock implements ISimulation {
475-
@App()
475+
@MainApp()
476476
app: IMidwayApplication;
477477

478478
@Inject()

site/i18n/en/docusaurus-plugin-content-docs/current/quick_guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ We need to create a `src/mock/data.mock.ts` file with the following content:
464464
import {
465465
Mock,
466466
ISimulation,
467-
apps,
467+
MainApp,
468468
Inject,
469469
IMidwayApplication,
470470
MidwayMockService,
@@ -473,7 +473,7 @@ import { WeatherService } from '../service/weather.service';
473473

474474
@Mock()
475475
export class WeatherDataMock implements ISimulation {
476-
@App()
476+
@MainApp()
477477
app: IMidwayApplication;
478478

479479
@Inject()

site/i18n/en/docusaurus-plugin-content-docs/version-3.0.0/quick_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ We need to create a `src/mock/data.mock.ts` file with the following content:
464464
import {
465465
Mock,
466466
ISimulation,
467-
apps,
467+
App,
468468
Inject,
469469
IMidwayApplication,
470470
MidwayMockService,

site/versioned_docs/version-3.0.0/controller.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,12 @@ import { Controller, Post, Body } from '@midwayjs/core';
292292
export class UserController {
293293
@Post('/')
294294
async updateUser(@Body('uid') uid: string): Promise<User> {
295-
// id 等价于 ctx.request.body.uid
295+
// uid 等价于 ctx.request.body.uid
296296
}
297297
}
298298
```
299299

300-
**示例:获取整个 body **
300+
**示例:获取整个 body**
301301

302302
```typescript
303303
// src/controller/user.ts
@@ -960,7 +960,7 @@ import { Context } from '@midwayjs/koa';
960960
export class HomeController {
961961
@Inject()
962962
ctx: Context;
963-
963+
964964
@Get('/')
965965
async home() {
966966
this.ctx.status = 200;
@@ -969,7 +969,7 @@ export class HomeController {
969969
await sleep(100);
970970
this.ctx.res.write('abc'.repeat(100));
971971
}
972-
972+
973973
this.ctx.res.end();
974974
}
975975
}
@@ -985,7 +985,7 @@ export class HomeController {
985985

986986
## 内部重定向
987987

988-
从 v3.12.0 开始,框架提供了一个内部重定向 API `ctx.forward(url)`,仅支持 koa/egg 类型。
988+
从 v3.12.0 开始,框架提供了一个内部重定向 API `ctx.forward(url)`,仅支持 koa/egg 类型。
989989

990990
和外部重定向不同的地方在于,内部重定向不会修改浏览器的 URL,只在程序内部流转。
991991

@@ -1001,7 +1001,7 @@ export class HomeController {
10011001
async home() {
10021002
return this.ctx.forward('/api');
10031003
}
1004-
1004+
10051005
@Get('/api')
10061006
async api() {
10071007
return 'abc';

0 commit comments

Comments
 (0)