42 lines
867 B
Java
42 lines
867 B
Java
|
|
package com.example.nto.entity;
|
|
|
|
import javax.persistence.*;
|
|
import lombok.*;
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
@Data
|
|
@Builder
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@Entity
|
|
@Table(name = "employee")
|
|
public class Employee {
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private long id;
|
|
|
|
@Column(unique = true, nullable = false)
|
|
private String login;
|
|
|
|
private String name;
|
|
private String photo;
|
|
private String position;
|
|
|
|
@Column(name = "last_visit")
|
|
private LocalDateTime lastVisit;
|
|
|
|
private String password;
|
|
private String role;
|
|
|
|
@Column(nullable = false)
|
|
private String status = "works"; // Новый статус: 'works' или 'blocked'
|
|
|
|
|
|
|
|
public boolean isBlocked() {
|
|
return "blocked".equals(status);
|
|
}
|
|
} |