rax-medical/node-server/core/AIMedicineTable.js

32 lines
1.0 KiB
JavaScript
Raw Normal View History

2023-11-10 17:45:10 +08:00
import common from "./common.js";
const app = common.app;
const connection = common.connection;
const m_get = common.m_get;
2023-11-11 13:22:51 +08:00
const m_add = common.m_add;
2023-11-10 17:45:10 +08:00
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));
2023-11-10 17:45:10 +08:00
});
2023-11-11 13:22:51 +08:00
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));
2023-11-11 13:22:51 +08:00
})
2023-11-10 17:45:10 +08:00
export default {
2023-11-11 13:22:51 +08:00
getTable,
addTable
2023-11-10 17:45:10 +08:00
};