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} }) }) } }