Добавлено хранение должность сотрудника при помощи Enum
This commit is contained in:
parent
5d38e7a023
commit
438583f029
@ -7,7 +7,6 @@ import com.example.onomatopoeiaback.domain.visit.Visit;
|
||||
import com.example.onomatopoeiaback.domain.visit.VisitDTO;
|
||||
import com.example.onomatopoeiaback.service.EmployeeService;
|
||||
import com.example.onomatopoeiaback.service.VisitService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -1,11 +1,13 @@
|
||||
package com.example.onomatopoeiaback.domain.employee;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Entity
|
||||
@Table(name = "employee")
|
||||
@Getter
|
||||
@ -19,6 +21,7 @@ public class Employee {
|
||||
@NonNull
|
||||
private String login;
|
||||
@NonNull
|
||||
@JsonIgnore
|
||||
private String password;
|
||||
|
||||
@NonNull
|
||||
@ -26,7 +29,7 @@ public class Employee {
|
||||
@NonNull
|
||||
private String photo;
|
||||
@NonNull
|
||||
private String position;
|
||||
private PositionType position;
|
||||
|
||||
private LocalDateTime lastVisit;
|
||||
}
|
||||
|
@ -10,5 +10,5 @@ public class EmployeeDTO {
|
||||
private String password;
|
||||
private String name;
|
||||
private String photo;
|
||||
private String position;
|
||||
private PositionType position;
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
package com.example.onomatopoeiaback.domain.employee;
|
||||
|
||||
public enum PositionType {
|
||||
DEVELOPER,
|
||||
DESIGNER,
|
||||
TESTER,
|
||||
ANALYST,
|
||||
ADMINISTRATOR
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package com.example.onomatopoeiaback.repository;
|
||||
|
||||
import com.example.onomatopoeiaback.domain.employee.Employee;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.example.onomatopoeiaback.service;
|
||||
|
||||
|
||||
import com.example.onomatopoeiaback.domain.employee.Employee;
|
||||
import com.example.onomatopoeiaback.domain.visit.Visit;
|
||||
import com.example.onomatopoeiaback.exceptions.BadRequestException;
|
||||
import com.example.onomatopoeiaback.exceptions.UnauthorizedException;
|
||||
|
Loading…
x
Reference in New Issue
Block a user