diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/handler/electricbicycles/AbstractHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/handler/electricbicycles/AbstractHandler.java index ab7a3bb16..c59a53c16 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/handler/electricbicycles/AbstractHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/handler/electricbicycles/AbstractHandler.java @@ -26,7 +26,7 @@ public abstract class AbstractHandler implements InitializingBean { * 执行逻辑 * 有应答 */ - public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, Channel channel) { + public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx) { throw new UnsupportedOperationException(); } diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/YKCBusinessService.java b/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/YKCBusinessService.java index 9889312e5..4595dcb5f 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/YKCBusinessService.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/YKCBusinessService.java @@ -1,6 +1,7 @@ package com.jsowell.netty.service.electricbicycles; import io.netty.channel.Channel; +import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelId; /** @@ -12,10 +13,10 @@ public interface YKCBusinessService { * 处理桩发来的请求 * 不需要应答的返回null * @param msg 请求报文 - * @param channel 通道信息 + * @param ctx 通道信息 * @return 结果 */ - byte[] process(byte[] msg, Channel channel); + byte[] process(byte[] msg, ChannelHandlerContext ctx); /** * 桩退出 diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/impl/YKCBusinessServiceImpl2.java b/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/impl/YKCBusinessServiceImpl2.java index 4bb81e42a..9451d1361 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/impl/YKCBusinessServiceImpl2.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/service/electricbicycles/impl/YKCBusinessServiceImpl2.java @@ -14,6 +14,7 @@ import com.jsowell.pile.service.PileConnectorInfoService; import com.jsowell.pile.service.PileMsgRecordService; import com.jsowell.pile.service.YKCPushCommandService; import io.netty.channel.Channel; +import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelId; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -36,7 +37,7 @@ public class YKCBusinessServiceImpl2 implements YKCBusinessService { private YKCPushCommandService ykcPushCommandService; @Override - public byte[] process(byte[] msg, Channel channel) { + public byte[] process(byte[] msg, ChannelHandlerContext ctx) { if (!YKCUtils.checkMsg(msg)) { // 校验不通过,丢弃消息 return null; @@ -46,7 +47,7 @@ public class YKCBusinessServiceImpl2 implements YKCBusinessService { String frameType = YKCUtils.frameType2Str(ykcDataProtocol.getFrameType()); // 获取业务处理handler AbstractHandler invokeStrategy = YKCOperateFactory.getInvokeStrategy(frameType); - return invokeStrategy.supplyProcess(ykcDataProtocol, channel); + return invokeStrategy.supplyProcess(ykcDataProtocol, ctx); } @Override