소스 검색

update RoleVO

reghao 3 달 전
부모
커밋
bb48bb368a
1개의 변경된 파일4개의 추가작업 그리고 11개의 파일을 삭제
  1. 4 11
      web/src/main/java/cn/reghao/bnt/web/admin/model/vo/RoleVO.java

+ 4 - 11
web/src/main/java/cn/reghao/bnt/web/admin/model/vo/RoleVO.java

@@ -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();
     }
 }