RBAC相关实体
This commit is contained in:
parent
c53eeeef38
commit
b9b46d4169
@ -11,7 +11,7 @@ import lombok.NoArgsConstructor;
|
|||||||
public class Permissions {
|
public class Permissions {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Integer id;//主键,权限ID
|
private Long id;//主键,权限ID
|
||||||
@Column(name = "description")
|
@Column(name = "description")
|
||||||
private String description;//权限名称
|
private String description;//权限名称
|
||||||
@Column(name = "url")
|
@Column(name = "url")
|
||||||
|
@ -11,6 +11,6 @@ import lombok.NoArgsConstructor;
|
|||||||
public class Roles {
|
public class Roles {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Integer id;//主键,角色ID
|
private Long id;//主键,角色ID
|
||||||
private String name;//角色名称
|
private String name;//角色名称
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,8 @@ import jakarta.persistence.*;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Entity
|
@Entity
|
||||||
@ -11,11 +13,11 @@ import lombok.NoArgsConstructor;
|
|||||||
public class RolesPermissions {
|
public class RolesPermissions {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Integer id;//主键,角色权限ID
|
private Long id;//主键
|
||||||
@OneToOne
|
@OneToMany(targetEntity = Roles.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "RolesID", referencedColumnName = "id")
|
@Column(name = "RolesID")
|
||||||
private Roles roles;//角色ID
|
private List<Roles> roles;//角色ID
|
||||||
@OneToOne
|
@OneToMany(targetEntity = Permissions.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "PermissionsID", referencedColumnName = "id")
|
@Column(name = "PermissionsID")
|
||||||
private Permissions permissions;//权限ID
|
private List<Permissions> permissions;//权限ID
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user