调整接口
This commit is contained in:
@@ -8,7 +8,22 @@ module.exports = {
|
||||
action: "/node/monitorApi/addOrUpdate",
|
||||
method: "post",
|
||||
execute: (request, response) => {
|
||||
Promise.all([request.body].flat().map(e => addLog(e))).then(data => {
|
||||
dbUtils.batchInsert({
|
||||
table: 'node_api_logs',
|
||||
list: [request.body].flat().map(({id, status, path, device, url, createTime, nodeProcess, method, code, userName, error}) => ({
|
||||
id,
|
||||
status,
|
||||
path,
|
||||
device,
|
||||
url,
|
||||
createTime,
|
||||
nodeProcess,
|
||||
method,
|
||||
code,
|
||||
userName,
|
||||
error
|
||||
}))
|
||||
}).then(data => {
|
||||
response.send({code: 0, data})
|
||||
}).catch(err => {
|
||||
response.send({code: 1, err: err?.sqlMessage || err || ""})
|
||||
|
||||
Reference in New Issue
Block a user