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