初始化

This commit is contained in:
robin
2022-08-02 19:21:03 +08:00
parent 73c1343060
commit b7e5ee5fec
27 changed files with 564 additions and 156 deletions
+27
View File
@@ -0,0 +1,27 @@
'use strict';
//获取数据库模型列表
module.exports = {
params: {},
fun : async (ctx, app) => {
const {} = ctx.params
const data = Object.keys($db.models).map(item => {
let tableAttributes = $db.models[item].tableAttributes
let ta = {}
Object.keys(tableAttributes).forEach(ta_item => {
ta[ta_item] = {
fieldName: tableAttributes[ta_item].fieldName,//字段名
field : tableAttributes[ta_item].field,//字段
headName : tableAttributes[ta_item].fieldNameCus,//字段自定义名
comment : tableAttributes[ta_item].comment,//注释
}
})
return {
tableName : $db.models[item].tableName,
tableAttributes: ta,
primaryKeyField: $db.models[item].primaryKeyField,
}
})
return data
}
}
+12
View File
@@ -0,0 +1,12 @@
'use strict';
module.exports = {
params: {
"taskList": "array",
},
fun : async (ctx, app) => {
const {taskList} = ctx.params
const data = await $db.jsonTasks(taskList)
return data
}
}