1 | package project.educatum.model;
|
---|
2 |
|
---|
3 | import lombok.Data;
|
---|
4 | import org.springframework.security.core.GrantedAuthority;
|
---|
5 | import org.springframework.security.core.userdetails.UserDetails;
|
---|
6 |
|
---|
7 | import javax.persistence.Column;
|
---|
8 | import javax.persistence.Entity;
|
---|
9 | import javax.persistence.Id;
|
---|
10 | import javax.persistence.Table;
|
---|
11 | import java.util.Collection;
|
---|
12 |
|
---|
13 | @Data
|
---|
14 | @Entity
|
---|
15 | @Table(name = "admini", schema = "project")
|
---|
16 | public class Admin implements UserDetails {
|
---|
17 |
|
---|
18 |
|
---|
19 | @Id
|
---|
20 | @Column(name = "id_admin", nullable = false)
|
---|
21 | private Integer id;
|
---|
22 |
|
---|
23 | @Column(name = "ime", nullable = false, length = 50)
|
---|
24 | private String name;
|
---|
25 |
|
---|
26 | @Column(name = "prezime", nullable = false, length = 50)
|
---|
27 | private String surname;
|
---|
28 |
|
---|
29 | @Column(name = "email", nullable = false, length = 50)
|
---|
30 | private String email;
|
---|
31 |
|
---|
32 | @Column(name = "password", nullable = false, length = 30)
|
---|
33 | private String password;
|
---|
34 |
|
---|
35 | @Override
|
---|
36 | public Collection<? extends GrantedAuthority> getAuthorities() {
|
---|
37 | return null;
|
---|
38 | }
|
---|
39 |
|
---|
40 | @Override
|
---|
41 | public String getUsername() {
|
---|
42 | return email;
|
---|
43 | }
|
---|
44 |
|
---|
45 | @Override
|
---|
46 | public boolean isAccountNonExpired() {
|
---|
47 | return false;
|
---|
48 | }
|
---|
49 |
|
---|
50 | @Override
|
---|
51 | public boolean isAccountNonLocked() {
|
---|
52 | return false;
|
---|
53 | }
|
---|
54 |
|
---|
55 | @Override
|
---|
56 | public boolean isCredentialsNonExpired() {
|
---|
57 | return false;
|
---|
58 | }
|
---|
59 |
|
---|
60 | @Override
|
---|
61 | public boolean isEnabled() {
|
---|
62 | return true;
|
---|
63 | }
|
---|
64 | } |
---|