update 海南平台对接

This commit is contained in:
2024-01-26 16:42:15 +08:00
parent 49e725983e
commit 314ef2a24d
3 changed files with 16 additions and 13 deletions

View File

@@ -17,6 +17,7 @@ import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
import com.jsowell.thirdparty.lianlian.util.Cryptos;
import com.jsowell.thirdparty.lianlian.util.Encodes;
import com.jsowell.thirdparty.platform.AbsInterfaceWithPlatformLogic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@@ -31,6 +32,7 @@ import java.util.Map;
@RequestMapping("/hainan")
public class HaiNanPlatformController extends BaseController {
// 使用海南平台处理逻辑
@Autowired
private AbsInterfaceWithPlatformLogic platformLogic = new HaiNanPlatformLogic();
/**
@@ -45,7 +47,7 @@ public class HaiNanPlatformController extends BaseController {
logger.info("海南平台请求令牌 result:{}", JSONObject.toJSONString(map));
return CommonResult.success(0, "请求令牌成功!", map.get("Data"), map.get("Sig"));
} catch (Exception e) {
logger.error("海南平台 请求令牌接口 异常");
logger.error("海南平台 请求令牌接口 异常", e);
return CommonResult.failed("获取token发生异常");
}
}

View File

@@ -1,19 +1,19 @@
package com.jsowell.pile.service;
import java.util.List;
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
import java.util.List;
/**
* 对接平台配置信息Service接口
*
*
* @author jsowell
* @date 2023-05-27
*/
public interface ThirdPartyPlatformConfigService
{
public interface ThirdPartyPlatformConfigService {
/**
* 查询对接平台配置信息
*
*
* @param id 对接平台配置信息主键
* @return 对接平台配置信息
*/
@@ -21,7 +21,7 @@ public interface ThirdPartyPlatformConfigService
/**
* 查询对接平台配置信息列表
*
*
* @param thirdPartyPlatformConfig 对接平台配置信息
* @return 对接平台配置信息集合
*/
@@ -29,7 +29,7 @@ public interface ThirdPartyPlatformConfigService
/**
* 新增对接平台配置信息
*
*
* @param thirdPartyPlatformConfig 对接平台配置信息
* @return 结果
*/
@@ -37,7 +37,7 @@ public interface ThirdPartyPlatformConfigService
/**
* 修改对接平台配置信息
*
*
* @param thirdPartyPlatformConfig 对接平台配置信息
* @return 结果
*/
@@ -45,7 +45,7 @@ public interface ThirdPartyPlatformConfigService
/**
* 批量删除对接平台配置信息
*
*
* @param ids 需要删除的对接平台配置信息主键集合
* @return 结果
*/
@@ -53,7 +53,7 @@ public interface ThirdPartyPlatformConfigService
/**
* 删除对接平台配置信息信息
*
*
* @param id 对接平台配置信息主键
* @return 结果
*/
@@ -61,6 +61,7 @@ public interface ThirdPartyPlatformConfigService
/**
* 通过operatorId查询配置信息
*
* @param operatorId
* @return
*/

View File

@@ -293,14 +293,14 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
map.put("TimeStamp", dto.getTimeStamp());
map.put("Seq", dto.getSeq());
String sign = GBSignUtils.sign(map, signSecret);
System.out.println(sign);
// System.out.println(sign);
// 验证签名 得到请求方传过来的签名sig->自己拿到请求体后再按双方约定的协议生成一个sig->对比两个sig是否一致
if (!StringUtils.equals(dto.getSig(), sign)) {
System.out.println("签名校验==失败");
return null;
}
System.out.println("签名校验通过!!!");
// System.out.println("签名校验通过!!!");
// 解密data
// byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dto.getData()), operatorSecret.getBytes(), operatorSecret.getBytes());