mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 电单车协议
This commit is contained in:
@@ -9,6 +9,7 @@ import com.jsowell.common.enums.ykc.PileChannelEntity;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.CRC16Util;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.pile.domain.ebike.AbsEBikeMessage;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -25,17 +26,7 @@ public abstract class AbstractEBikeHandler implements InitializingBean {
|
||||
* 执行逻辑
|
||||
* 有应答
|
||||
*/
|
||||
public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行逻辑
|
||||
* 不需要应答
|
||||
*/
|
||||
// public void pushProcess() {
|
||||
// throw new UnsupportedOperationException();
|
||||
// }
|
||||
public abstract byte[] supplyProcess(Class<? extends AbsEBikeMessage> msg, ChannelHandlerContext ctx);
|
||||
|
||||
/**
|
||||
* 组装应答的结果
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.jsowell.netty.handler.electricbicycles;
|
||||
|
||||
import com.jsowell.common.core.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.pile.domain.ebike.AbsEBikeMessage;
|
||||
import com.jsowell.pile.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.netty.factory.EBikeOperateFactory;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -17,4 +19,16 @@ public class GetServerTimeHandler extends AbstractEBikeHandler {
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
EBikeOperateFactory.register(type, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行逻辑
|
||||
* 有应答
|
||||
*
|
||||
* @param msg
|
||||
* @param ctx
|
||||
*/
|
||||
@Override
|
||||
public byte[] supplyProcess(Class<? extends AbsEBikeMessage> msg, ChannelHandlerContext ctx) {
|
||||
return new byte[0];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.jsowell.netty.handler.electricbicycles;
|
||||
|
||||
import com.jsowell.common.core.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.pile.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.netty.factory.EBikeOperateFactory;
|
||||
import com.jsowell.pile.domain.ebike.AbsEBikeMessage;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -17,4 +19,16 @@ public class HeartbeatHandler extends AbstractEBikeHandler {
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
EBikeOperateFactory.register(type, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行逻辑
|
||||
* 有应答
|
||||
*
|
||||
* @param msg
|
||||
* @param ctx
|
||||
*/
|
||||
@Override
|
||||
public byte[] supplyProcess(Class<? extends AbsEBikeMessage> msg, ChannelHandlerContext ctx) {
|
||||
return new byte[0];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.jsowell.netty.handler.electricbicycles;
|
||||
|
||||
import com.jsowell.common.core.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.pile.domain.ebike.AbsEBikeMessage;
|
||||
import com.jsowell.pile.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.netty.factory.EBikeOperateFactory;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -17,4 +19,16 @@ public class RegistrationHandler extends AbstractEBikeHandler {
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
EBikeOperateFactory.register(type, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行逻辑
|
||||
* 有应答
|
||||
*
|
||||
* @param msg
|
||||
* @param ctx
|
||||
*/
|
||||
@Override
|
||||
public byte[] supplyProcess(Class<? extends AbsEBikeMessage> msg, ChannelHandlerContext ctx) {
|
||||
return new byte[0];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.jsowell.netty.handler.electricbicycles;
|
||||
|
||||
import com.jsowell.common.core.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.pile.domain.ebike.AbsEBikeMessage;
|
||||
import com.jsowell.pile.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.netty.factory.EBikeOperateFactory;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -17,4 +19,16 @@ public class SettlementUploadHandler extends AbstractEBikeHandler {
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
EBikeOperateFactory.register(type, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行逻辑
|
||||
* 有应答
|
||||
*
|
||||
* @param msg
|
||||
* @param ctx
|
||||
*/
|
||||
@Override
|
||||
public byte[] supplyProcess(Class<? extends AbsEBikeMessage> msg, ChannelHandlerContext ctx) {
|
||||
return new byte[0];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user