import common from "./common.js"; const app = common.app; const connection = common.connection; const m_get = common.m_get; const m_add = common.m_add; const nowTime = common.nowTime; const getTable = () => app.post('/getaimedicine', function (req, res) { const database = req.body.database; const table = `AIMedicineTable`; const order = `ID`; const Clause = false; const start = ~~req.body.start; const end = ~~req.body.end; common.mysqlQuery(res, database, m_get(table, Clause, order, start, end)); }); const addTable = () => app.post('/addaimedicine', (req, res) => { const database = req.body.database; const table = `AIMedicineTable`; const key = req.body.key; // `name, region, area, house_type, phone, create_time, remark`; const values = req.body.value; // `'${v.name}', '${v.region}', '${v.area}', '${v.house_type}', '${v.phone}', '${nowTime()}', '${remark}'`; common.mysqlQuery(res, database, m_add(table, key, values)); }) export default { getTable, addTable };