Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-charging-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 93a6874e
authored
Nov 03, 2023
by
tiger
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
req rsp
1 parent
26a08e7f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
62 deletions
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/base/TcpReq.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/base/TcpRsp.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/req/DefaultReqHandler.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/LoginReq.java
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/base/TcpReq.java
View file @
93a6874
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
base
;
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
base
;
public
interface
TcpReq
<
D
extends
TcpData
>
{
public
class
TcpReq
<
D
extends
TcpData
>
extends
TcpBase
<
D
>
{
public
TcpReq
(
byte
type
)
{
super
(
type
);
}
public
TcpReq
()
{
this
(
TcpMapper
.
CMD_BLANK
.
getType
());
}
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/base/TcpRsp.java
View file @
93a6874
...
@@ -7,8 +7,6 @@ import lombok.Setter;
...
@@ -7,8 +7,6 @@ import lombok.Setter;
@Setter
@Setter
public
class
TcpRsp
<
D
extends
TcpData
>
extends
TcpBase
<
D
>
{
public
class
TcpRsp
<
D
extends
TcpData
>
extends
TcpBase
<
D
>
{
protected
int
error
;
public
TcpRsp
(
byte
type
)
{
public
TcpRsp
(
byte
type
)
{
super
(
type
);
super
(
type
);
}
}
...
...
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/handler/req/DefaultReqHandler.java
View file @
93a6874
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
handler
.
req
;
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
handler
.
req
;
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.
protocol.LoginRsp
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.
base.TcpReq
;
import
cn.
hutool.core.codec.Base64
;
import
cn.
com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpRsp
;
import
io.netty.channel.Channel
;
import
io.netty.channel.Channel
;
import
lombok.extern.slf4j.Slf4j
;
@Slf4j
/**
public
class
DefaultReqHandler
implements
TcpHandler
<
TcpBase
<
TcpData
>,
LoginRsp
>
{
* 默认请求处理器
*
* @author kome
* @date 2023年11月3日 下午3:56:53
*/
public
class
DefaultReqHandler
implements
TcpHandler
<
TcpReq
<
TcpData
>,
TcpRsp
<
TcpData
>>
{
@Override
@Override
public
LoginRsp
handle
(
Channel
channel
,
TcpBase
<
TcpData
>
req
)
{
public
TcpRsp
<
TcpData
>
handle
(
Channel
channel
,
TcpReq
<
TcpData
>
req
)
{
LoginRsp
trsp
=
new
LoginRsp
();
TcpRsp
<
TcpData
>
rsp
=
new
TcpRsp
<>();
// trsp.setReqKey(req.getReqKey());
return
rsp
;
// LoginQrcodeTcpData tdata = new LoginQrcodeTcpData();
// trsp.setData(tdata);
//
// try {
// DllClient client = DllFacade.openNewWxwork(req.getData().getUserId(), 0, "TcpReq");
//
// if (client == null) {
// trsp.setError(TcpErrorEnum.ERROR_OPERATION_FAILED.getError());
// return trsp;
// }
//
// SelfInfoDllData userInfo = client.getUserInfo();
// if (userInfo == null || userInfo.getUserId() == null) {
// int i = 50;
// while (client.getQrcodeData() == null && i-- > 0) {
// try {
// Thread.sleep(100);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// }
// LoginQrcodeDllData data = client.getQrcodeData();
// if (data == null || data.getBase64EncodePath() == null) {
// trsp.setError(TcpErrorEnum.ERROR_OPERATION_FAILED.getError());
// return trsp;
// }
// String imagePath = data.getBase64EncodePath();
// log.info("loginQrcodePath:{}", imagePath);
// byte[] bytes = FileUtil.readBytes(new File(imagePath));
// tdata.setBase64EncodeQrcode(Base64.encode(bytes));
// tdata.setLoginQrcodeKey(data.getLoginQrcodeKey());
// } else {
// BeanUtils.copyProperties(userInfo, tdata);
// }
// } catch (Exception e) {
// e.printStackTrace();
// //
// trsp.setError(TcpErrorEnum.ERROR_USERID_NOT_LOGIN.getError());
// }
return
trsp
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
s
=
"{RDpc08O7p8S/wrxcztK1xM7EtbVcV1hXb3JrXHg1NDFpOG1rRzAzcUFWakxcSW1hZ2VcNTg4MjNhYzItNmVhNi00ZDJjLWE0OWUtNDZjZWM2ZTMzNzZhLmpwZw==}"
;
System
.
out
.
println
(
Base64
.
decodeStr
(
s
));
System
.
out
.
println
(
new
String
(
Base64
.
decode
(
s
.
getBytes
(
"GBK"
)),
"GBK"
));
}
}
}
}
platform-charging/src/main/java/cn/com/glsx/charging/modules/gbt/ocpp16/tcp/protocol/LoginReq.java
View file @
93a6874
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
protocol
;
package
cn
.
com
.
glsx
.
charging
.
modules
.
gbt
.
ocpp16
.
tcp
.
protocol
;
import
cn.com.glsx.charging.modules.gbt.ocpp16.tcp.base.TcpBase
;
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.LoginReqData
;
...
@@ -9,7 +8,7 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.LoginReqData;
...
@@ -9,7 +8,7 @@ import cn.com.glsx.charging.modules.gbt.ocpp16.tcp.data.LoginReqData;
* @author kome.jiang
* @author kome.jiang
* @date 2022年9月28日 下午2:48:32
* @date 2022年9月28日 下午2:48:32
*/
*/
public
class
LoginReq
extends
Tcp
Base
<
LoginReqData
>
implements
Tcp
Req
<
LoginReqData
>
{
public
class
LoginReq
extends
TcpReq
<
LoginReqData
>
{
public
LoginReq
()
{
public
LoginReq
()
{
super
(
TcpMapper
.
CMD_REQ_LOGIN
.
getType
());
super
(
TcpMapper
.
CMD_REQ_LOGIN
.
getType
());
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment