IAM 返回值 returnCode 改为 resultCode
作者 Xia Zekun <xiazekun@sinotruk.com>,2024/2/21 16:08
This commit is contained in:
+6
-5
@@ -336,7 +336,7 @@ public class SyncIamController {
|
|||||||
SendPoEncryptPo sendPoEncryptPo = new SendPoEncryptPo();
|
SendPoEncryptPo sendPoEncryptPo = new SendPoEncryptPo();
|
||||||
|
|
||||||
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getType())){
|
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getType())){
|
||||||
bpmcResponseDto.setReturnCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
bpmcResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
||||||
bpmcResponseDto.setMessage("接口类型(type)未传参,请检查");
|
bpmcResponseDto.setMessage("接口类型(type)未传参,请检查");
|
||||||
log.error(bpmcResponseDto.getMessage());
|
log.error(bpmcResponseDto.getMessage());
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
||||||
@@ -345,7 +345,7 @@ public class SyncIamController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getEntity())){
|
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getEntity())){
|
||||||
bpmcResponseDto.setReturnCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
bpmcResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
||||||
bpmcResponseDto.setMessage("数据实体(entity)未传参,请检查");
|
bpmcResponseDto.setMessage("数据实体(entity)未传参,请检查");
|
||||||
log.error(bpmcResponseDto.getMessage());
|
log.error(bpmcResponseDto.getMessage());
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
||||||
@@ -354,7 +354,7 @@ public class SyncIamController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getAction())){
|
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getAction())){
|
||||||
bpmcResponseDto.setReturnCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
bpmcResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
||||||
bpmcResponseDto.setMessage("操作方式(action)未传参,请检查");
|
bpmcResponseDto.setMessage("操作方式(action)未传参,请检查");
|
||||||
log.error(bpmcResponseDto.getMessage());
|
log.error(bpmcResponseDto.getMessage());
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
||||||
@@ -363,7 +363,7 @@ public class SyncIamController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getSignature())){
|
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getSignature())){
|
||||||
bpmcResponseDto.setReturnCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
bpmcResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
||||||
bpmcResponseDto.setMessage("签名(signature)未传参,请检查");
|
bpmcResponseDto.setMessage("签名(signature)未传参,请检查");
|
||||||
log.error(bpmcResponseDto.getMessage());
|
log.error(bpmcResponseDto.getMessage());
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
||||||
@@ -374,7 +374,7 @@ public class SyncIamController {
|
|||||||
// 验证签名
|
// 验证签名
|
||||||
String validateSign = SHA256Util.getSHA256StrJava(bpmcAcceptDto.getEntity() + bpmcAppkey + bpmcAcceptDto.getTimestamp());
|
String validateSign = SHA256Util.getSHA256StrJava(bpmcAcceptDto.getEntity() + bpmcAppkey + bpmcAcceptDto.getTimestamp());
|
||||||
if (!bpmcAcceptDto.getSignature().equals(validateSign)){
|
if (!bpmcAcceptDto.getSignature().equals(validateSign)){
|
||||||
bpmcResponseDto.setReturnCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
bpmcResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
||||||
bpmcResponseDto.setMessage("签名校验不通过,请检查");
|
bpmcResponseDto.setMessage("签名校验不通过,请检查");
|
||||||
log.error(bpmcResponseDto.getMessage());
|
log.error(bpmcResponseDto.getMessage());
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
||||||
@@ -418,6 +418,7 @@ public class SyncIamController {
|
|||||||
sendPoEncryptPo.getReturns().setData(JSON.toJSONString(bpmcResponseDto));
|
sendPoEncryptPo.getReturns().setData(JSON.toJSONString(bpmcResponseDto));
|
||||||
return sendPoEncryptPo;
|
return sendPoEncryptPo;
|
||||||
}
|
}
|
||||||
|
|
||||||
private BpmcResponseDto bpmcTypeRoleResource(ObjectMapper objectMapper, BpmcAcceptDto bpmcAcceptDto, BpmcResponseDto bpmcResponseDto) throws JsonProcessingException {
|
private BpmcResponseDto bpmcTypeRoleResource(ObjectMapper objectMapper, BpmcAcceptDto bpmcAcceptDto, BpmcResponseDto bpmcResponseDto) throws JsonProcessingException {
|
||||||
List<RoleResourceDto> roleResourceDtoList = objectMapper.readValue(bpmcAcceptDto.getEntity(), new TypeReference<List<RoleResourceDto>>() {});
|
List<RoleResourceDto> roleResourceDtoList = objectMapper.readValue(bpmcAcceptDto.getEntity(), new TypeReference<List<RoleResourceDto>>() {});
|
||||||
// 根据新增/删除调用不同的业务处理代码
|
// 根据新增/删除调用不同的业务处理代码
|
||||||
|
|||||||
+4
-4
@@ -5,12 +5,12 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class BpmcResponseDto {
|
public class BpmcResponseDto {
|
||||||
|
|
||||||
private String returnCode;
|
private String resultCode;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "{" +
|
return "{" +
|
||||||
"returnCode:'" + returnCode + '\'' +
|
"resultCode:'" + resultCode + '\'' +
|
||||||
", message:'" + message + '\'' +
|
", message:'" + message + '\'' +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ public class BpmcResponseDto {
|
|||||||
private String message;
|
private String message;
|
||||||
public static BpmcResponseDto success(){
|
public static BpmcResponseDto success(){
|
||||||
BpmcResponseDto bpmcResponseDto = new BpmcResponseDto();
|
BpmcResponseDto bpmcResponseDto = new BpmcResponseDto();
|
||||||
bpmcResponseDto.returnCode = "200"; // 成功时固定为200
|
bpmcResponseDto.resultCode = "200"; // 成功时固定为200
|
||||||
bpmcResponseDto.message = "操作成功";
|
bpmcResponseDto.message = "操作成功";
|
||||||
|
|
||||||
return bpmcResponseDto;
|
return bpmcResponseDto;
|
||||||
@@ -26,7 +26,7 @@ public class BpmcResponseDto {
|
|||||||
|
|
||||||
public static BpmcResponseDto error(String message){
|
public static BpmcResponseDto error(String message){
|
||||||
BpmcResponseDto bpmcResponseDto = new BpmcResponseDto();
|
BpmcResponseDto bpmcResponseDto = new BpmcResponseDto();
|
||||||
bpmcResponseDto.returnCode = "500"; // 失败时固定为500
|
bpmcResponseDto.resultCode = "500"; // 失败时固定为500
|
||||||
bpmcResponseDto.message = message;
|
bpmcResponseDto.message = message;
|
||||||
|
|
||||||
return bpmcResponseDto;
|
return bpmcResponseDto;
|
||||||
|
|||||||
Reference in New Issue
Block a user