update 电单车协议

This commit is contained in:
Guoqs
2024-08-16 10:03:16 +08:00
parent fc9bde387e
commit af02eab7ce
9 changed files with 211 additions and 63 deletions

View File

@@ -1,7 +1,7 @@
package com.jsowell.netty.server.electricbicycles;
import com.alibaba.fastjson2.JSON;
import com.jsowell.netty.domain.ebike.EBikeMessage;
import com.jsowell.netty.domain.ebike.AbsEBikeMessage;
import io.netty.channel.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@@ -9,10 +9,10 @@ import org.springframework.stereotype.Component;
@ChannelHandler.Sharable
@Slf4j
@Component
public class ChargingPileHandler extends SimpleChannelInboundHandler<EBikeMessage> {
public class ChargingPileHandler extends SimpleChannelInboundHandler<AbsEBikeMessage> {
@Override
protected void channelRead0(ChannelHandlerContext ctx, EBikeMessage msg) throws Exception {
protected void channelRead0(ChannelHandlerContext ctx, AbsEBikeMessage msg) throws Exception {
log.info("收到消息, channelId:{}, msg:{}", ctx.channel().id().toString(), JSON.toJSONString(msg));
}