初始化
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user