增加部署发布模块
This commit is contained in:
28
rest/autodeploy/list.js
Normal file
28
rest/autodeploy/list.js
Normal 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}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user