mas-server 1.0.0 → 1.0.2
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/README.md +1 -1
- package/package.json +7 -4
- package/src/config/apiModules/set.module +1 -1
- package/src/config/config.schema.js +13 -1
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
一款基于express面向中小型项目的后端框架
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mas-server",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "一款基于express面向中小型项目的后端框架",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "nodemon --exec npm run serve -i api.config.k.json -i api.config.json -i api.tree.json -i $form.js",
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
"api": "node ./test/.utils/api.js",
|
|
11
11
|
"apis": "node ./test/.utils/apis.js"
|
|
12
12
|
},
|
|
13
|
-
"keywords": [
|
|
13
|
+
"keywords": [
|
|
14
|
+
"后端",
|
|
15
|
+
"express"
|
|
16
|
+
],
|
|
14
17
|
"author": "tingxi8087",
|
|
15
18
|
"license": "ISC",
|
|
16
19
|
"dependencies": {
|
|
@@ -22,4 +25,4 @@
|
|
|
22
25
|
"masutils": "^1.0.8",
|
|
23
26
|
"moment": "^2.29.4"
|
|
24
27
|
}
|
|
25
|
-
}
|
|
28
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { sql } = require("mas-server");
|
|
2
2
|
const $form = require("@/$form");
|
|
3
3
|
module.exports = async (req, res) => {
|
|
4
|
-
const sqlData =await sql.use($form.@@form@@).save(req.body).go();
|
|
4
|
+
const sqlData =await sql.use($form.@@form@@).save(req.body.data).go();
|
|
5
5
|
res.return(sqlData, sqlData);
|
|
6
6
|
};
|
|
@@ -17,7 +17,19 @@
|
|
|
17
17
|
* @property {string} sql.password 数据库密码
|
|
18
18
|
* @property {string} sql.database 数据库名称
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @typedef {object} sqlForm
|
|
22
|
+
* @property {string} key - 字段名
|
|
23
|
+
* @property {"str" | "int" | "float"} type 类型
|
|
24
|
+
* @property {string} length 字符串长度,整数或浮点数可省略
|
|
25
|
+
* @property {boolean} notNull 是否不能为空,默认为false
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* @desc: 数据库一键建表规范
|
|
29
|
+
* @param {sqlForm[]} data
|
|
30
|
+
* @return {sqlForm[]} 返回配置
|
|
31
|
+
*/
|
|
32
|
+
const $sqlForm = (data) => data
|
|
21
33
|
module.exports = {
|
|
22
34
|
/**
|
|
23
35
|
* @desc: 数据库规范
|