diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/UserResourceBO.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/UserResourceBO.java index 7c8b9d5..afe4ca2 100644 --- a/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/UserResourceBO.java +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/UserResourceBO.java @@ -63,7 +63,7 @@ public class UserResourceBO implements Serializable { } public String getUserAvatar() { - return userAvatar == null ? "" : userId.trim(); + return userAvatar == null ? "" : userAvatar.trim(); } public void setUserAvatar(String userAvatar) { diff --git a/cloud-common/src/main/java/com/cm/common/component/SecurityComponent.java b/cloud-common/src/main/java/com/cm/common/component/SecurityComponent.java index 21e806c..43de967 100644 --- a/cloud-common/src/main/java/com/cm/common/component/SecurityComponent.java +++ b/cloud-common/src/main/java/com/cm/common/component/SecurityComponent.java @@ -42,6 +42,8 @@ public class SecurityComponent { userInfoBO.setUserUsername(userBO.getUsername()); userInfoBO.setUserName(userBO.getUserName()); userInfoBO.setUserPhone(userBO.getUserPhone()); + userInfoBO.setUserAvatar(userBO.getUserAvatar()); + userInfoBO.setUserEmail(userBO.getUserEmail()); userInfoBO.setDataAuthority(userBO.getDataAuthority()); userInfoBO.setDataAuthorityUserIds(userBO.getDataAuthorityUserIds()); userInfoBO.setBaseDepartmentIds(userBO.getBaseDepartmentIds()); diff --git a/cloud-common/src/main/java/com/cm/common/pojo/bos/UserBO.java b/cloud-common/src/main/java/com/cm/common/pojo/bos/UserBO.java index 2d5951e..c57caba 100644 --- a/cloud-common/src/main/java/com/cm/common/pojo/bos/UserBO.java +++ b/cloud-common/src/main/java/com/cm/common/pojo/bos/UserBO.java @@ -19,6 +19,8 @@ public class UserBO extends User { private String userId; private String userName; private String userPhone; + private String userAvatar; + private String userEmail; private String userUKey; private Integer loginType; private String dataAuthority; @@ -69,6 +71,22 @@ public class UserBO extends User { this.userPhone = userPhone; } + public String getUserAvatar() { + return userAvatar == null ? "" : userAvatar; + } + + public void setUserAvatar(String userAvatar) { + this.userAvatar = userAvatar; + } + + public String getUserEmail() { + return userEmail == null ? "" : userEmail; + } + + public void setUserEmail(String userEmail) { + this.userEmail = userEmail; + } + public String getUserUKey() { return userUKey == null ? "" : userUKey.trim(); } @@ -215,40 +233,25 @@ public class UserBO extends User { @Override public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"userId\":") - .append("\"").append(userId).append("\""); - sb.append(",\"userName\":") - .append("\"").append(userName).append("\""); - sb.append(",\"userPhone\":") - .append("\"").append(userPhone).append("\""); - sb.append(",\"userUKey\":") - .append("\"").append(userUKey).append("\""); - sb.append(",\"loginType\":") - .append(loginType); - sb.append(",\"dataAuthority\":") - .append("\"").append(dataAuthority).append("\""); - sb.append(",\"baseDepartmentIds\":") - .append(baseDepartmentIds); - sb.append(",\"dataAuthorityUserIds\":") - .append(dataAuthorityUserIds); - sb.append(",\"roles\":") - .append(roles); - sb.append(",\"groups\":") - .append(groups); - sb.append(",\"departments\":") - .append(departments); - sb.append(",\"positions\":") - .append(positions); - sb.append(",\"roleIdAndNamesValue\":") - .append("\"").append(roleIdAndNamesValue).append("\""); - sb.append(",\"groupIdAndNamesValue\":") - .append("\"").append(groupIdAndNamesValue).append("\""); - sb.append(",\"departmentIdAndNamesValue\":") - .append("\"").append(departmentIdAndNamesValue).append("\""); - sb.append(",\"positionIdAndNamesValue\":") - .append("\"").append(positionIdAndNamesValue).append("\""); - sb.append('}'); - return sb.toString(); + return "UserBO{" + + "userId='" + userId + '\'' + + ", userName='" + userName + '\'' + + ", userPhone='" + userPhone + '\'' + + ", userAvatar='" + userAvatar + '\'' + + ", userEmail='" + userEmail + '\'' + + ", userUKey='" + userUKey + '\'' + + ", loginType=" + loginType + + ", dataAuthority='" + dataAuthority + '\'' + + ", baseDepartmentIds=" + baseDepartmentIds + + ", dataAuthorityUserIds=" + dataAuthorityUserIds + + ", roles=" + roles + + ", groups=" + groups + + ", departments=" + departments + + ", positions=" + positions + + ", roleIdAndNamesValue='" + roleIdAndNamesValue + '\'' + + ", groupIdAndNamesValue='" + groupIdAndNamesValue + '\'' + + ", departmentIdAndNamesValue='" + departmentIdAndNamesValue + '\'' + + ", positionIdAndNamesValue='" + positionIdAndNamesValue + '\'' + + '}'; } } diff --git a/cloud-common/src/main/java/com/cm/common/pojo/bos/UserInfoBO.java b/cloud-common/src/main/java/com/cm/common/pojo/bos/UserInfoBO.java index 0ff6aac..18b95cb 100644 --- a/cloud-common/src/main/java/com/cm/common/pojo/bos/UserInfoBO.java +++ b/cloud-common/src/main/java/com/cm/common/pojo/bos/UserInfoBO.java @@ -16,6 +16,8 @@ public class UserInfoBO { private String userUsername; private String userName; private String userPhone; + private String userAvatar; + private String userEmail; private String dataAuthority; private List dataAuthorityUserIds; private List baseDepartmentIds; @@ -60,6 +62,22 @@ public class UserInfoBO { this.userPhone = userPhone; } + public String getUserAvatar() { + return userAvatar == null ? "" : userAvatar; + } + + public void setUserAvatar(String userAvatar) { + this.userAvatar = userAvatar; + } + + public String getUserEmail() { + return userEmail == null ? "" : userEmail; + } + + public void setUserEmail(String userEmail) { + this.userEmail = userEmail; + } + public String getDataAuthority() { return dataAuthority == null ? "" : dataAuthority.trim(); } @@ -190,26 +208,24 @@ public class UserInfoBO { @Override public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"userId\":\"") - .append(userId).append('\"'); - sb.append(",\"userUsername\":\"") - .append(userUsername).append('\"'); - sb.append(",\"userName\":\"") - .append(userName).append('\"'); - sb.append(",\"userPhone\":\"") - .append(userPhone).append('\"'); - sb.append(",\"dataAuthority\":\"") - .append(dataAuthority).append('\"'); - sb.append(",\"dataAuthorityUserIds\":") - .append(dataAuthorityUserIds); - sb.append(",\"baseDepartmentIds\":") - .append(baseDepartmentIds); - sb.append(",\"departments\":") - .append(departments); - sb.append(",\"roles\":") - .append(roles); - sb.append('}'); - return sb.toString(); + return "UserInfoBO{" + + "userId='" + userId + '\'' + + ", userUsername='" + userUsername + '\'' + + ", userName='" + userName + '\'' + + ", userPhone='" + userPhone + '\'' + + ", userAvatar='" + userAvatar + '\'' + + ", userEmail='" + userEmail + '\'' + + ", dataAuthority='" + dataAuthority + '\'' + + ", dataAuthorityUserIds=" + dataAuthorityUserIds + + ", baseDepartmentIds=" + baseDepartmentIds + + ", departments=" + departments + + ", roles=" + roles + + ", groups=" + groups + + ", positions=" + positions + + ", roleIdAndNamesValue='" + roleIdAndNamesValue + '\'' + + ", groupIdAndNamesValue='" + groupIdAndNamesValue + '\'' + + ", departmentIdAndNamesValue='" + departmentIdAndNamesValue + '\'' + + ", positionIdAndNamesValue='" + positionIdAndNamesValue + '\'' + + '}'; } }