mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-10 18:30:02 +08:00
update 海南平台对接
This commit is contained in:
@@ -17,6 +17,7 @@ import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
|||||||
import com.jsowell.thirdparty.lianlian.util.Cryptos;
|
import com.jsowell.thirdparty.lianlian.util.Cryptos;
|
||||||
import com.jsowell.thirdparty.lianlian.util.Encodes;
|
import com.jsowell.thirdparty.lianlian.util.Encodes;
|
||||||
import com.jsowell.thirdparty.platform.AbsInterfaceWithPlatformLogic;
|
import com.jsowell.thirdparty.platform.AbsInterfaceWithPlatformLogic;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -31,6 +32,7 @@ import java.util.Map;
|
|||||||
@RequestMapping("/hainan")
|
@RequestMapping("/hainan")
|
||||||
public class HaiNanPlatformController extends BaseController {
|
public class HaiNanPlatformController extends BaseController {
|
||||||
// 使用海南平台处理逻辑
|
// 使用海南平台处理逻辑
|
||||||
|
@Autowired
|
||||||
private AbsInterfaceWithPlatformLogic platformLogic = new HaiNanPlatformLogic();
|
private AbsInterfaceWithPlatformLogic platformLogic = new HaiNanPlatformLogic();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,7 +47,7 @@ public class HaiNanPlatformController extends BaseController {
|
|||||||
logger.info("海南平台请求令牌 result:{}", JSONObject.toJSONString(map));
|
logger.info("海南平台请求令牌 result:{}", JSONObject.toJSONString(map));
|
||||||
return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig"));
|
return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("海南平台 请求令牌接口 异常");
|
logger.error("海南平台 请求令牌接口 异常", e);
|
||||||
return CommonResult.failed("获取token发生异常");
|
return CommonResult.failed("获取token发生异常");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
package com.jsowell.pile.service;
|
package com.jsowell.pile.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
|
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对接平台配置信息Service接口
|
* 对接平台配置信息Service接口
|
||||||
*
|
*
|
||||||
* @author jsowell
|
* @author jsowell
|
||||||
* @date 2023-05-27
|
* @date 2023-05-27
|
||||||
*/
|
*/
|
||||||
public interface ThirdPartyPlatformConfigService
|
public interface ThirdPartyPlatformConfigService {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询对接平台配置信息
|
* 查询对接平台配置信息
|
||||||
*
|
*
|
||||||
@@ -61,6 +61,7 @@ public interface ThirdPartyPlatformConfigService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过operatorId查询配置信息
|
* 通过operatorId查询配置信息
|
||||||
|
*
|
||||||
* @param operatorId
|
* @param operatorId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -293,14 +293,14 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
|||||||
map.put("TimeStamp", dto.getTimeStamp());
|
map.put("TimeStamp", dto.getTimeStamp());
|
||||||
map.put("Seq", dto.getSeq());
|
map.put("Seq", dto.getSeq());
|
||||||
String sign = GBSignUtils.sign(map, signSecret);
|
String sign = GBSignUtils.sign(map, signSecret);
|
||||||
System.out.println(sign);
|
// System.out.println(sign);
|
||||||
|
|
||||||
// 验证签名 得到请求方传过来的签名sig->自己拿到请求体后,再按双方约定的协议生成一个sig->对比两个sig是否一致
|
// 验证签名 得到请求方传过来的签名sig->自己拿到请求体后,再按双方约定的协议生成一个sig->对比两个sig是否一致
|
||||||
if (!StringUtils.equals(dto.getSig(), sign)) {
|
if (!StringUtils.equals(dto.getSig(), sign)) {
|
||||||
System.out.println("签名校验==失败");
|
System.out.println("签名校验==失败");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
System.out.println("签名校验通过!!!");
|
// System.out.println("签名校验通过!!!");
|
||||||
|
|
||||||
// 解密data
|
// 解密data
|
||||||
// byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dto.getData()), operatorSecret.getBytes(), operatorSecret.getBytes());
|
// byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dto.getData()), operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||||
|
|||||||
Reference in New Issue
Block a user