perf(WAI): 消息状态异步返回; 补全字段

main
Lei OT 7 months ago
parent b97c8e449c
commit 44b9d930dc

@ -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 => {

Loading…
Cancel
Save