RBAC模型
This commit is contained in:
parent
56fdd7db34
commit
b7432cc0c5
@ -0,0 +1,17 @@
|
|||||||
|
package com.example.springdemo.entities.RBAC;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Entity
|
||||||
|
@Table(name = "Permissions")
|
||||||
|
public class Permissions {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Integer id;//主键,权限ID
|
||||||
|
@Column(name = "description")
|
||||||
|
private String description;//权限名称
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.example.springdemo.entities.RBAC;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Entity
|
||||||
|
@Table(name = "Roles")
|
||||||
|
public class Roles {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Integer id;//主键,角色ID
|
||||||
|
private String name;//角色名称
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.example.springdemo.entities.RBAC;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Entity
|
||||||
|
@Table(name = "RolesPermissions")
|
||||||
|
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
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.example.springdemo.entities.password;
|
||||||
|
|
||||||
|
import com.example.springdemo.entities.Merchants;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Entity
|
||||||
|
@Table(name = "MerchantsPassword")
|
||||||
|
public class MerchantsPassword {
|
||||||
|
@Id
|
||||||
|
@OneToOne
|
||||||
|
@Column(name = "merchantID")
|
||||||
|
@JoinColumn(name = "merchantID", referencedColumnName = "id")
|
||||||
|
private Merchants merchants;
|
||||||
|
private String password;
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.example.springdemo.entities.password;
|
||||||
|
|
||||||
|
import com.example.springdemo.entities.Users;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Entity
|
||||||
|
@Table(name = "UsersPassword")
|
||||||
|
public class UsersPassword {
|
||||||
|
@Id
|
||||||
|
@OneToOne
|
||||||
|
@Column(name = "userID")
|
||||||
|
@JoinColumn(name = "userID", referencedColumnName = "id")
|
||||||
|
private Users users;
|
||||||
|
private String password;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user