Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init

This commit is contained in:
zhangchenbiao
2024-04-11 14:07:42 +08:00
3 changed files with 7 additions and 6 deletions

View File

@@ -144,6 +144,10 @@ public enum ErrorCodeEnum {
TIME_FALSE(109002, "结束时间不能早于开始时间",null),
BUSINESS_ID_NOT_EXIST(109003, "kdzBusinessId解析异常,请检查",null),
VERIFY_MD5_FALSE(109004, "验签失败,请检查",null),
;

View File

@@ -34,7 +34,7 @@ public class KdzApiServiceImpl implements KdzApiService {
String kdzBusinessId = request.getKdzBusinessId();
String lineId = splitMethod(kdzBusinessId);
if (StringUtil.isBlank(lineId)){
throw new ServiceException("kdzBusinessId解析异常,请检查");
throw new ServiceException(ErrorCodeEnum.BUSINESS_ID_NOT_EXIST);
}
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(Long.valueOf(lineId));
if (Objects.isNull(lineInfoDO)){

View File

@@ -31,7 +31,7 @@ public class KdzApiController {
@RequestBody XfsgOpenApiRequest request) {
log.info("auditResult requestBody :{}", JSONObject.toJSONString(request));
if(!verifyMD5(request,eid)){
return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
return ResponseResult.fail(ErrorCodeEnum.VERIFY_MD5_FALSE);
}
if(eid == null || request.getBizContent() == null){
return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
@@ -46,11 +46,8 @@ public class KdzApiController {
//用户唯一标识id
sb.append("timestamp=").append(request.getTimestamp()).append("&");
//企业唯一标识enterpriseId
sb.append("enterpriseId=").append(eid).append("&");
sb.append("bizContent=").append(request.getBizContent());
sb.append("enterpriseId=").append(eid);
String md5 = EncryptUtil.xfsgMd5(sb.toString());
return md5.equals(request.getSign());
}