REQ-3201: 存入initMessageId
This commit is contained in:
parent
20a799353a
commit
eb2537bad9
@ -152,7 +152,7 @@ public class UpdatableMessageManager {
|
||||
historyUpdate.setId(history.getId());
|
||||
MessageBody messageBody = JSON.parseObject(history.getMessageBody(), MessageBody.class);
|
||||
messageBody.setMsgBody(updateSupport
|
||||
.setDataVersion(messageBody.parseMsgBody(), message)
|
||||
.injectUpdatableFields(messageBody.parseMsgBody(), message)
|
||||
.toJSONString());
|
||||
historyUpdate.setMessageBody(JSON.toJSONString(messageBody));
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ public class UpdateSupport {
|
||||
messageBody.setPayload(JSON.toJSONString(imBody));
|
||||
|
||||
history.setMessageBody(JSON.toJSONString(messageBody));
|
||||
messageUpdate.setBizBody(setDataVersion(update.bizBody(), message));
|
||||
messageUpdate.setBizBody(injectUpdatableFields(update.bizBody(), message));
|
||||
|
||||
history.setImMessageTaskId(0L);
|
||||
history.setReceivePersonId(message.getReceiverPersonId());
|
||||
@ -137,10 +137,13 @@ public class UpdateSupport {
|
||||
collector.finish();
|
||||
}
|
||||
|
||||
public JSONObject setDataVersion(JSONObject obj, UpdatableMessage message) {
|
||||
obj.put("bizMessageId", message.getBizMessageId());
|
||||
obj.put("dataVersion", message.getDataVersion());
|
||||
return obj;
|
||||
public JSONObject injectUpdatableFields(JSONObject bizBody, UpdatableMessage message) {
|
||||
MessageUpdateBody body = new MessageUpdateBody();
|
||||
body.setInitMessageId(message.getNimMessageId());
|
||||
body.setBizMessageId(message.getBizMessageId());
|
||||
body.setDataVersion(message.getDataVersion());
|
||||
bizBody.putAll(JSON.parseObject(JSON.toJSONString(body)));
|
||||
return bizBody;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user