wangwei hace 7 años
padre
commit
3fbcd67fb5

+ 14 - 2
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/provider/PrivilegeCloudServiceProvider.java

@@ -92,8 +92,16 @@ public class PrivilegeCloudServiceProvider extends ControllerSupport
 
 		List<PrivilegeInfo> privilegeInfoList = Lists.newArrayList();
 
+		boolean full = req.isFull();
+
 		for (Privilege cur : privilegeList) {
+			boolean hasPrivilege = pIdSet.contains(String.valueOf(cur.getId()));
+			if ((!full) && (!hasPrivilege)) {
+				continue;
+			}
+
 			PrivilegeInfo privilegeInfo = new PrivilegeInfo();
+			privilegeInfo.setHasPrivilege(hasPrivilege);
 			privilegeInfo.setCode(cur.getCode());
 			privilegeInfo.setCreationTime(cur.getCreationTime());
 			privilegeInfo.setGroupId(cur.getGroupId());
@@ -101,8 +109,12 @@ public class PrivilegeCloudServiceProvider extends ControllerSupport
 			privilegeInfo.setName(cur.getName());
 			privilegeInfo.setParentId(cur.getParentId());
 			privilegeInfo.setUpdateTime(cur.getUpdateTime());
-
-			privilegeInfo.setHasPrivilege(pIdSet.contains(String.valueOf(cur.getId())));
+			privilegeInfo.setDescription(cur.getDescription());
+			privilegeInfo.setExt1(cur.getExt1());
+			privilegeInfo.setExt2(cur.getExt2());
+			privilegeInfo.setExt3(cur.getExt3());
+			privilegeInfo.setExt4(cur.getExt4());
+			privilegeInfo.setExt5(cur.getExt5());
 
 			privilegeInfoList.add(privilegeInfo);
 

+ 78 - 0
examcloud-core-basic-api/src/main/java/cn/com/qmth/examcloud/core/basic/api/bean/PrivilegeInfo.java

@@ -45,6 +45,36 @@ public class PrivilegeInfo extends JpaEntity implements JsonSerializable, TreeNo
 	 */
 	private boolean hasPrivilege;
 
+	/**
+	 * 描述
+	 */
+	private String description;
+
+	/**
+	 * 扩展属性
+	 */
+	private String ext1;
+
+	/**
+	 * 扩展属性
+	 */
+	private String ext2;
+
+	/**
+	 * 扩展属性
+	 */
+	private String ext3;
+
+	/**
+	 * 扩展属性
+	 */
+	private String ext4;
+
+	/**
+	 * 扩展属性
+	 */
+	private String ext5;
+
 	public Long getId() {
 		return id;
 	}
@@ -93,6 +123,54 @@ public class PrivilegeInfo extends JpaEntity implements JsonSerializable, TreeNo
 		this.hasPrivilege = hasPrivilege;
 	}
 
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String getExt1() {
+		return ext1;
+	}
+
+	public void setExt1(String ext1) {
+		this.ext1 = ext1;
+	}
+
+	public String getExt2() {
+		return ext2;
+	}
+
+	public void setExt2(String ext2) {
+		this.ext2 = ext2;
+	}
+
+	public String getExt3() {
+		return ext3;
+	}
+
+	public void setExt3(String ext3) {
+		this.ext3 = ext3;
+	}
+
+	public String getExt4() {
+		return ext4;
+	}
+
+	public void setExt4(String ext4) {
+		this.ext4 = ext4;
+	}
+
+	public String getExt5() {
+		return ext5;
+	}
+
+	public void setExt5(String ext5) {
+		this.ext5 = ext5;
+	}
+
 	@Override
 	public String getTreeId() {
 		if (null == this.id) {

+ 10 - 0
examcloud-core-basic-api/src/main/java/cn/com/qmth/examcloud/core/basic/api/request/GetPrivilegesReq.java

@@ -21,6 +21,8 @@ public class GetPrivilegesReq extends BaseRequest {
 
 	private String rootOrgId;
 
+	private boolean full;
+
 	public String getUserType() {
 		return userType;
 	}
@@ -53,4 +55,12 @@ public class GetPrivilegesReq extends BaseRequest {
 		this.rootOrgId = rootOrgId;
 	}
 
+	public boolean isFull() {
+		return full;
+	}
+
+	public void setFull(boolean full) {
+		this.full = full;
+	}
+
 }

+ 21 - 6
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/entity/Privilege.java

@@ -178,32 +178,47 @@ public class Privilege extends JpaEntity implements TreeNode {
 
 	@Override
 	public String getTreeId() {
-		return null;
+		if (null == this.id) {
+			return null;
+		}
+		return String.valueOf(this.id);
 	}
 
 	@Override
 	public void setTreeId(String treeId) {
-
+		if (null == treeId) {
+			this.id = null;
+		}
+		this.id = Long.parseLong(treeId);
 	}
 
 	@Override
 	public String getTreeName() {
-		return null;
+		if (null == this.name) {
+			return null;
+		}
+		return String.valueOf(this.name);
 	}
 
 	@Override
 	public void setTreeName(String treeName) {
-
+		this.name = treeName;
 	}
 
 	@Override
 	public String getParentTreeId() {
-		return null;
+		if (null == this.parentId) {
+			return null;
+		}
+		return String.valueOf(this.parentId);
 	}
 
 	@Override
 	public void setParentTreeId(String parentTreeId) {
-
+		if (null == parentTreeId) {
+			this.parentId = null;
+		}
+		this.parentId = Long.parseLong(parentTreeId);
 	}
 
 }