REQ-3345: 返回最新的消息体内容
This commit is contained in:
parent
153c22d332
commit
438ba768c8
@ -16,7 +16,6 @@ import cn.axzo.im.updatable.domain.UpdatableMessages;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
@ -58,12 +57,9 @@ public class GroupMessageController implements GroupMessageApi {
|
||||
for (GroupMessagePageQueryResponse message : messages) {
|
||||
units.findUnit(message.getFromPersonOuId())
|
||||
.ifPresent(unit -> message.setUnitName(unit.getName()));
|
||||
String msgBody = message.getBody().getString("msgBody");
|
||||
UpdatableMessage updatableMessage = updatableMessages
|
||||
updatableMessages
|
||||
.findByNimMessageId(message.getMessageId())
|
||||
.orElse(null);
|
||||
if (StringUtils.isNotBlank(msgBody) && updatableMessage != null)
|
||||
message.getBody().put("msgBody", updatableMessage.getBizBody().toJSONString());
|
||||
.ifPresent(updatableMessage -> updateMsgBody(message, updatableMessage));
|
||||
}
|
||||
PageResp<GroupMessagePageQueryResponse> pageResp = PageResp.list(
|
||||
page.getCurrent(),
|
||||
@ -73,4 +69,8 @@ public class GroupMessageController implements GroupMessageApi {
|
||||
return ApiPageResult.ok(pageResp);
|
||||
}
|
||||
|
||||
private void updateMsgBody(GroupMessagePageQueryResponse message, UpdatableMessage updatableMessage) {
|
||||
message.getBody().put("msgBody", updatableMessage.getBizBody().toJSONString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user