增加部署发布模块

This commit is contained in:
aixianling
2022-03-30 19:19:56 +08:00
parent d48be5b91f
commit f56c30780a
7 changed files with 77 additions and 3 deletions

28
rest/autodeploy/list.js Normal file
View File

@@ -0,0 +1,28 @@
const dbUtils = require("../../utils/dbUitls");
module.exports = {
action: "/node/autodeploy/list",
method: "post",
execute: (request, response) => {
let total = 0, records = []
Promise.all([
dbUtils.query(`select 1 from node_autodeploy`).then(res => {
return total = res.length
}),
new Promise(resolve => {
let sql = `select * from node_autodeploy`
dbUtils.query(sql).then(res => {
records = res
resolve()
})
})
]).then(() => {
response.send({
code: 0,
data: {records, total}
})
})
}
}