修正邮件接收时间和发件人展示
This commit is contained in:
@@ -45,6 +45,7 @@ public class AgentBusSourceMessageAdapter {
|
||||
text(source, "external_conversation_id"),
|
||||
text(frame, "id"),
|
||||
text(frame, "session_id"),
|
||||
firstInstant(source, "received_at", payload, "received_at"),
|
||||
parseInstant(text(source, "sent_at")),
|
||||
text(source, "sender"),
|
||||
text(source, "subject"),
|
||||
@@ -110,6 +111,17 @@ public class AgentBusSourceMessageAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从两个候选字段中读取第一个可解析的时间,格式非法时继续尝试后续字段。
|
||||
*/
|
||||
private Instant firstInstant(JsonNode firstNode, String firstField, JsonNode secondNode, String secondField) {
|
||||
Instant firstValue = parseInstant(text(firstNode, firstField));
|
||||
if (firstValue != null) {
|
||||
return firstValue;
|
||||
}
|
||||
return parseInstant(text(secondNode, secondField));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将渠道等稳定代码转为大写,缺失时使用服务端默认值。
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user