Changeset ae042f4 for src/main/java/com/example/autopartz/model/User.java
- Timestamp:
- 01/04/23 02:49:26 (23 months ago)
- Branches:
- main
- Children:
- ab952ab
- Parents:
- 6832924
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/model/User.java
r6832924 rae042f4 1 1 package com.example.autopartz.model; 2 2 3 import jakarta.persistence.*; 4 import lombok.*; 3 import lombok.Getter; 4 import lombok.RequiredArgsConstructor; 5 import lombok.Setter; 6 import lombok.ToString; 5 7 import org.hibernate.Hibernate; 8 import org.springframework.security.core.GrantedAuthority; 9 import org.springframework.security.core.userdetails.UserDetails; 6 10 11 import javax.persistence.*; 7 12 import java.time.LocalDateTime; 13 import java.util.Collection; 14 import java.util.Collections; 8 15 import java.util.Objects; 9 16 … … 15 22 @Table(name = "users_table") 16 23 @Inheritance(strategy = InheritanceType.JOINED) 17 public class User {24 public class User implements UserDetails { 18 25 @Id 19 LongID_user;26 Integer ID_user; 20 27 String username; 21 28 String email; … … 50 57 return getClass().hashCode(); 51 58 } 59 60 61 @Override 62 public Collection<? extends GrantedAuthority> getAuthorities() { 63 return Collections.singletonList(Role.ROLE_USER); 64 } 65 66 @Override 67 public boolean isAccountNonExpired() { 68 return true; 69 } 70 71 @Override 72 public boolean isAccountNonLocked() { 73 return true; 74 } 75 76 @Override 77 public boolean isCredentialsNonExpired() { 78 return true; 79 } 80 81 @Override 82 public boolean isEnabled() { 83 return true; 84 } 52 85 }
Note:
See TracChangeset
for help on using the changeset viewer.