gg-express 1.0.101 → 1.0.103
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/v2/generateStaticRouteFileV2.js +7 -1
- package/dist/v2/output/staticRouteInterface_hotel_v2.d.ts +6 -5
- package/dist/v2/run_v2.test.d.ts +1 -1
- package/dist/v2/run_v2.test.js +8 -3
- package/package.json +1 -1
- package/src/v2/generateStaticRouteFileV2.ts +4 -1
- package/src/v2/output/staticRouteInterface_hotel_v2.ts +4 -5
- package/src/v2/run_v2.test.ts +9 -4
|
@@ -46,7 +46,13 @@ function parentInputToCode(data, isPartialRequireParam) {
|
|
|
46
46
|
result = `(${result})[]`;
|
|
47
47
|
else
|
|
48
48
|
result;
|
|
49
|
-
|
|
49
|
+
if (isUndefinedAble === "undefined")
|
|
50
|
+
if (isPartialRequireParam)
|
|
51
|
+
return `${parentKeyName}? : ${result}`;
|
|
52
|
+
else
|
|
53
|
+
return `${getParentKeyCode(parentKeyName)}? : ${result}`;
|
|
54
|
+
else
|
|
55
|
+
return `${getParentKeyCode(parentKeyName)} : ${result}`;
|
|
50
56
|
}
|
|
51
57
|
// check object ---------------------------
|
|
52
58
|
else if (typeof target === "object" && Array.isArray(target) === false) {
|
|
@@ -12,7 +12,7 @@ export interface staticRouteInterface_hotel_v2 {
|
|
|
12
12
|
checkOutTime: string;
|
|
13
13
|
roomRate: number;
|
|
14
14
|
extraBedRate: number;
|
|
15
|
-
roomNumber
|
|
15
|
+
roomNumber?: string | undefined | null;
|
|
16
16
|
editTime: string;
|
|
17
17
|
createTime: string;
|
|
18
18
|
shiftDate: string;
|
|
@@ -79,10 +79,10 @@ export interface staticRouteInterface_hotel_v2 {
|
|
|
79
79
|
message: string;
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
"/api/hotel/testPost": {
|
|
83
|
+
requireParams: {
|
|
84
|
+
id?: number;
|
|
85
|
+
};
|
|
86
86
|
responseStructure: {
|
|
87
87
|
data: {
|
|
88
88
|
bookingData: {
|
|
@@ -95,5 +95,6 @@ export interface staticRouteInterface_hotel_v2 {
|
|
|
95
95
|
};
|
|
96
96
|
};
|
|
97
97
|
};
|
|
98
|
+
put: {};
|
|
98
99
|
delete: {};
|
|
99
100
|
}
|
package/dist/v2/run_v2.test.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const hotel_model_const_temp: {
|
|
|
8
8
|
readonly checkOutTime: "string";
|
|
9
9
|
readonly roomRate: "number";
|
|
10
10
|
readonly extraBedRate: "number";
|
|
11
|
-
readonly roomNumber: "string";
|
|
11
|
+
readonly roomNumber: "string?~";
|
|
12
12
|
readonly editTime: "string";
|
|
13
13
|
readonly createTime: "string";
|
|
14
14
|
readonly shiftDate: "string";
|
package/dist/v2/run_v2.test.js
CHANGED
|
@@ -25,7 +25,7 @@ exports.hotel_model_const_temp = {
|
|
|
25
25
|
checkOutTime: "string",
|
|
26
26
|
roomRate: "number",
|
|
27
27
|
extraBedRate: "number",
|
|
28
|
-
roomNumber: "string",
|
|
28
|
+
roomNumber: "string?~",
|
|
29
29
|
editTime: "string",
|
|
30
30
|
createTime: "string",
|
|
31
31
|
shiftDate: "string",
|
|
@@ -43,6 +43,7 @@ function run() {
|
|
|
43
43
|
const ggapp = new GGExpressV2_1.default(app, "hotel", ["./output"]);
|
|
44
44
|
ggapp.get("/api/hotel/users/id", {
|
|
45
45
|
requireParams: {
|
|
46
|
+
// isPartial: true,
|
|
46
47
|
data: {
|
|
47
48
|
id: "number",
|
|
48
49
|
data: exports.hotel_model_const_temp["booking"],
|
|
@@ -147,9 +148,12 @@ function run() {
|
|
|
147
148
|
},
|
|
148
149
|
});
|
|
149
150
|
});
|
|
150
|
-
ggapp.
|
|
151
|
+
ggapp.post("/api/hotel/testPost", {
|
|
151
152
|
requireParams: {
|
|
152
|
-
|
|
153
|
+
isPartial: true,
|
|
154
|
+
data: {
|
|
155
|
+
id: "number",
|
|
156
|
+
},
|
|
153
157
|
},
|
|
154
158
|
responseStructure: {
|
|
155
159
|
bookingData: {
|
|
@@ -158,6 +162,7 @@ function run() {
|
|
|
158
162
|
},
|
|
159
163
|
},
|
|
160
164
|
}, (req, res, next) => {
|
|
165
|
+
req.body.id;
|
|
161
166
|
return res.json({
|
|
162
167
|
status: "ERROR",
|
|
163
168
|
message: "",
|
package/package.json
CHANGED
|
@@ -69,7 +69,10 @@ function parentInputToCode(
|
|
|
69
69
|
.join(" | ")
|
|
70
70
|
if (isArray) result = `(${result})[]`
|
|
71
71
|
else result
|
|
72
|
-
|
|
72
|
+
if (isUndefinedAble === "undefined")
|
|
73
|
+
if (isPartialRequireParam) return `${parentKeyName}? : ${result}`
|
|
74
|
+
else return `${getParentKeyCode(parentKeyName)}? : ${result}`
|
|
75
|
+
else return `${getParentKeyCode(parentKeyName)} : ${result}`
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
// check object ---------------------------
|
|
@@ -12,7 +12,7 @@ export interface staticRouteInterface_hotel_v2 {
|
|
|
12
12
|
checkOutTime: string
|
|
13
13
|
roomRate: number
|
|
14
14
|
extraBedRate: number
|
|
15
|
-
roomNumber
|
|
15
|
+
roomNumber?: string | undefined | null
|
|
16
16
|
editTime: string
|
|
17
17
|
createTime: string
|
|
18
18
|
shiftDate: string
|
|
@@ -63,10 +63,8 @@ export interface staticRouteInterface_hotel_v2 {
|
|
|
63
63
|
message: string
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"/api/hotel/testPut": {
|
|
69
|
-
requireParams: {}
|
|
66
|
+
"/api/hotel/testPost": {
|
|
67
|
+
requireParams: { id?: number }
|
|
70
68
|
responseStructure: {
|
|
71
69
|
data: {
|
|
72
70
|
bookingData: { id: number; roomNumber: string }
|
|
@@ -76,5 +74,6 @@ export interface staticRouteInterface_hotel_v2 {
|
|
|
76
74
|
}
|
|
77
75
|
}
|
|
78
76
|
}
|
|
77
|
+
put: {}
|
|
79
78
|
delete: {}
|
|
80
79
|
}
|
package/src/v2/run_v2.test.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const hotel_model_const_temp = {
|
|
|
12
12
|
checkOutTime: "string",
|
|
13
13
|
roomRate: "number",
|
|
14
14
|
extraBedRate: "number",
|
|
15
|
-
roomNumber: "string",
|
|
15
|
+
roomNumber: "string?~",
|
|
16
16
|
editTime: "string",
|
|
17
17
|
createTime: "string",
|
|
18
18
|
shiftDate: "string",
|
|
@@ -33,6 +33,7 @@ function run() {
|
|
|
33
33
|
"/api/hotel/users/id",
|
|
34
34
|
{
|
|
35
35
|
requireParams: {
|
|
36
|
+
// isPartial: true,
|
|
36
37
|
data: {
|
|
37
38
|
id: "number",
|
|
38
39
|
data: hotel_model_const_temp["booking"],
|
|
@@ -144,11 +145,14 @@ function run() {
|
|
|
144
145
|
}
|
|
145
146
|
)
|
|
146
147
|
|
|
147
|
-
ggapp.
|
|
148
|
-
"/api/hotel/
|
|
148
|
+
ggapp.post(
|
|
149
|
+
"/api/hotel/testPost",
|
|
149
150
|
{
|
|
150
151
|
requireParams: {
|
|
151
|
-
|
|
152
|
+
isPartial: true,
|
|
153
|
+
data: {
|
|
154
|
+
id: "number",
|
|
155
|
+
},
|
|
152
156
|
},
|
|
153
157
|
responseStructure: {
|
|
154
158
|
bookingData: {
|
|
@@ -158,6 +162,7 @@ function run() {
|
|
|
158
162
|
},
|
|
159
163
|
},
|
|
160
164
|
(req, res, next) => {
|
|
165
|
+
req.body.id
|
|
161
166
|
return res.json({
|
|
162
167
|
status: "ERROR",
|
|
163
168
|
message: "",
|