update 海南平台对接

This commit is contained in:
2024-01-25 16:00:35 +08:00
parent 77777b07ea
commit 6e37a276bf
8 changed files with 87 additions and 34 deletions

View File

@@ -60,8 +60,8 @@ public class HaiNanPlatformController extends BaseController {
logger.info("海南平台查询充电站信息 params:{}", JSONObject.toJSONString(dto));
try {
// 校验令牌
String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(token)) {
// String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(request)) {
// 校验失败
return CommonResult.failed("令牌校验错误");
}
@@ -103,8 +103,7 @@ public class HaiNanPlatformController extends BaseController {
logger.info("海南平台查询统计信息 params:{}", JSONObject.toJSONString(dto));
try {
// 校验令牌
String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(token)) {
if (!JWTUtils.checkThirdPartyToken(request)) {
// 校验失败
return CommonResult.failed("令牌校验错误");
}
@@ -146,8 +145,8 @@ public class HaiNanPlatformController extends BaseController {
logger.info("海南平台设备接口状态查询 params:{}", JSONObject.toJSONString(dto));
try {
// 校验令牌
String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(token)) {
// String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(request)) {
// 校验失败
return CommonResult.failed("令牌校验错误");
}
@@ -188,8 +187,8 @@ public class HaiNanPlatformController extends BaseController {
logger.info("请求设备认证 param:{}", JSONObject.toJSONString(dto));
try {
// 校验令牌
String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(token)) {
// String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(request)) {
// 校验失败
return CommonResult.failed("令牌校验错误");
}
@@ -214,7 +213,6 @@ public class HaiNanPlatformController extends BaseController {
return CommonResult.success(0, "请求设备认证成功!", map.get("Data"), map.get("Sig"));
} catch (Exception e) {
logger.info("请求设备认证 error:", e);
e.printStackTrace();
}
return CommonResult.failed("请求设备认证发生异常");
}
@@ -230,8 +228,8 @@ public class HaiNanPlatformController extends BaseController {
logger.info("查询业务策略信息 params:{}", JSONObject.toJSONString(dto));
try {
// 校验令牌
String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(token)) {
// String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(request)) {
// 校验失败
return CommonResult.failed("令牌校验错误");
}
@@ -258,7 +256,6 @@ public class HaiNanPlatformController extends BaseController {
return CommonResult.success(0, "查询业务策略信息成功!", map.get("Data"), map.get("Sig"));
} catch (Exception e) {
logger.info("查询业务策略信息 error:", e);
e.printStackTrace();
}
return CommonResult.failed("查询业务策略信息发生异常");
}
@@ -274,8 +271,7 @@ public class HaiNanPlatformController extends BaseController {
logger.info("海南平台请求启动充电 params :{}", JSONObject.toJSONString(dto));
try {
// 校验令牌
String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(token)) {
if (!JWTUtils.checkThirdPartyToken(request)) {
// 校验失败
return CommonResult.failed("令牌校验错误");
}
@@ -339,8 +335,8 @@ public class HaiNanPlatformController extends BaseController {
logger.info("【{}】查询充电状态 params :{}", this.getClass().getSimpleName(), JSONObject.toJSONString(dto));
try {
// 校验令牌
String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(token)) {
// String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(request)) {
// 校验失败
return CommonResult.failed("令牌校验错误");
}
@@ -404,8 +400,8 @@ public class HaiNanPlatformController extends BaseController {
logger.info("请求停止充电 params :{}", JSONObject.toJSONString(dto));
try {
// 校验令牌
String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(token)) {
// String token = request.getHeader("Authorization");
if (!JWTUtils.checkThirdPartyToken(request)) {
// 校验失败
return CommonResult.failed("令牌校验错误");
}
@@ -435,7 +431,7 @@ public class HaiNanPlatformController extends BaseController {
}
/**
* 新电途推送停止充电结果
* 推送停止充电结果
* http://localhost:8080/hainan/notificationStopChargeResult
* @param orderCode
* @return