Ver Fonte

新增角色权限实体

wangwei há 7 anos atrás
pai
commit
f5e234cab6

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

@@ -0,0 +1,93 @@
+package cn.com.qmth.examcloud.core.basic.dao.entity;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+import cn.com.qmth.examcloud.commons.web.helpers.tree.TreeNode;
+
+/**
+ * 权限
+ *
+ * @author WANGWEI
+ * @date 2018年5月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Entity
+@Table(name = "EC_B_PRIVILEGE")
+public class Privilege implements TreeNode, JsonSerializable {
+
+	private static final long serialVersionUID = -6288949236298877031L;
+
+	/**
+	 * 权限ID
+	 */
+	@Id
+	private String id;
+
+	/**
+	 * 权限名称
+	 */
+	@Column(unique = true, nullable = false)
+	private String name;
+
+	/**
+	 * 父权限ID
+	 */
+	private String parentId;
+
+	/**
+	 * 域(区分系统)
+	 */
+	@Column(unique = true, nullable = false)
+	private String domain;
+
+	/**
+	 * 组(权限分组,同一组的权限构成权限树)
+	 */
+	@Column(unique = true, nullable = false)
+	private String group;
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getParentId() {
+		return parentId;
+	}
+
+	public void setParentId(String parentId) {
+		this.parentId = parentId;
+	}
+
+	public String getDomain() {
+		return domain;
+	}
+
+	public void setDomain(String domain) {
+		this.domain = domain;
+	}
+
+	public String getGroup() {
+		return group;
+	}
+
+	public void setGroup(String group) {
+		this.group = group;
+	}
+
+}

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

@@ -0,0 +1,41 @@
+package cn.com.qmth.examcloud.core.basic.dao.entity;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 角色
+ *
+ * @author WANGWEI
+ * @date 2018年5月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Entity
+@Table(name = "EC_B_ROLE")
+public class Role {
+
+	@Id
+	private String roleId;
+
+	@Column(unique = true, nullable = false)
+	private String roleName;
+
+	public String getRoleId() {
+		return roleId;
+	}
+
+	public void setRoleId(String roleId) {
+		this.roleId = roleId;
+	}
+
+	public String getRoleName() {
+		return roleName;
+	}
+
+	public void setRoleName(String roleName) {
+		this.roleName = roleName;
+	}
+
+}

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

@@ -0,0 +1,42 @@
+package cn.com.qmth.examcloud.core.basic.dao.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+
+/**
+ * 角色权限关联
+ *
+ * @author WANGWEI
+ * @date 2018年5月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Entity
+@Table(name = "EC_B_ROLE_PRIV_RELATION")
+@IdClass(RolePrivilegeRelationPK.class)
+public class RolePrivilegeRelation {
+
+	@Id
+	private String roleId;
+
+	@Id
+	private String privilegeId;
+
+	public String getRoleId() {
+		return roleId;
+	}
+
+	public void setRoleId(String roleId) {
+		this.roleId = roleId;
+	}
+
+	public String getPrivilegeId() {
+		return privilegeId;
+	}
+
+	public void setPrivilegeId(String privilegeId) {
+		this.privilegeId = privilegeId;
+	}
+
+}

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

@@ -0,0 +1,36 @@
+package cn.com.qmth.examcloud.core.basic.dao.entity;
+
+import java.io.Serializable;
+
+/**
+ * 角色权限关联
+ *
+ * @author WANGWEI
+ * @date 2018年5月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class RolePrivilegeRelationPK implements Serializable {
+
+	private static final long serialVersionUID = 7674517327265591905L;
+
+	private String roleId;
+
+	private String privilegeId;
+
+	public String getRoleId() {
+		return roleId;
+	}
+
+	public void setRoleId(String roleId) {
+		this.roleId = roleId;
+	}
+
+	public String getPrivilegeId() {
+		return privilegeId;
+	}
+
+	public void setPrivilegeId(String privilegeId) {
+		this.privilegeId = privilegeId;
+	}
+
+}

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

@@ -0,0 +1,42 @@
+package cn.com.qmth.examcloud.core.basic.dao.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+
+/**
+ * 权限
+ *
+ * @author WANGWEI
+ * @date 2018年5月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Entity
+@Table(name = "EC_B_USER_PRIV_RELATION")
+@IdClass(UserPrivilegeRelationPK.class)
+public class UserPrivilegeRelation {
+
+	@Id
+	private String userId;
+
+	@Id
+	private String privilegeId;
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String getPrivilegeId() {
+		return privilegeId;
+	}
+
+	public void setPrivilegeId(String privilegeId) {
+		this.privilegeId = privilegeId;
+	}
+
+}

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

@@ -0,0 +1,36 @@
+package cn.com.qmth.examcloud.core.basic.dao.entity;
+
+import java.io.Serializable;
+
+/**
+ * 权限
+ *
+ * @author WANGWEI
+ * @date 2018年5月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class UserPrivilegeRelationPK implements Serializable {
+
+	private static final long serialVersionUID = 3451129659871377605L;
+
+	private String userId;
+
+	private String privilegeId;
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String getPrivilegeId() {
+		return privilegeId;
+	}
+
+	public void setPrivilegeId(String privilegeId) {
+		this.privilegeId = privilegeId;
+	}
+
+}

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

@@ -0,0 +1,42 @@
+package cn.com.qmth.examcloud.core.basic.dao.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+
+/**
+ * 角色
+ *
+ * @author WANGWEI
+ * @date 2018年5月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Entity
+@Table(name = "EC_B_USER_ROLE_RELATION")
+@IdClass(UserRoleRelationPK.class)
+public class UserRoleRelation {
+
+	@Id
+	private String userId;
+
+	@Id
+	private String roleId;
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String getRoleId() {
+		return roleId;
+	}
+
+	public void setRoleId(String roleId) {
+		this.roleId = roleId;
+	}
+
+}

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

@@ -0,0 +1,36 @@
+package cn.com.qmth.examcloud.core.basic.dao.entity;
+
+import java.io.Serializable;
+
+/**
+ * 角色
+ *
+ * @author WANGWEI
+ * @date 2018年5月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class UserRoleRelationPK implements Serializable {
+
+	private static final long serialVersionUID = -4635275019235356564L;
+
+	private String userId;
+
+	private String roleId;
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String getRoleId() {
+		return roleId;
+	}
+
+	public void setRoleId(String roleId) {
+		this.roleId = roleId;
+	}
+
+}