diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/server/electricbicycles/ElectricBicyclesServerHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/server/electricbicycles/ElectricBicyclesServerHandler.java index d8f1e65d5..e4d613969 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/server/electricbicycles/ElectricBicyclesServerHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/server/electricbicycles/ElectricBicyclesServerHandler.java @@ -1,6 +1,5 @@ package com.jsowell.netty.server.electricbicycles; -import com.alibaba.fastjson2.JSON; import com.google.common.collect.Lists; import com.jsowell.common.enums.ykc.PileChannelEntity; import com.jsowell.common.util.BytesUtil; @@ -61,10 +60,7 @@ public class ElectricBicyclesServerHandler extends ChannelInboundHandlerAdapter */ @Override public void channelRead(ChannelHandlerContext ctx, Object message) throws Exception { - Channel channel = ctx.channel(); - log.info("收到消息, channelId:{}, msg:{}", channel.id().toString(), JSON.toJSONString(message)); byte[] msg = (byte[]) message; - // 处理数据 byte[] response = eBikeService.process(msg, ctx); if (Objects.nonNull(response)) { diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/impl/EBikeBusinessServiceImpl.java b/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/impl/EBikeBusinessServiceImpl.java index 571f4ad9b..1b8d68164 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/impl/EBikeBusinessServiceImpl.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/impl/EBikeBusinessServiceImpl.java @@ -36,6 +36,7 @@ public class EBikeBusinessServiceImpl implements EBikeBusinessService { EBikeDataProtocol ykcDataProtocol = new EBikeDataProtocol(msg); // 获取帧类型 String command = BytesUtil.bin2HexStr(ykcDataProtocol.getCommand()); + log.info("收到消息, channelId:{}, msg:{}", ctx.channel().id().toString(), BytesUtil.binary(msg, 16)); // 获取业务处理handler AbstractEBikeHandler invokeStrategy = EBikeOperateFactory.getInvokeStrategy(command); if (invokeStrategy != null) {