소스 검색

Merge branch 'develop' of gitadmin/tuoheng_oidc into release

tags/v2.3.0
gitadmin 1 년 전
부모
커밋
fe94e7ade3
2개의 변경된 파일12개의 추가작업 그리고 11개의 파일을 삭제
  1. +3
    -4
      tuoheng_oidc_admin/src/main/java/com/tuoheng/model/param/UpdateUserClientRoleDto.java
  2. +9
    -7
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/ClientUserServiceImpl.java

+ 3
- 4
tuoheng_oidc_admin/src/main/java/com/tuoheng/model/param/UpdateUserClientRoleDto.java 파일 보기

@@ -4,6 +4,7 @@ import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
* @author chenjiandong
@@ -16,10 +17,8 @@ public class UpdateUserClientRoleDto {
@NotEmpty(message = "username can not be empty!")
private String username;

@NotEmpty(message = "clientId can not be empty!")
private String clientId;
@NotNull(message = "clientRoleDtoList can not be null!")
private List<ClientRoleDto> clientRoleDtoList;

@NotNull(message = "roleId can not be null!")
private Integer roleId;
}

+ 9
- 7
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/ClientUserServiceImpl.java 파일 보기

@@ -103,13 +103,15 @@ public class ClientUserServiceImpl implements ClientUserSevice {
if(userPo == null){
return JsonResult.error("该用户不存在!");
}

ClientUserRolePo clientUserRolePo = new ClientUserRolePo()
.setUserId(userPo.getId())
.setClientId(updateUserClientRoleDto.getClientId())
.setRoleId(updateUserClientRoleDto.getRoleId());
clientUserRolePo.setUpdateUser(loginUser.getUserId());
clientUserRoleMapper.updateUserClientRole(clientUserRolePo);
List<ClientRoleDto> clientRoleDtoList = updateUserClientRoleDto.getClientRoleDtoList();
for(ClientRoleDto dto : clientRoleDtoList){
ClientUserRolePo clientUserRolePo = new ClientUserRolePo()
.setUserId(userPo.getId())
.setClientId(dto.getClientId())
.setRoleId(dto.getRoleId());
clientUserRolePo.setUpdateUser(loginUser.getUserId());
clientUserRoleMapper.updateUserClientRole(clientUserRolePo);
}
return JsonResult.success(true);
}


Loading…
취소
저장