gg-express 1.0.75 → 1.0.79
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/dist/GGExpress.js
CHANGED
|
@@ -24,11 +24,20 @@ class GGExpress {
|
|
|
24
24
|
this.appName = appName;
|
|
25
25
|
}
|
|
26
26
|
rootMethod(method, url, options, ...middlewares) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
let tempURL;
|
|
28
|
+
if (Array.isArray(url)) {
|
|
29
|
+
tempURL = url;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
tempURL = [url];
|
|
33
|
+
}
|
|
34
|
+
tempURL.map((url) => {
|
|
35
|
+
myExpressRouteList.push({
|
|
36
|
+
method: method,
|
|
37
|
+
url: url,
|
|
38
|
+
requireParams: options.requireParams,
|
|
39
|
+
responseStructure: options.responseStructure,
|
|
40
|
+
});
|
|
32
41
|
});
|
|
33
42
|
return this.express[method](url, (req, res, next) => {
|
|
34
43
|
return next();
|
|
@@ -23,6 +23,52 @@ export interface staticRouteInterface_hotel {
|
|
|
23
23
|
}[];
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
+
"/api/seed/memo/id": {
|
|
27
|
+
requireParams: {
|
|
28
|
+
parameter: {
|
|
29
|
+
files: string[];
|
|
30
|
+
};
|
|
31
|
+
data: {
|
|
32
|
+
id: number;
|
|
33
|
+
name: "A" | "B";
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
responseStructure: {
|
|
37
|
+
status: "SUCCESS" | "ERROR";
|
|
38
|
+
message: string;
|
|
39
|
+
parameter: {
|
|
40
|
+
numberOfPeople: number;
|
|
41
|
+
itemName: string;
|
|
42
|
+
};
|
|
43
|
+
data: {
|
|
44
|
+
id: number;
|
|
45
|
+
name: string;
|
|
46
|
+
}[];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
"/api/hotel/memo/id": {
|
|
50
|
+
requireParams: {
|
|
51
|
+
parameter: {
|
|
52
|
+
files: string[];
|
|
53
|
+
};
|
|
54
|
+
data: {
|
|
55
|
+
id: number;
|
|
56
|
+
name: "A" | "B";
|
|
57
|
+
}[];
|
|
58
|
+
};
|
|
59
|
+
responseStructure: {
|
|
60
|
+
status: "SUCCESS" | "ERROR";
|
|
61
|
+
message: string;
|
|
62
|
+
parameter: {
|
|
63
|
+
numberOfPeople: number;
|
|
64
|
+
itemName: string;
|
|
65
|
+
};
|
|
66
|
+
data: {
|
|
67
|
+
id: number;
|
|
68
|
+
name: string;
|
|
69
|
+
}[];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
26
72
|
};
|
|
27
73
|
post: {
|
|
28
74
|
"/api/hotel/item": {
|
package/package.json
CHANGED
package/src/GGExpress.ts
CHANGED
|
@@ -107,7 +107,7 @@ type MyResponse<
|
|
|
107
107
|
|
|
108
108
|
const myExpressRouteList: {
|
|
109
109
|
method: "get" | "post" | "put" | "delete"
|
|
110
|
-
url: string
|
|
110
|
+
url: string
|
|
111
111
|
requireParams: requireParamsStructure
|
|
112
112
|
responseStructure: responseStructure
|
|
113
113
|
}[] = []
|
|
@@ -148,11 +148,19 @@ export default class GGExpress<appName extends string> {
|
|
|
148
148
|
) => any
|
|
149
149
|
>
|
|
150
150
|
) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
let tempURL
|
|
152
|
+
if (Array.isArray(url)) {
|
|
153
|
+
tempURL = url
|
|
154
|
+
} else {
|
|
155
|
+
tempURL = [url]
|
|
156
|
+
}
|
|
157
|
+
tempURL.map((url) => {
|
|
158
|
+
myExpressRouteList.push({
|
|
159
|
+
method: method,
|
|
160
|
+
url: url,
|
|
161
|
+
requireParams: options.requireParams,
|
|
162
|
+
responseStructure: options.responseStructure,
|
|
163
|
+
})
|
|
156
164
|
})
|
|
157
165
|
|
|
158
166
|
return this.express[method](
|
|
@@ -12,6 +12,30 @@ export interface staticRouteInterface_hotel {
|
|
|
12
12
|
data: { id: number; name: string }[]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
"/api/seed/memo/id": {
|
|
16
|
+
requireParams: {
|
|
17
|
+
parameter: { files: string[] }
|
|
18
|
+
data: { id: number; name: "A" | "B" }[]
|
|
19
|
+
}
|
|
20
|
+
responseStructure: {
|
|
21
|
+
status: "SUCCESS" | "ERROR"
|
|
22
|
+
message: string
|
|
23
|
+
parameter: { numberOfPeople: number; itemName: string }
|
|
24
|
+
data: { id: number; name: string }[]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
"/api/hotel/memo/id": {
|
|
28
|
+
requireParams: {
|
|
29
|
+
parameter: { files: string[] }
|
|
30
|
+
data: { id: number; name: "A" | "B" }[]
|
|
31
|
+
}
|
|
32
|
+
responseStructure: {
|
|
33
|
+
status: "SUCCESS" | "ERROR"
|
|
34
|
+
message: string
|
|
35
|
+
parameter: { numberOfPeople: number; itemName: string }
|
|
36
|
+
data: { id: number; name: string }[]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
15
39
|
}
|
|
16
40
|
post: {
|
|
17
41
|
"/api/hotel/item": {
|