@fastcar/koa 0.1.11 → 0.1.13
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/index.d.ts +3 -0
- package/package.json +19 -7
- package/src/middleware/KoaMulter.ts +7 -0
- package/target/annotation.js +3 -1
- package/target/middleware/KoaMulter.js +8 -0
- package/test/logs/sys.log +42 -0
- package/test/simple/app.ts +3 -3
package/index.d.ts
CHANGED
|
@@ -60,4 +60,7 @@ export function KoaStatic(app: FastCarApplication): MiddleWareType;
|
|
|
60
60
|
//支持api说明
|
|
61
61
|
export function Swagger(app: FastCarApplication): MiddleWareType;
|
|
62
62
|
|
|
63
|
+
//增强multi文件解析
|
|
64
|
+
export function KoaMulter(app: FastCarApplication): MiddleWareType;
|
|
65
|
+
|
|
63
66
|
export * from "./src/type/DesignMeta";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastcar/koa",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"homepage": "https://github.com/williamDazhangyu/fast-car",
|
|
5
5
|
"description": "fastcar框架下对koa的包装",
|
|
6
6
|
"main": "target/index.js",
|
|
@@ -33,28 +33,34 @@
|
|
|
33
33
|
"@fastcar/core": "^0.2.38",
|
|
34
34
|
"@fastcar/server": "^0.0.3",
|
|
35
35
|
"@types/koa": "^2.13.5",
|
|
36
|
-
"reflect-metadata": "^0.1.13"
|
|
36
|
+
"reflect-metadata": "^0.1.13",
|
|
37
|
+
"@types/koa-bodyparser": "^4.3.11",
|
|
38
|
+
"@types/koa-router": "^7.4.6"
|
|
37
39
|
},
|
|
38
40
|
"dependencies": {
|
|
39
|
-
"koa": "^2.13.1"
|
|
41
|
+
"koa": "^2.13.1",
|
|
42
|
+
"koa-bodyparser": "^4.4.1",
|
|
43
|
+
"koa-router": "^12.0.1"
|
|
40
44
|
},
|
|
41
45
|
"peerDependencies": {
|
|
42
46
|
"@fastcar/core": "*",
|
|
43
47
|
"@fastcar/server": "*",
|
|
48
|
+
"@koa/multer": "^3.0.2",
|
|
44
49
|
"@types/koa-bodyparser": "^4.3.3",
|
|
45
50
|
"@types/koa-mount": "^4.0.1",
|
|
46
51
|
"@types/koa-range": "^0.3.2",
|
|
47
|
-
"@types/koa-router": "^7.4.
|
|
52
|
+
"@types/koa-router": "^7.4.6",
|
|
48
53
|
"@types/koa-static": "^4.0.2",
|
|
49
54
|
"@types/koa2-cors": "^2.0.2",
|
|
50
55
|
"koa-body": "^4.2.0",
|
|
51
|
-
"koa-bodyparser": "^4.
|
|
56
|
+
"koa-bodyparser": "^4.4.1",
|
|
52
57
|
"koa-mount": "^4.0.0",
|
|
53
58
|
"koa-range": "^0.3.0",
|
|
54
|
-
"koa-router": "^10.1.1",
|
|
55
59
|
"koa-static": "^5.0.0",
|
|
56
60
|
"koa2-cors": "^2.0.6",
|
|
57
|
-
"swagger-ui-dist": "4.5.0"
|
|
61
|
+
"swagger-ui-dist": "4.5.0",
|
|
62
|
+
"@types/koa__multer": "*",
|
|
63
|
+
"multer": "*"
|
|
58
64
|
},
|
|
59
65
|
"peerDependenciesMeta": {
|
|
60
66
|
"@types/koa-bodyparser": {
|
|
@@ -98,6 +104,12 @@
|
|
|
98
104
|
},
|
|
99
105
|
"swagger-ui-dist": {
|
|
100
106
|
"optional": true
|
|
107
|
+
},
|
|
108
|
+
"multer": {
|
|
109
|
+
"optional": true
|
|
110
|
+
},
|
|
111
|
+
"@types/koa__multer": {
|
|
112
|
+
"optional": true
|
|
101
113
|
}
|
|
102
114
|
},
|
|
103
115
|
"repository": {
|
package/target/annotation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REQUEST = exports.ALL = exports.PATCH = exports.PUT = exports.DELETE = exports.POST = exports.GET = exports.KoaMiddleware = exports.EnableKoa = exports.RequestMapping = exports.PutMapping = exports.PostMapping = exports.PatchMapping = exports.GetMapping = exports.DeleteMapping = exports.AllMapping = exports.AddMapping = void 0;
|
|
3
|
+
exports.KoaMulter = exports.REQUEST = exports.ALL = exports.PATCH = exports.PUT = exports.DELETE = exports.POST = exports.GET = exports.KoaMiddleware = exports.EnableKoa = exports.RequestMapping = exports.PutMapping = exports.PostMapping = exports.PatchMapping = exports.GetMapping = exports.DeleteMapping = exports.AllMapping = exports.AddMapping = void 0;
|
|
4
4
|
const EnableKoa_1 = require("./annotation/EnableKoa");
|
|
5
5
|
exports.EnableKoa = EnableKoa_1.default;
|
|
6
6
|
const KoaMiddleware_1 = require("./annotation/KoaMiddleware");
|
|
@@ -21,6 +21,8 @@ const PutMapping_1 = require("./annotation/router/PutMapping");
|
|
|
21
21
|
exports.PutMapping = PutMapping_1.default;
|
|
22
22
|
const RequestMapping_1 = require("./annotation/router/RequestMapping");
|
|
23
23
|
exports.RequestMapping = RequestMapping_1.default;
|
|
24
|
+
const KoaMulter_1 = require("./middleware/KoaMulter");
|
|
25
|
+
exports.KoaMulter = KoaMulter_1.default;
|
|
24
26
|
//声明简化的方式
|
|
25
27
|
const GET = GetMapping_1.default;
|
|
26
28
|
exports.GET = GET;
|
package/test/logs/sys.log
CHANGED
|
@@ -74,3 +74,45 @@
|
|
|
74
74
|
{"timestamp":"2023-02-18 15:57:06.254","level":"INFO","label":"sys","message":"http server is running in 1234"}
|
|
75
75
|
{"timestamp":"2023-02-18 15:57:06.256","level":"INFO","label":"sys","message":"start server koaSimple is run"}
|
|
76
76
|
{"timestamp":"2023-02-18 15:57:06.258","level":"INFO","label":"sys","message":"version 1.0.0"}
|
|
77
|
+
{"timestamp":"2023-11-06 11:03:08.665","level":"INFO","label":"sys","message":"Start scanning component"}
|
|
78
|
+
{"timestamp":"2023-11-06 11:03:09.601","level":"INFO","label":"sys","message":"Complete component scan"}
|
|
79
|
+
{"timestamp":"2023-11-06 11:03:09.602","level":"INFO","label":"sys","message":"Call application initialization method"}
|
|
80
|
+
{"timestamp":"2023-11-06 11:03:10.19","level":"INFO","label":"sys","message":"http server is running in 1234"}
|
|
81
|
+
{"timestamp":"2023-11-06 11:03:10.19","level":"INFO","label":"sys","message":"start server koaSimple is run"}
|
|
82
|
+
{"timestamp":"2023-11-06 11:03:10.20","level":"INFO","label":"sys","message":"version 1.0.0"}
|
|
83
|
+
{"timestamp":"2023-11-06 11:04:45.703","level":"INFO","label":"sys","message":"Start scanning component"}
|
|
84
|
+
{"timestamp":"2023-11-06 11:04:46.665","level":"INFO","label":"sys","message":"Complete component scan"}
|
|
85
|
+
{"timestamp":"2023-11-06 11:04:46.665","level":"INFO","label":"sys","message":"Call application initialization method"}
|
|
86
|
+
{"timestamp":"2023-11-06 11:04:46.672","level":"INFO","label":"sys","message":"http server is running in 1234"}
|
|
87
|
+
{"timestamp":"2023-11-06 11:04:46.672","level":"INFO","label":"sys","message":"start server koaSimple is run"}
|
|
88
|
+
{"timestamp":"2023-11-06 11:04:46.673","level":"INFO","label":"sys","message":"version 1.0.0"}
|
|
89
|
+
{"timestamp":"2023-11-06 11:06:22.126","level":"INFO","label":"sys","message":"Start scanning component"}
|
|
90
|
+
{"timestamp":"2023-11-06 11:06:22.428","level":"INFO","label":"sys","message":"Complete component scan"}
|
|
91
|
+
{"timestamp":"2023-11-06 11:06:22.428","level":"INFO","label":"sys","message":"Call application initialization method"}
|
|
92
|
+
{"timestamp":"2023-11-06 11:06:30.951","level":"INFO","label":"sys","message":"http server is running in 1234"}
|
|
93
|
+
{"timestamp":"2023-11-06 11:06:30.952","level":"INFO","label":"sys","message":"start server koaSimple is run"}
|
|
94
|
+
{"timestamp":"2023-11-06 11:06:30.953","level":"INFO","label":"sys","message":"version 1.0.0"}
|
|
95
|
+
{"timestamp":"2023-11-06 11:06:37.815","level":"INFO","label":"sys","message":"Start scanning component"}
|
|
96
|
+
{"timestamp":"2023-11-06 11:06:38.123","level":"INFO","label":"sys","message":"Complete component scan"}
|
|
97
|
+
{"timestamp":"2023-11-06 11:06:38.124","level":"INFO","label":"sys","message":"Call application initialization method"}
|
|
98
|
+
{"timestamp":"2023-11-06 11:06:40.295","level":"INFO","label":"sys","message":"http server is running in 1234"}
|
|
99
|
+
{"timestamp":"2023-11-06 11:06:40.296","level":"INFO","label":"sys","message":"start server koaSimple is run"}
|
|
100
|
+
{"timestamp":"2023-11-06 11:06:40.296","level":"INFO","label":"sys","message":"version 1.0.0"}
|
|
101
|
+
{"timestamp":"2023-11-06 11:19:08.992","level":"INFO","label":"sys","message":"Start scanning component"}
|
|
102
|
+
{"timestamp":"2023-11-06 11:19:09.815","level":"INFO","label":"sys","message":"Complete component scan"}
|
|
103
|
+
{"timestamp":"2023-11-06 11:19:09.816","level":"INFO","label":"sys","message":"Call application initialization method"}
|
|
104
|
+
{"timestamp":"2023-11-06 11:19:13.80","level":"INFO","label":"sys","message":"http server is running in 1234"}
|
|
105
|
+
{"timestamp":"2023-11-06 11:19:13.81","level":"INFO","label":"sys","message":"start server koaSimple is run"}
|
|
106
|
+
{"timestamp":"2023-11-06 11:19:13.81","level":"INFO","label":"sys","message":"version 1.0.0"}
|
|
107
|
+
{"timestamp":"2023-11-06 11:33:57.571","level":"INFO","label":"sys","message":"Start scanning component"}
|
|
108
|
+
{"timestamp":"2023-11-06 11:33:57.951","level":"INFO","label":"sys","message":"Complete component scan"}
|
|
109
|
+
{"timestamp":"2023-11-06 11:33:57.951","level":"INFO","label":"sys","message":"Call application initialization method"}
|
|
110
|
+
{"timestamp":"2023-11-06 11:33:57.958","level":"INFO","label":"sys","message":"http server is running in 1234"}
|
|
111
|
+
{"timestamp":"2023-11-06 11:33:57.959","level":"INFO","label":"sys","message":"start server koaSimple is run"}
|
|
112
|
+
{"timestamp":"2023-11-06 11:33:57.959","level":"INFO","label":"sys","message":"version 1.0.0"}
|
|
113
|
+
{"timestamp":"2023-11-06 11:38:42.619","level":"INFO","label":"sys","message":"Start scanning component"}
|
|
114
|
+
{"timestamp":"2023-11-06 11:38:42.903","level":"INFO","label":"sys","message":"Complete component scan"}
|
|
115
|
+
{"timestamp":"2023-11-06 11:38:42.904","level":"INFO","label":"sys","message":"Call application initialization method"}
|
|
116
|
+
{"timestamp":"2023-11-06 11:38:42.910","level":"INFO","label":"sys","message":"http server is running in 1234"}
|
|
117
|
+
{"timestamp":"2023-11-06 11:38:42.911","level":"INFO","label":"sys","message":"start server koaSimple is run"}
|
|
118
|
+
{"timestamp":"2023-11-06 11:38:42.912","level":"INFO","label":"sys","message":"version 1.0.0"}
|
package/test/simple/app.ts
CHANGED
|
@@ -8,6 +8,7 @@ import * as Koa from "koa";
|
|
|
8
8
|
import ExceptionGlobalHandler from "../../src/middleware/ExceptionGlobalHandler";
|
|
9
9
|
import KoaCors from "../../src/middleware/koaCors";
|
|
10
10
|
import Swagger from "../../src/middleware/Swagger";
|
|
11
|
+
import KoaMulter from "../../src/middleware/KoaMulter";
|
|
11
12
|
|
|
12
13
|
const m1 = () => {
|
|
13
14
|
return async (ctx: any, next: Function) => {
|
|
@@ -27,9 +28,8 @@ const m2 = (): Koa.Middleware => {
|
|
|
27
28
|
|
|
28
29
|
@Application
|
|
29
30
|
@EnableKoa //开启koa
|
|
30
|
-
@KoaMiddleware(ExceptionGlobalHandler,
|
|
31
|
-
@KoaMiddleware(
|
|
32
|
-
@KoaMiddleware(m1, m2)
|
|
31
|
+
@KoaMiddleware(ExceptionGlobalHandler, KoaBodyParser as any, KoaMulter)
|
|
32
|
+
// @KoaMiddleware(m1, m2)
|
|
33
33
|
class APP {
|
|
34
34
|
app!: FastCarApplication;
|
|
35
35
|
}
|