Skip to content

Commit

Permalink
feat: 严格遵守协议,null 值一样输出
Browse files Browse the repository at this point in the history
Signed-off-by: Ke Jie <[email protected]>
  • Loading branch information
chzealot committed Sep 21, 2023
1 parent 6294aa6 commit f0c7367
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.dingtalk.open.app.stream.network.ws;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.dingtalk.open.app.stream.network.api.Context;
import com.dingtalk.open.app.stream.network.api.ServiceException;
import com.dingtalk.open.app.stream.network.api.logger.InternalLogger;
Expand Down Expand Up @@ -28,7 +29,7 @@ public WebSocketContext(String connectionId, ProtocolRequestFacade request, Chan
@Override
public void replay(Object payload) {
ProtocolResponse response = ProtocolResponse.new200Response(request);
response.setData(JSON.toJSONString(payload));
response.setData(JSON.toJSONString(payload, SerializerFeature.WriteMapNullValue));
context.writeAndFlush(response).addListener(future -> {
if (!future.isSuccess()) {
LOGGER.error("[DingTalk] websocket connection reply response failed, connectionId={}, messageId={}", connectionId, request.getMessageId(), future.cause());
Expand Down

0 comments on commit f0c7367

Please sign in to comment.