From 44b9d930dc6f3b8f86f7867a9d0a9509209662b3 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 19 Sep 2025 14:39:14 +0800 Subject: [PATCH] =?UTF-8?q?perf(WAI):=20=E6=B6=88=E6=81=AF=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=BC=82=E6=AD=A5=E8=BF=94=E5=9B=9E;=20=E8=A1=A5?= =?UTF-8?q?=E5=85=A8=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wai-server/helper/wai.msg.helper.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wai-server/helper/wai.msg.helper.js b/wai-server/helper/wai.msg.helper.js index 38a55b7..262e314 100644 --- a/wai-server/helper/wai.msg.helper.js +++ b/wai-server/helper/wai.msg.helper.js @@ -32,6 +32,8 @@ const mediaMsg = { IVADS_filename: msg[type].filename || '', IVADS_mime_type: msg[type].mimetype || '', IVADS_sha256: msg[type].sha256 || '', + actionId: msg?.externalId, + externalId: (msg?.externalId || '').split('.')?.[0], }; }, dataToDB: msg => { @@ -87,7 +89,7 @@ const waiMsgTypeMapped = { ...(msg.msgcontent.context ? { quoted: { key: msg.msgcontent.context.message_id } } : {}), }), waiContentToDB: msg => { - return { text_body: msg.text.body }; + return { text_body: msg.text.body, actionId: msg?.externalId, externalId: (msg?.externalId || '').split('.')?.[0] }; }, dataToDB: msg => { const { msgcontent } = msg; @@ -176,6 +178,8 @@ const waiMsgTypeMapped = { // todo: reaction_message_id: '', reaction_emoji: '', + actionId: msg?.externalId, + externalId: (msg?.externalId || '').split('.')?.[0], }; }, dataToDB: msg => { @@ -207,7 +211,10 @@ const waiMsgTypeMapped = { }), waiContentToDB: msg => { // todo: - return {}; + return { + actionId: msg?.externalId, + externalId: (msg?.externalId || '').split('.')?.[0], + }; }, dataToDB: msg => { const { msgtype, msgcontent, ...body } = msg; @@ -243,6 +250,8 @@ const waiMsgTypeMapped = { waiContentToDB: msg => { return { contacts: JSON.stringify(msg.contacts), + actionId: msg?.externalId, + externalId: (msg?.externalId || '').split('.')?.[0], }; }, dataToDB: msg => {