Skip to content

Commit

Permalink
[Hot Fix] - Fixed timestamp error
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajjangid05 committed May 5, 2023
1 parent fdd20fb commit f6b8baa
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/java/com/uci/inbound/xmsg/XmsgHistoryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public Mono<Object> getConversationHistory(@RequestParam(value = "botId", requir
log.info("/conversation-history api call... Request: {" + request + "}");
HttpApiResponse response = HttpApiResponse.builder()
.status(HttpStatus.OK.value())
.path("/xmsg/history")
.path("/xmsg/conversation-history")
.build();
if (botId == null || botId.isEmpty()) {
response.setStatus(HttpStatus.BAD_REQUEST.value());
Expand Down Expand Up @@ -400,17 +400,17 @@ public List<Map<String, Object>> filterMessageState(List<XMessageDAO> xMessageDA
payloadMap.put("contactCard", currentXmsg.getPayload().getContactCard());
}
daoMap.put("payload", payloadMap);
daoMap.put("sentTimestamp", sentMap.get(xMessageDAO.getMessageId()).getTimestamp());
daoMap.put("sentTimestamp", sentMap.get(xMessageDAO.getMessageId()).getTimestamp().toString());
} else {
daoMap.put("sentTimestamp", null);
}
if (deliverdMap.get(xMessageDAO.getMessageId()) != null) {
daoMap.put("deliveryTimestamp", deliverdMap.get(xMessageDAO.getMessageId()).getTimestamp());
daoMap.put("deliveryTimestamp", deliverdMap.get(xMessageDAO.getMessageId()).getTimestamp().toString());
} else {
daoMap.put("deliveryTimestamp", null);
}
if (readMap.get(xMessageDAO.getMessageId()) != null) {
daoMap.put("readTimestamp", readMap.get(xMessageDAO.getMessageId()).getTimestamp());
daoMap.put("readTimestamp", readMap.get(xMessageDAO.getMessageId()).getTimestamp().toString());
} else {
daoMap.put("readTimestamp", null);
}
Expand Down Expand Up @@ -465,22 +465,22 @@ public List<Map<String, Object>> filterConversationHistory(List<XMessageDAO> xMe
}
daoMap.put("payload", payloadMap);
if (xMessageDAO.getMessageState().equalsIgnoreCase(XMessage.MessageState.SENT.name())) {
daoMap.put("sentTimestamp", xMessageDAO.getTimestamp());
daoMap.put("sentTimestamp", xMessageDAO.getTimestamp().toString());
} else {
daoMap.put("repliedTimestamp", null);
daoMap.put("sentTimestamp", null);
}
if (xMessageDAO.getMessageState().equalsIgnoreCase(XMessage.MessageState.REPLIED.name())) {
daoMap.put("repliedTimestamp", xMessageDAO.getTimestamp());
daoMap.put("repliedTimestamp", xMessageDAO.getTimestamp().toString());
} else {
daoMap.put("repliedTimestamp", null);
}
if (xMessageDAO.getMessageState().equalsIgnoreCase(XMessage.MessageState.DELIVERED.name())) {
daoMap.put("deliveredTimestamp", xMessageDAO.getTimestamp());
daoMap.put("deliveredTimestamp", xMessageDAO.getTimestamp().toString());
} else {
daoMap.put("deliveredTimestamp", null);
}
if (xMessageDAO.getMessageState().equalsIgnoreCase(XMessage.MessageState.READ.name())) {
daoMap.put("readTimestamp", xMessageDAO.getTimestamp());
daoMap.put("readTimestamp", xMessageDAO.getTimestamp().toString());
} else {
daoMap.put("readTimestamp", null);
}
Expand Down

0 comments on commit f6b8baa

Please sign in to comment.