【添加】添加用户删除接口逻辑
This commit is contained in:
+24
-2
@@ -122,8 +122,30 @@ public class SyncIamController {
|
||||
}
|
||||
|
||||
@PostMapping({"/UserDeleteService"})
|
||||
public SendPoSystemPo userDeleteService(@RequestBody AcceptPoSystemPo<IamUserAcceptDto> iamUserInfo) {
|
||||
SendPoSystemPo sendPoSystemPo = new SendPoSystemPo();
|
||||
public SendPoSystemPo userDeleteService(@RequestBody AcceptPoSystemPo<IamUserAcceptDto> iamUserInfo) throws JsonProcessingException {
|
||||
if (iamUserInfo == null
|
||||
|| iamUserInfo.getMessageTabels() == null
|
||||
|| iamUserInfo.getMessageTabels().getHeader() == null
|
||||
|| iamUserInfo.getMessageTabels().getHeader().getData() == null){
|
||||
throw new IamGlobalException(null, "参数传递错误,未收到参数");
|
||||
}
|
||||
|
||||
// 对核心数据解密
|
||||
String bodyParam = iamUserInfo.getMessageTabels().getHeader().getData();
|
||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
IamUserAcceptDto userAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamUserAcceptDto.class);
|
||||
|
||||
// 校验身份认证,确保接口正确 必须调用!
|
||||
this.syncIamService.validateUserAndPwd(userAcceptDto);
|
||||
|
||||
// 处理业务逻辑,存储用户,返回用户id
|
||||
IamCommonResponseDto iamCommonResponseDto = this.syncIamService.userDeleteService(userAcceptDto);
|
||||
|
||||
// 处理统一响应PO层,并加密业务字段
|
||||
MessageHeader acceptMessageHeader = iamUserInfo.getMessageHeader();
|
||||
SendPoSystemPo sendPoSystemPo = this.syncIamService.handlerGloablResponse(acceptMessageHeader, iamCommonResponseDto);
|
||||
|
||||
return sendPoSystemPo;
|
||||
}
|
||||
|
||||
+20
@@ -214,6 +214,26 @@ public class SyncIamService {
|
||||
* @param userAcceptDto
|
||||
* @return
|
||||
*/
|
||||
public IamCommonResponseDto userDeleteService(IamUserAcceptDto userAcceptDto){
|
||||
if (userAcceptDto == null || StrUtil.isEmpty(userAcceptDto.getBimUid())){
|
||||
throw new IamGlobalException(userAcceptDto.getBimRequestId(), "用户id(bimUid)为空,无法进行用户删除");
|
||||
}
|
||||
|
||||
this.sysUserService.deleteUser(userAcceptDto.getBimUid());
|
||||
|
||||
IamCommonResponseDto iamCommonResponseDto = new IamCommonResponseDto();
|
||||
iamCommonResponseDto.setBimRequestId(userAcceptDto.getBimRequestId());
|
||||
iamCommonResponseDto.setResultCode(DockingConstant.IAM_SUCCESS_RESULT_CODE);
|
||||
iamCommonResponseDto.setMessage(DockingConstant.IAM_SUCCESS_MESSAGE);
|
||||
|
||||
return iamCommonResponseDto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
* @param userAcceptDto
|
||||
* @return
|
||||
*/
|
||||
public IamCommonResponseDto userUpdateService(IamUserAcceptDto userAcceptDto){
|
||||
if (userAcceptDto == null || StrUtil.isEmpty(userAcceptDto.getBimUid())){
|
||||
throw new IamGlobalException(userAcceptDto.getBimRequestId(), "用户id(bimUid)为空,无法进行用户信息更新");
|
||||
|
||||
Reference in New Issue
Block a user