update 甘肃平台、宁夏平台controller

This commit is contained in:
Lemon
2024-11-26 13:32:04 +08:00
parent d1f19ddb11
commit c424069175
5 changed files with 21 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ package com.jsowell.api.thirdparty;
import com.alibaba.fastjson2.JSON;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.pile.thirdparty.CommonParamsDTO;
import com.jsowell.thirdparty.lianlian.common.CommonResult;
@@ -29,6 +30,8 @@ import java.util.Map;
public class GanSuController extends ThirdPartyBaseController{
private final String platformName = "甘肃省平台";
private final String platformType = ThirdPlatformTypeEnum.GAN_SU_PLATFORM.getTypeCode();
@Autowired
@Qualifier("ganSuPlatformServiceImpl")
private ThirdPartyPlatformService platformLogic;
@@ -62,6 +65,7 @@ public class GanSuController extends ThirdPartyBaseController{
// 校验失败
return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR);
}
dto.setPlatformType(platformType);
// 校验签名
if (!verifySignature(dto)) {
@@ -95,6 +99,7 @@ public class GanSuController extends ThirdPartyBaseController{
// 校验失败
return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR);
}
dto.setPlatformType(platformType);
// 校验签名
if (!verifySignature(dto)) {

View File

@@ -3,6 +3,7 @@ package com.jsowell.api.thirdparty;
import com.alibaba.fastjson2.JSON;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.pile.dto.PushRealTimeInfoDTO;
@@ -28,6 +29,8 @@ public class NingXiaController extends ThirdPartyBaseController {
private final String platformName = "宁夏平台";
private final String platformType = ThirdPlatformTypeEnum.NING_XIA_PLATFORM.getTypeCode();
@Autowired
@Qualifier("ningXiaPlatformServiceImpl")
private ThirdPartyPlatformService platformLogic;
@@ -66,6 +69,7 @@ public class NingXiaController extends ThirdPartyBaseController {
// 校验失败
return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR);
}
dto.setPlatformType(platformType);
// 校验签名
if (!verifySignature(dto)) {
@@ -105,6 +109,7 @@ public class NingXiaController extends ThirdPartyBaseController {
// 校验失败
return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR);
}
dto.setPlatformType(platformType);
// 校验签名
if (!verifySignature(dto)) {
@@ -134,6 +139,7 @@ public class NingXiaController extends ThirdPartyBaseController {
// 校验失败
return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR);
}
dto.setPlatformType(platformType);
// 校验签名
if (!verifySignature(dto)) {

View File

@@ -186,7 +186,13 @@ public class ThirdPartyBaseController extends BaseController {
protected boolean verifySignature(CommonParamsDTO dto, String signSecret) {
// 查询密钥
String operatorId = StringUtils.isNotBlank(dto.getOperatorID()) ? dto.getOperatorID() : dto.getPlatformID();
ThirdPartySecretInfoVO secretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId);
ThirdPartySecretInfoVO secretInfoVO;
if (StringUtils.isNotBlank(dto.getPlatformType())) {
// type不为空按照type查
secretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(dto.getPlatformType());
}else {
secretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId);
}
if (secretInfoVO == null) {
throw new BusinessException("1", "无此对接平台");
}