update 电单车协议

This commit is contained in:
Guoqs
2024-08-15 11:25:47 +08:00
parent 415f7c4b36
commit a6a799f5f0
3 changed files with 8 additions and 17 deletions

View File

@@ -1,27 +1,18 @@
package com.jsowell.netty.server.electricbicycles;
import com.alibaba.fastjson2.JSON;
import com.jsowell.common.util.BytesUtil;
import com.jsowell.netty.domain.ChargingPileMessage;
import com.jsowell.netty.domain.EBikeMessage;
import io.netty.channel.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.swing.*;
import java.net.InetSocketAddress;
import java.time.Instant;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
@ChannelHandler.Sharable
@Slf4j
@Component
public class ChargingPileHandler extends SimpleChannelInboundHandler<ChargingPileMessage> {
public class ChargingPileHandler extends SimpleChannelInboundHandler<EBikeMessage> {
@Override
protected void channelRead0(ChannelHandlerContext ctx, ChargingPileMessage msg) throws Exception {
protected void channelRead0(ChannelHandlerContext ctx, EBikeMessage msg) throws Exception {
log.info("收到消息, channelId:{}, msg:{}", ctx.channel().id().toString(), JSON.toJSONString(msg));
}