-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80c0d03
commit 847d803
Showing
13 changed files
with
387 additions
and
597 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,56 @@ | ||
package com.bfwg.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import org.springframework.security.core.GrantedAuthority; | ||
|
||
import javax.persistence.*; | ||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
|
||
/** | ||
* Created by fan.jin on 2016-11-03. | ||
*/ | ||
|
||
@Entity | ||
@Table(name="AUTHORITY") | ||
@Table(name = "AUTHORITY") | ||
public class Authority implements GrantedAuthority { | ||
|
||
@Id | ||
@Column(name="id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
Long id; | ||
|
||
@Enumerated( EnumType.STRING) | ||
@Column(name="name") | ||
UserRoleName name; | ||
|
||
@Override | ||
public String getAuthority() { | ||
return name.name(); | ||
} | ||
|
||
public void setName(UserRoleName name) { | ||
this.name = name; | ||
} | ||
|
||
@JsonIgnore | ||
public UserRoleName getName() { | ||
return name; | ||
} | ||
|
||
@JsonIgnore | ||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
@Id | ||
@Column(name = "id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
Long id; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(name = "name") | ||
UserRoleName name; | ||
|
||
@Override | ||
public String getAuthority() { | ||
return name.name(); | ||
} | ||
|
||
public void setName(UserRoleName name) { | ||
this.name = name; | ||
} | ||
|
||
@JsonIgnore | ||
public UserRoleName getName() { | ||
return name; | ||
} | ||
|
||
@JsonIgnore | ||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.