gg-mysql-connector 1.0.22 → 1.0.24
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/ModelGenerator.d.ts
CHANGED
package/dist/ModelGenerator.js
CHANGED
|
@@ -155,11 +155,11 @@ class ModelGenerator {
|
|
|
155
155
|
}
|
|
156
156
|
const fileName = `${params.appName}_INF.ts`;
|
|
157
157
|
const code = `export default interface ${params.appName}_INF { ${array.join("\n")} }`;
|
|
158
|
-
params.
|
|
159
|
-
const serverFilePath = path_1.default.join(
|
|
158
|
+
for (let row of params.outputDirectory) {
|
|
159
|
+
const serverFilePath = path_1.default.join(row, fileName);
|
|
160
160
|
await fs_1.default.writeFileSync(serverFilePath, code);
|
|
161
161
|
console.log("save to ", serverFilePath);
|
|
162
|
-
}
|
|
162
|
+
}
|
|
163
163
|
console.log(`generate interface ${params.appName} ${chalk_1.default.bgGreen(" SUCCESS ")}`);
|
|
164
164
|
return code;
|
|
165
165
|
}
|
package/package.json
CHANGED
package/src/ModelGenerator.ts
CHANGED
|
@@ -126,7 +126,7 @@ export default class ModelGenerator {
|
|
|
126
126
|
async generateModelInterface(params: {
|
|
127
127
|
appName: string
|
|
128
128
|
model: MyModel[]
|
|
129
|
-
|
|
129
|
+
outputDirectory: string[]
|
|
130
130
|
}) {
|
|
131
131
|
const isTableNameExistInModel = (tableName: string) => {
|
|
132
132
|
if (tableName === "sessions") return true
|
|
@@ -207,11 +207,11 @@ export default class ModelGenerator {
|
|
|
207
207
|
params.appName
|
|
208
208
|
}_INF { ${array.join("\n")} }`
|
|
209
209
|
|
|
210
|
-
params.
|
|
211
|
-
const serverFilePath = path.join(
|
|
210
|
+
for (let row of params.outputDirectory) {
|
|
211
|
+
const serverFilePath = path.join(row, fileName)
|
|
212
212
|
await fs.writeFileSync(serverFilePath, code)
|
|
213
213
|
console.log("save to ", serverFilePath)
|
|
214
|
-
}
|
|
214
|
+
}
|
|
215
215
|
|
|
216
216
|
console.log(
|
|
217
217
|
`generate interface ${params.appName} ${chalk.bgGreen(" SUCCESS ")}`
|