mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
Merge branch 'dev-new' into dev-new-rabbitmq
# Conflicts: # jsowell-netty/src/main/java/com/jsowell/netty/server/yunkuaichong/NettyServerChannelInitializer.java
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.jsowell.netty.service.yunkuaichong;
|
||||
|
||||
import io.netty.channel.Channel;
|
||||
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelId;
|
||||
|
||||
@@ -18,6 +18,8 @@ public interface YKCBusinessService {
|
||||
*/
|
||||
byte[] process(byte[] msg, ChannelHandlerContext ctx);
|
||||
|
||||
byte[] process(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx);
|
||||
|
||||
/**
|
||||
* 桩退出
|
||||
* @param channelId channelId
|
||||
|
||||
@@ -49,6 +49,20 @@ public class YKCBusinessServiceImpl implements YKCBusinessService {
|
||||
return invokeStrategy.supplyProcess(ykcDataProtocol, ctx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] process(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx) {
|
||||
if (!YKCUtils.checkMsg(ykcDataProtocol)) {
|
||||
// 校验不通过,丢弃消息
|
||||
return null;
|
||||
}
|
||||
// 获取帧类型
|
||||
String frameType = YKCUtils.frameType2Str(ykcDataProtocol.getFrameType());
|
||||
// 获取业务处理handler
|
||||
AbstractYkcHandler invokeStrategy = YKCOperateFactory.getInvokeStrategy(frameType);
|
||||
// AbstractYkcHandlerV2 invokeStrategy = ykcOperateFactoryV2.getInvokeStrategy(frameType);
|
||||
return invokeStrategy.supplyProcess(ykcDataProtocol, ctx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exit(ChannelId channelId) {
|
||||
// 获取桩编号
|
||||
|
||||
Reference in New Issue
Block a user