Commit 7f29c4cb by zhouhaibao

[+]代码包结构调整

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