Commit 7f29c4cb by zhouhaibao

[+]代码包结构调整

1 parent 93a6874e
Showing 14 changed files with 199 additions and 204 deletions
...@@ -101,11 +101,6 @@ ...@@ -101,11 +101,6 @@
</dependency> </dependency>
<!-- swagger end --> <!-- swagger end -->
<dependency>
<groupId>cn.com.glsx</groupId>
<artifactId>platform-process</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package cn.com.glsx.charging.modules.gbt.ocpp16; package cn.com.glsx.charging.modules.gbt.ocpp16;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.client.TcpClient; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.client.TcpClient;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.LoginReqData; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.login.LoginReqData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginReq; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginReq;
public class ClientMain { public class ClientMain {
......
...@@ -11,7 +11,7 @@ import com.google.common.collect.Maps; ...@@ -11,7 +11,7 @@ import com.google.common.collect.Maps;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpBase; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpBase;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.LoginReqData; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.login.LoginReqData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginReq; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginReq;
import cn.com.glsx.charging.util.ByteUtils; import cn.com.glsx.charging.util.ByteUtils;
import cn.com.glsx.charging.util.ClassUtil; import cn.com.glsx.charging.util.ClassUtil;
......
...@@ -5,7 +5,7 @@ import java.util.Map; ...@@ -5,7 +5,7 @@ import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.rsp.LoginRspHandler; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.login.rsp.LoginRspHandler;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
......
...@@ -8,7 +8,7 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpBase; ...@@ -8,7 +8,7 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpBase;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.rsp.DefaultRspHandler; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.DefaultRspHandler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.server.TcpServer; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.server.TcpServer;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler; import io.netty.channel.SimpleChannelInboundHandler;
......
package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data; package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.login;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
/** /**
* 68(起始标志)22(数据长度)0000(序列号域)00(加密标志)01(类型)55031412782305 * 68(起始标志)22(数据长度)0000(序列号域)00(加密标志)01(类型)55031412782305
* (桩编码)00(桩类型)02(充电枪数量)0F(通信协议版本:V1.5)56342E312E353000(程 * (桩编码)00(桩类型)02(充电枪数量)0F(通信协议版本:V1.5)56342E312E353000(程
* 序版本:v4.1.50)01(网络链接类型)01010101010101010101(sim 卡)04(运营商)675A(帧 * 序版本:v4.1.50)01(网络链接类型)01010101010101010101(sim 卡)04(运营商)675A(帧
* 校验域 * 校验域
* *
* @author kome * @author kome
* @date 2023年11月1日 下午6:00:39 * @date 2023年11月1日 下午6:00:39
*/ */
@Getter @Getter
@Setter @Setter
public class LoginReqData extends TcpData { public class LoginReqData extends TcpData {
/** /**
* 充电桩id: BCD 码 ,不足 7 位补 0 * 充电桩id: BCD 码 ,不足 7 位补 0
*/ */
private byte[] pointId = new byte[7]; private byte[] pointId = new byte[7];
/** /**
* 0 表示直流桩,1 表示交流桩 * 0 表示直流桩,1 表示交流桩
*/ */
private byte pointType; private byte pointType;
/** /**
* 充电枪数量 * 充电枪数量
*/ */
private byte gunCount; private byte gunCount;
/** /**
* 通信协议版本 BIN 码 1 版本号乘 10,v1.0 表示 0x0A * 通信协议版本 BIN 码 1 版本号乘 10,v1.0 表示 0x0A
*/ */
private byte protocolVersion; private byte protocolVersion;
/** /**
* 程序版本 ASCII 码 8 不足 8 位补零 * 程序版本 ASCII 码 8 不足 8 位补零
*/ */
@JsonSerialize @JsonSerialize
private byte[] softVersion = new byte[8]; private byte[] softVersion = new byte[8];
/** /**
* 网络链接类型 * 网络链接类型
* 0x00 SIM 卡 * 0x00 SIM 卡
* 0x01 LAN * 0x01 LAN
* 0x02 WAN * 0x02 WAN
* 0x03 其他 * 0x03 其他
*/ */
private byte network; private byte network;
/** /**
* Sim 卡 BCD 码 10 不足 10 位补零,取不到置零 * Sim 卡 BCD 码 10 不足 10 位补零,取不到置零
*/ */
private byte[] sim = new byte[10]; private byte[] sim = new byte[10];
/** /**
* 运营商 BIN 码 * 运营商 BIN 码
* 0x00 移动 * 0x00 移动
* 0x02 电信 * 0x02 电信
* 0x03 联通 * 0x03 联通
* 0x04 其他 * 0x04 其他
*/ */
private byte operator; private byte operator;
} }
package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data; package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.login;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
/** /**
* 68(起始标志)0C(数据长度)0000(序列号域)00(加密标志)02(类型)55 03 14 12 78 23 * 68(起始标志)0C(数据长度)0000(序列号域)00(加密标志)02(类型)55 03 14 12 78 23
* 05(桩编码)00(登陆结果:成功)DA 4C(帧校验域) * 05(桩编码)00(登陆结果:成功)DA 4C(帧校验域)
* *
* @author kome * @author kome
* @date 2023年11月1日 下午6:00:39 * @date 2023年11月1日 下午6:00:39
*/ */
@Getter @Getter
@Setter @Setter
public class LoginRspData extends TcpData { public class LoginRspData extends TcpData {
/** /**
* 充电桩id: BCD 码 ,不足 7 位补 0 * 充电桩id: BCD 码 ,不足 7 位补 0
*/ */
private byte[] pointId = new byte[7]; private byte[] pointId = new byte[7];
/** /**
* 登陆结果: 0x00:登陆成功 0x01:登陆失败 * 登陆结果: 0x00:登陆成功 0x01:登陆失败
*/ */
private byte result; private byte result;
} }
package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.req; package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpReq; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpReq;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp;
import io.netty.channel.Channel; import io.netty.channel.Channel;
/** /**
* 默认请求处理器 * 默认请求处理器
* *
* @author kome * @author kome
* @date 2023年11月3日 下午3:56:53 * @date 2023年11月3日 下午3:56:53
*/ */
public class DefaultReqHandler implements TcpHandler<TcpReq<TcpData>, TcpRsp<TcpData>> { public class DefaultReqHandler implements TcpHandler<TcpReq<TcpData>, TcpRsp<TcpData>> {
@Override @Override
public TcpRsp<TcpData> handle(Channel channel, TcpReq<TcpData> req) { public TcpRsp<TcpData> handle(Channel channel, TcpReq<TcpData> req) {
TcpRsp<TcpData> rsp = new TcpRsp<>(); TcpRsp<TcpData> rsp = new TcpRsp<>();
return rsp; return rsp;
} }
} }
package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.rsp; package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.LoginRspData; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.login.LoginRspData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginRsp; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginRsp;
import io.netty.channel.Channel; import io.netty.channel.Channel;
public class DefaultRspHandler implements TcpHandler<LoginRsp, LoginRsp> { public class DefaultRspHandler implements TcpHandler<LoginRsp, LoginRsp> {
@Override @Override
public LoginRsp handle(Channel channel, LoginRsp req) { public LoginRsp handle(Channel channel, LoginRsp req) {
LoginRsp trsp = new LoginRsp(); LoginRsp trsp = new LoginRsp();
LoginRspData data = new LoginRspData(); LoginRspData data = new LoginRspData();
data.setPointId(null); data.setPointId(null);
data.setResult((byte) 0); data.setResult((byte) 0);
// SpringContextUtil.getApplicationContext().getBean(null); // SpringContextUtil.getApplicationContext().getBean(null);
log.info("xxxx"); log.info("xxxx");
trsp.setData(data); trsp.setData(data);
return trsp; return trsp;
} }
} }
package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.req; package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.login.req;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginReq; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginReq;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginRsp; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginRsp;
import io.netty.channel.Channel; import io.netty.channel.Channel;
public class LoginReqHandler implements TcpHandler<LoginReq, LoginRsp> { public class LoginReqHandler implements TcpHandler<LoginReq, LoginRsp> {
@Override @Override
public LoginRsp handle(Channel channel, LoginReq req) { public LoginRsp handle(Channel channel, LoginReq req) {
LoginRsp trsp = new LoginRsp(); LoginRsp trsp = new LoginRsp();
// trsp.setReqKey(req.getReqKey()); // trsp.setReqKey(req.getReqKey());
return trsp; return trsp;
} }
} }
package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.rsp; package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.login.rsp;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.LoginRspData; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.login.LoginRspData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginRsp; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol.LoginRsp;
import io.netty.channel.Channel; import io.netty.channel.Channel;
public class LoginRspHandler implements TcpHandler<LoginRsp, LoginRsp> { public class LoginRspHandler implements TcpHandler<LoginRsp, LoginRsp> {
@Override @Override
public LoginRsp handle(Channel channel, LoginRsp req) { public LoginRsp handle(Channel channel, LoginRsp req) {
LoginRsp trsp = new LoginRsp(); LoginRsp trsp = new LoginRsp();
LoginRspData data = new LoginRspData(); LoginRspData data = new LoginRspData();
data.setPointId(null); data.setPointId(null);
data.setResult((byte) 0); data.setResult((byte) 0);
// SpringContextUtil.getApplicationContext().getBean(null); // SpringContextUtil.getApplicationContext().getBean(null);
log.info("xxxx"); log.info("xxxx");
trsp.setData(data); trsp.setData(data);
return trsp; return trsp;
} }
} }
...@@ -2,7 +2,7 @@ package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol; ...@@ -2,7 +2,7 @@ package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpReq; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpReq;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.LoginReqData; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.login.LoginReqData;
/** /**
* @author kome.jiang * @author kome.jiang
......
...@@ -2,7 +2,7 @@ package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol; ...@@ -2,7 +2,7 @@ package cn.com.glsx.charging.modules.gbt.ocpp16.tcp.protocol;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.LoginRspData; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.login.LoginRspData;
/** /**
* 获取登录二维码(请求data为空) * 获取登录二维码(请求data为空)
......
...@@ -8,7 +8,7 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpBase; ...@@ -8,7 +8,7 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpBase;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpData;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpHandler;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpMapper;
import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.req.DefaultReqHandler; import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.handler.DefaultReqHandler;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler; import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!