|
|
@@ -17,16 +17,8 @@ public class RoleVO {
|
|
|
private String description;
|
|
|
private String createTime;
|
|
|
private String updateTime;
|
|
|
- private int total;
|
|
|
-
|
|
|
- public RoleVO(Role role) {
|
|
|
- this.id = role.getId();
|
|
|
- this.name = role.getName().split("ROLE_")[1].toLowerCase(Locale.ROOT);
|
|
|
- this.description = role.getDescription();
|
|
|
- this.createTime = DateTimeConverter.format(role.getCreateTime());
|
|
|
- this.updateTime = DateTimeConverter.format(role.getUpdateTime());
|
|
|
- this.total = 0;
|
|
|
- }
|
|
|
+ private int totalUsers;
|
|
|
+ private int totalMenus;
|
|
|
|
|
|
public RoleVO(Role role, int total) {
|
|
|
this.id = role.getId();
|
|
|
@@ -34,6 +26,7 @@ public class RoleVO {
|
|
|
this.description = role.getDescription();
|
|
|
this.createTime = DateTimeConverter.format(role.getCreateTime());
|
|
|
this.updateTime = DateTimeConverter.format(role.getUpdateTime());
|
|
|
- this.total = total;
|
|
|
+ this.totalUsers = total;
|
|
|
+ this.totalMenus = role.getMenus().size();
|
|
|
}
|
|
|
}
|