mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-29 23:50:00 +08:00
update 电单车协议
This commit is contained in:
@@ -9,7 +9,6 @@ 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 io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -17,7 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
/**
|
||||
* 模板方法模式
|
||||
*/
|
||||
public abstract class AbstractHandler implements InitializingBean {
|
||||
public abstract class AbstractEBikeHandler implements InitializingBean {
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jsowell.netty.handler.electricbicycles;
|
||||
|
||||
import com.jsowell.common.core.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.netty.factory.EBikeOperateFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 设备心跳包
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class GetServerTimeHandler extends AbstractEBikeHandler {
|
||||
private final String type = EBikeCommandEnum.GET_SERVER_TIME.getCode();
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
EBikeOperateFactory.register(type, this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jsowell.netty.handler.electricbicycles;
|
||||
|
||||
import com.jsowell.common.core.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.netty.factory.EBikeOperateFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 设备心跳包
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class HeartbeatHandler extends AbstractEBikeHandler {
|
||||
private final String type = EBikeCommandEnum.HEARTBEAT_2.getCode();
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
EBikeOperateFactory.register(type, this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jsowell.netty.handler.electricbicycles;
|
||||
|
||||
import com.jsowell.common.core.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.netty.factory.EBikeOperateFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 设备心跳包
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class RegistrationHandler extends AbstractEBikeHandler {
|
||||
private final String type = EBikeCommandEnum.REGISTRATION.getCode();
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
EBikeOperateFactory.register(type, this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jsowell.netty.handler.electricbicycles;
|
||||
|
||||
import com.jsowell.common.core.domain.ebike.EBikeCommandEnum;
|
||||
import com.jsowell.netty.factory.EBikeOperateFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 设备心跳包
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SettlementUploadHandler extends AbstractEBikeHandler {
|
||||
private final String type = EBikeCommandEnum.SETTLEMENT_UPLOAD.getCode();
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
EBikeOperateFactory.register(type, this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user