wangwei 7 жил өмнө
parent
commit
d441ab48ee

+ 40 - 30
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/entity/Function.java

@@ -59,6 +59,46 @@ public class Function implements Serializable, TreeNode {
 	@NotNull
 	private int weigth;
 
+	@Override
+	public String getTreeId() {
+		if (null == funcId) {
+			return null;
+		}
+		return String.valueOf(this.funcId);
+	}
+
+	@Override
+	public void setTreeId(String treeId) {
+		if (null != treeId) {
+			this.funcId = Long.parseLong(treeId);
+		}
+	}
+
+	@Override
+	public String getTreeName() {
+		return this.funcName;
+	}
+
+	@Override
+	public void setTreeName(String treeName) {
+		this.funcName = treeName;
+	}
+
+	@Override
+	public String getParentTreeId() {
+		if (null == this.parentFuncId) {
+			return null;
+		}
+		return String.valueOf(this.parentFuncId);
+	}
+
+	@Override
+	public void setParentTreeId(String parentTreeId) {
+		if (null != parentFuncId) {
+			this.parentFuncId = Long.parseLong(parentTreeId);
+		}
+	}
+
 	public Long getFuncId() {
 		return funcId;
 	}
@@ -107,34 +147,4 @@ public class Function implements Serializable, TreeNode {
 		this.weigth = weigth;
 	}
 
-	@Override
-	public String getId() {
-		return String.valueOf(this.funcId);
-	}
-
-	@Override
-	public void setId(String id) {
-		this.funcId = Long.parseLong(id);
-	}
-
-	@Override
-	public String getName() {
-		return this.funcName;
-	}
-
-	@Override
-	public void setName(String name) {
-		this.funcName = name;
-	}
-
-	@Override
-	public String getParentId() {
-		return String.valueOf(this.parentFuncId);
-	}
-
-	@Override
-	public void setParentId(String parentId) {
-		this.parentFuncId = Long.parseLong(parentId);
-	}
-
 }

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

@@ -2,6 +2,7 @@ package cn.com.qmth.examcloud.core.basic.dao.entity;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
@@ -25,39 +26,48 @@ public class Privilege extends JpaEntitySupport implements TreeNode {
 	 * 权限ID
 	 */
 	@Id
-	private String id;
+	@GeneratedValue
+	private Long id;
 
 	/**
-	 * 权限名称
+	 * 权限
 	 */
 	@Column(unique = true, nullable = false)
-	private String name;
+	private String privilegeCode;
 
 	/**
-	 * 父权限ID
+	 * 权限名称
 	 */
-	private String parentId;
+	@Column(unique = true, nullable = false)
+	private String name;
 
 	/**
-	 * 应用
+	 * 父权限ID
 	 */
-	@Column(unique = false, nullable = false)
-	private String appId;
+	private Long parentId;
 
 	/**
 	 * 组(权限分组,同一组的权限构成权限树)
 	 */
 	@Column(unique = false, nullable = false)
-	private String groupId;
+	private Long groupId;
 
-	public String getId() {
+	public Long getId() {
 		return id;
 	}
 
-	public void setId(String id) {
+	public void setId(Long id) {
 		this.id = id;
 	}
 
+	public String getPrivilegeCode() {
+		return privilegeCode;
+	}
+
+	public void setPrivilegeCode(String privilegeCode) {
+		this.privilegeCode = privilegeCode;
+	}
+
 	public String getName() {
 		return name;
 	}
@@ -66,28 +76,50 @@ public class Privilege extends JpaEntitySupport implements TreeNode {
 		this.name = name;
 	}
 
-	public String getParentId() {
+	public Long getParentId() {
 		return parentId;
 	}
 
-	public void setParentId(String parentId) {
+	public void setParentId(Long parentId) {
 		this.parentId = parentId;
 	}
 
-	public String getAppId() {
-		return appId;
+	public Long getGroupId() {
+		return groupId;
 	}
 
-	public void setAppId(String appId) {
-		this.appId = appId;
+	public void setGroupId(Long groupId) {
+		this.groupId = groupId;
 	}
 
-	public String getGroupId() {
-		return groupId;
+	@Override
+	public String getTreeId() {
+		return null;
 	}
 
-	public void setGroupId(String groupId) {
-		this.groupId = groupId;
+	@Override
+	public void setTreeId(String treeId) {
+
+	}
+
+	@Override
+	public String getTreeName() {
+		return null;
+	}
+
+	@Override
+	public void setTreeName(String treeName) {
+
+	}
+
+	@Override
+	public String getParentTreeId() {
+		return null;
+	}
+
+	@Override
+	public void setParentTreeId(String parentTreeId) {
+
 	}
 
 }

+ 19 - 3
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/entity/PrivilegeGroup.java

@@ -2,6 +2,7 @@ package cn.com.qmth.examcloud.core.basic.dao.entity;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
@@ -24,7 +25,8 @@ public class PrivilegeGroup extends JpaEntitySupport {
 	 * 权限组ID
 	 */
 	@Id
-	private String id;
+	@GeneratedValue
+	private Long id;
 
 	/**
 	 * 权限组名称
@@ -32,11 +34,17 @@ public class PrivilegeGroup extends JpaEntitySupport {
 	@Column(unique = true, nullable = false)
 	private String name;
 
-	public String getId() {
+	/**
+	 * 应用
+	 */
+	@Column(unique = false, nullable = false)
+	private String appId;
+
+	public Long getId() {
 		return id;
 	}
 
-	public void setId(String id) {
+	public void setId(Long id) {
 		this.id = id;
 	}
 
@@ -48,4 +56,12 @@ public class PrivilegeGroup extends JpaEntitySupport {
 		this.name = name;
 	}
 
+	public String getAppId() {
+		return appId;
+	}
+
+	public void setAppId(String appId) {
+		this.appId = appId;
+	}
+
 }

+ 27 - 5
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/entity/Role.java

@@ -2,6 +2,7 @@ package cn.com.qmth.examcloud.core.basic.dao.entity;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
@@ -20,18 +21,39 @@ public class Role extends JpaEntitySupport {
 
 	private static final long serialVersionUID = -2167420238674588632L;
 
+	/**
+	 * 角色ID
+	 */
 	@Id
-	private String roleId;
+	@GeneratedValue
+	private Long id;
 
+	/**
+	 * 角色码
+	 */
+	@Column(unique = true, nullable = false)
+	private String roleCode;
+
+	/**
+	 * 角色名称
+	 */
 	@Column(unique = true, nullable = false)
 	private String roleName;
 
-	public String getRoleId() {
-		return roleId;
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getRoleCode() {
+		return roleCode;
 	}
 
-	public void setRoleId(String roleId) {
-		this.roleId = roleId;
+	public void setRoleCode(String roleCode) {
+		this.roleCode = roleCode;
 	}
 
 	public String getRoleName() {

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

@@ -22,24 +22,24 @@ public class RolePrivilegeRelation extends JpaEntitySupport {
 	private static final long serialVersionUID = 8849214483955278647L;
 
 	@Id
-	private String roleId;
+	private Long roleId;
 
 	@Id
-	private String privilegeId;
+	private Long privilegeId;
 
-	public String getRoleId() {
+	public Long getRoleId() {
 		return roleId;
 	}
 
-	public void setRoleId(String roleId) {
+	public void setRoleId(Long roleId) {
 		this.roleId = roleId;
 	}
 
-	public String getPrivilegeId() {
+	public Long getPrivilegeId() {
 		return privilegeId;
 	}
 
-	public void setPrivilegeId(String privilegeId) {
+	public void setPrivilegeId(Long privilegeId) {
 		this.privilegeId = privilegeId;
 	}
 

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

@@ -13,23 +13,23 @@ public class RolePrivilegeRelationPK implements Serializable {
 
 	private static final long serialVersionUID = 7674517327265591905L;
 
-	private String roleId;
+	private Long roleId;
 
-	private String privilegeId;
+	private Long privilegeId;
 
-	public String getRoleId() {
+	public Long getRoleId() {
 		return roleId;
 	}
 
-	public void setRoleId(String roleId) {
+	public void setRoleId(Long roleId) {
 		this.roleId = roleId;
 	}
 
-	public String getPrivilegeId() {
+	public Long getPrivilegeId() {
 		return privilegeId;
 	}
 
-	public void setPrivilegeId(String privilegeId) {
+	public void setPrivilegeId(Long privilegeId) {
 		this.privilegeId = privilegeId;
 	}
 

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

@@ -25,10 +25,10 @@ public class UserPrivilegeRelation extends JpaEntitySupport {
 	private String userType;
 
 	@Id
-	private String userId;
+	private Long userId;
 
 	@Id
-	private String privilegeId;
+	private Long privilegeId;
 
 	public String getUserType() {
 		return userType;
@@ -38,19 +38,19 @@ public class UserPrivilegeRelation extends JpaEntitySupport {
 		this.userType = userType;
 	}
 
-	public String getUserId() {
+	public Long getUserId() {
 		return userId;
 	}
 
-	public void setUserId(String userId) {
+	public void setUserId(Long userId) {
 		this.userId = userId;
 	}
 
-	public String getPrivilegeId() {
+	public Long getPrivilegeId() {
 		return privilegeId;
 	}
 
-	public void setPrivilegeId(String privilegeId) {
+	public void setPrivilegeId(Long privilegeId) {
 		this.privilegeId = privilegeId;
 	}
 

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

@@ -15,9 +15,9 @@ public class UserPrivilegeRelationPK implements Serializable {
 
 	private String userType;
 
-	private String userId;
+	private Long userId;
 
-	private String privilegeId;
+	private Long privilegeId;
 
 	public String getUserType() {
 		return userType;
@@ -27,19 +27,19 @@ public class UserPrivilegeRelationPK implements Serializable {
 		this.userType = userType;
 	}
 
-	public String getUserId() {
+	public Long getUserId() {
 		return userId;
 	}
 
-	public void setUserId(String userId) {
+	public void setUserId(Long userId) {
 		this.userId = userId;
 	}
 
-	public String getPrivilegeId() {
+	public Long getPrivilegeId() {
 		return privilegeId;
 	}
 
-	public void setPrivilegeId(String privilegeId) {
+	public void setPrivilegeId(Long privilegeId) {
 		this.privilegeId = privilegeId;
 	}
 

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

@@ -25,10 +25,10 @@ public class UserRoleRelation extends JpaEntitySupport {
 	private String userType;
 
 	@Id
-	private String userId;
+	private Long userId;
 
 	@Id
-	private String roleId;
+	private Long roleId;
 
 	public String getUserType() {
 		return userType;
@@ -38,19 +38,19 @@ public class UserRoleRelation extends JpaEntitySupport {
 		this.userType = userType;
 	}
 
-	public String getUserId() {
+	public Long getUserId() {
 		return userId;
 	}
 
-	public void setUserId(String userId) {
+	public void setUserId(Long userId) {
 		this.userId = userId;
 	}
 
-	public String getRoleId() {
+	public Long getRoleId() {
 		return roleId;
 	}
 
-	public void setRoleId(String roleId) {
+	public void setRoleId(Long roleId) {
 		this.roleId = roleId;
 	}
 

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

@@ -15,9 +15,9 @@ public class UserRoleRelationPK implements Serializable {
 
 	private String userType;
 
-	private String userId;
+	private Long userId;
 
-	private String roleId;
+	private Long roleId;
 
 	public String getUserType() {
 		return userType;
@@ -27,19 +27,19 @@ public class UserRoleRelationPK implements Serializable {
 		this.userType = userType;
 	}
 
-	public String getUserId() {
+	public Long getUserId() {
 		return userId;
 	}
 
-	public void setUserId(String userId) {
+	public void setUserId(Long userId) {
 		this.userId = userId;
 	}
 
-	public String getRoleId() {
+	public Long getRoleId() {
 		return roleId;
 	}
 
-	public void setRoleId(String roleId) {
+	public void setRoleId(Long roleId) {
 		this.roleId = roleId;
 	}