source: src/main/java/project/educatum/model/Admin.java

Last change on this file was d3cf3a1, checked in by Marija Micevska <marija_micevska@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 1.4 KB
Line 
1package project.educatum.model;
2
3import lombok.Data;
4import org.springframework.security.core.GrantedAuthority;
5import org.springframework.security.core.userdetails.UserDetails;
6
7import javax.persistence.Column;
8import javax.persistence.Entity;
9import javax.persistence.Id;
10import javax.persistence.Table;
11import java.util.Collection;
12
13@Data
14@Entity
15@Table(name = "admini", schema = "project")
16public 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}
Note: See TracBrowser for help on using the repository browser.