@yorha2b-lab/autodev 1.0.39 → 1.0.40
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/package.json
CHANGED
|
@@ -119,10 +119,10 @@ const watchPage = options => {
|
|
|
119
119
|
`🧑💻 9S: Leave it to me, 2B! Hacking and forging Mock data for [${fileName}]...`
|
|
120
120
|
)))
|
|
121
121
|
const rawContent = await generateMock(pageConfig.table.columns, fileName)
|
|
122
|
-
fs.writeFileSync(path.join(mockDir, `${fileName}.js`), `export default ${stringify.default(rawContent, { indent: 4, maxLength: 200 })}
|
|
122
|
+
fs.writeFileSync(path.join(mockDir, `${fileName}.js`), `export default ${stringify.default(rawContent, { indent: 4, maxLength: 200 })}`)
|
|
123
123
|
console.log(chalk.green(language(
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
`\n🤖 Pod 042: [报告] Mock 数据注入完成,耗时: ${(Date.now() - startTime) / 1000} 秒`,
|
|
125
|
+
`\n🤖 Pod 042: [Report] Mock data injection complete. Elapsed time: ${(Date.now() - startTime) / 1000}s`
|
|
126
126
|
)))
|
|
127
127
|
}
|
|
128
128
|
|
package/src/prompts/mock.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
module.exports = (columns, fileName) => `
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
根据这些字段生成一个简单的接口mock数据: ${JSON.stringify(columns)},
|
|
3
|
+
格式为{key:value}:
|
|
4
|
+
key: POST /api/${fileName}
|
|
5
|
+
value: {data:模块对象列表},
|
|
5
6
|
`
|