befly 3.18.5 → 3.18.6
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/apis/dict/all.js +5 -2
- package/apis/dict/detail.js +4 -2
- package/apis/dict/ins.js +6 -6
- package/apis/dict/items.js +1 -1
- package/apis/dict/list.js +2 -3
- package/apis/dict/upd.js +6 -6
- package/package.json +2 -2
package/apis/dict/all.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import dictTable from "../../tables/dict.json";
|
|
1
2
|
export default {
|
|
2
3
|
name: "获取所有字典",
|
|
3
4
|
method: "POST",
|
|
4
5
|
body: "none",
|
|
5
|
-
auth:
|
|
6
|
-
fields: {
|
|
6
|
+
auth: false,
|
|
7
|
+
fields: {
|
|
8
|
+
typeCode: dictTable.typeCode
|
|
9
|
+
},
|
|
7
10
|
required: [],
|
|
8
11
|
handler: async (befly) => {
|
|
9
12
|
const result = await befly.mysql.getAll({
|
package/apis/dict/detail.js
CHANGED
|
@@ -2,8 +2,10 @@ export default {
|
|
|
2
2
|
name: "获取字典详情",
|
|
3
3
|
method: "POST",
|
|
4
4
|
body: "none",
|
|
5
|
-
auth:
|
|
6
|
-
fields: {
|
|
5
|
+
auth: false,
|
|
6
|
+
fields: {
|
|
7
|
+
id: { name: "ID", input: "integer", min: 1, max: null }
|
|
8
|
+
},
|
|
7
9
|
required: ["id"],
|
|
8
10
|
handler: async (befly, ctx) => {
|
|
9
11
|
const dict = await befly.mysql.getOne({
|
package/apis/dict/ins.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dictTable from "../../tables/dict.json";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
name: "添加字典",
|
|
@@ -6,11 +6,11 @@ export default {
|
|
|
6
6
|
body: "none",
|
|
7
7
|
auth: true,
|
|
8
8
|
fields: {
|
|
9
|
-
typeCode:
|
|
10
|
-
key:
|
|
11
|
-
label:
|
|
12
|
-
sort:
|
|
13
|
-
remark:
|
|
9
|
+
typeCode: dictTable.typeCode,
|
|
10
|
+
key: dictTable.key,
|
|
11
|
+
label: dictTable.label,
|
|
12
|
+
sort: dictTable.sort,
|
|
13
|
+
remark: dictTable.remark
|
|
14
14
|
},
|
|
15
15
|
required: ["typeCode", "key", "label"],
|
|
16
16
|
handler: async (befly, ctx) => {
|
package/apis/dict/items.js
CHANGED
package/apis/dict/list.js
CHANGED
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
name: "获取字典列表",
|
|
5
5
|
method: "POST",
|
|
6
6
|
body: "none",
|
|
7
|
-
auth:
|
|
7
|
+
auth: false,
|
|
8
8
|
fields: {
|
|
9
9
|
page: { name: "页码", input: "integer", min: 1, max: 9999 },
|
|
10
10
|
limit: { name: "每页数量", input: "integer", min: 1, max: 100 },
|
|
@@ -23,8 +23,7 @@ export default {
|
|
|
23
23
|
],
|
|
24
24
|
fields: ["beflyDict.id", "beflyDict.typeCode", "beflyDict.key", "beflyDict.label", "beflyDict.sort", "beflyDict.remark", "beflyDict.createdAt", "beflyDict.updatedAt", "beflyDictType.name AS typeName"],
|
|
25
25
|
where: {
|
|
26
|
-
"beflyDict.typeCode": ctx.body.typeCode
|
|
27
|
-
$or: [{ "beflyDict.key$like": `%${ctx.body.keyword}%` }, { "beflyDict.label$like": `%${ctx.body.keyword}%` }]
|
|
26
|
+
"beflyDict.typeCode": ctx.body.typeCode
|
|
28
27
|
},
|
|
29
28
|
page: ctx.body.page,
|
|
30
29
|
limit: ctx.body.limit,
|
package/apis/dict/upd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dictTable from "../../tables/dict.json";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
name: "更新字典",
|
|
@@ -7,11 +7,11 @@ export default {
|
|
|
7
7
|
auth: true,
|
|
8
8
|
fields: {
|
|
9
9
|
id: { name: "ID", input: "integer", min: 1, max: null },
|
|
10
|
-
typeCode:
|
|
11
|
-
key:
|
|
12
|
-
label:
|
|
13
|
-
sort:
|
|
14
|
-
remark:
|
|
10
|
+
typeCode: dictTable.typeCode,
|
|
11
|
+
key: dictTable.key,
|
|
12
|
+
label: dictTable.label,
|
|
13
|
+
sort: dictTable.sort,
|
|
14
|
+
remark: dictTable.remark
|
|
15
15
|
},
|
|
16
16
|
required: ["id"],
|
|
17
17
|
handler: async (befly, ctx) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "befly",
|
|
3
|
-
"version": "3.18.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "3.18.6",
|
|
4
|
+
"gitHead": "ba3a888f1f752b56c7290d73e83faa317d2d4982",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Befly - 为 Bun 专属打造的 JavaScript API 接口框架核心引擎",
|
|
7
7
|
"keywords": [
|