@eggjs/tegg-controller-plugin 1.3.1 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/package.json +4 -5
- package/CHANGELOG.md +0 -16
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -42,6 +42,7 @@ exports.teggController = {
|
|
|
42
42
|
## Usage
|
|
43
43
|
|
|
44
44
|
### Middleware
|
|
45
|
+
Middleware 支持多个入参,依次传入要生效的中间件
|
|
45
46
|
中间件注解,可以添加在类/方法上。添加在类上时,对类上所有方法生效,添加在方法上时,只对当前方法生效。
|
|
46
47
|
|
|
47
48
|
```ts
|
|
@@ -53,13 +54,17 @@ export default async function globalLog(ctx: Context, next: any) {
|
|
|
53
54
|
return next();
|
|
54
55
|
}
|
|
55
56
|
|
|
57
|
+
export default async function globalLog2(ctx: Context, next: any) {
|
|
58
|
+
ctx.logger.info('have a request2');
|
|
59
|
+
return next();
|
|
60
|
+
}
|
|
61
|
+
|
|
56
62
|
// app/controller/FooController.ts
|
|
57
63
|
import { Middleware } from '@eggjs/tegg';
|
|
58
|
-
|
|
59
|
-
@Middleware(globalLog)
|
|
64
|
+
@Middleware(globalLog,globalLog2)
|
|
60
65
|
export class FooController {
|
|
61
|
-
|
|
62
66
|
@Middleware(methodCount)
|
|
67
|
+
|
|
63
68
|
async hello() {
|
|
64
69
|
}
|
|
65
70
|
}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"tegg"
|
|
8
8
|
]
|
|
9
9
|
},
|
|
10
|
-
"version": "1.
|
|
10
|
+
"version": "1.4.1",
|
|
11
11
|
"description": "controller decorator for egg",
|
|
12
12
|
"keywords": [
|
|
13
13
|
"egg",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@eggjs/egg-module-common": "^1.0.0",
|
|
50
|
-
"@eggjs/tegg": "^1.3.
|
|
50
|
+
"@eggjs/tegg": "^1.3.4",
|
|
51
51
|
"@eggjs/tegg-common-util": "^1.1.1",
|
|
52
52
|
"@eggjs/tegg-loader": "^1.3.0",
|
|
53
53
|
"@eggjs/tegg-metadata": "^1.3.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@eggjs/module-test-util": "^1.3.0",
|
|
62
62
|
"@eggjs/router": "^2.0.0",
|
|
63
63
|
"@eggjs/tegg-config": "^1.1.1",
|
|
64
|
-
"@eggjs/tegg-plugin": "^1.3.
|
|
64
|
+
"@eggjs/tegg-plugin": "^1.3.5",
|
|
65
65
|
"egg": "^2.26.0",
|
|
66
66
|
"egg-mock": "^3.25.1",
|
|
67
67
|
"egg-tracer": "^1.1.0",
|
|
@@ -69,6 +69,5 @@
|
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
|
-
}
|
|
73
|
-
"gitHead": "f387ec87692607ac61e4fd40871f3694ca373993"
|
|
72
|
+
}
|
|
74
73
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
# [1.3.0](https://github.com/eggjs/tegg/compare/v1.2.0...v1.3.0) (2022-07-01)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @eggjs/tegg-controller-plugin
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# [0.2.0](https://github.com/eggjs/tegg/compare/v0.1.19...v0.2.0) (2022-01-20)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @eggjs/tegg-controller-plugin
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017-present Alibaba Group Holding Limited and other contributors.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|