First day end commit
This commit is contained in:
		
							parent
							
								
									4dfbfe6b2b
								
							
						
					
					
						commit
						90b3c97af3
					
				
							
								
								
									
										27
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								pom.xml
									
									
									
									
									
								
							@ -37,10 +37,6 @@
 | 
				
			|||||||
            <groupId>org.springframework.boot</groupId>
 | 
					            <groupId>org.springframework.boot</groupId>
 | 
				
			||||||
            <artifactId>spring-boot-starter-data-jpa</artifactId>
 | 
					            <artifactId>spring-boot-starter-data-jpa</artifactId>
 | 
				
			||||||
        </dependency>
 | 
					        </dependency>
 | 
				
			||||||
        <dependency>
 | 
					 | 
				
			||||||
            <groupId>org.springdoc</groupId>
 | 
					 | 
				
			||||||
            <artifactId>springdoc-openapi-ui</artifactId>
 | 
					 | 
				
			||||||
        </dependency>
 | 
					 | 
				
			||||||
        <dependency>
 | 
					        <dependency>
 | 
				
			||||||
            <groupId>org.junit.jupiter</groupId>
 | 
					            <groupId>org.junit.jupiter</groupId>
 | 
				
			||||||
            <artifactId>junit-jupiter-engine</artifactId>
 | 
					            <artifactId>junit-jupiter-engine</artifactId>
 | 
				
			||||||
@ -49,6 +45,29 @@
 | 
				
			|||||||
            <groupId>org.springframework.boot</groupId>
 | 
					            <groupId>org.springframework.boot</groupId>
 | 
				
			||||||
            <artifactId>spring-boot-starter-test</artifactId>
 | 
					            <artifactId>spring-boot-starter-test</artifactId>
 | 
				
			||||||
        </dependency>
 | 
					        </dependency>
 | 
				
			||||||
 | 
					        <dependency>
 | 
				
			||||||
 | 
					            <groupId>org.liquibase</groupId>
 | 
				
			||||||
 | 
					            <artifactId>liquibase-core</artifactId>
 | 
				
			||||||
 | 
					        </dependency>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <dependency>
 | 
				
			||||||
 | 
					            <groupId>org.springframework.boot</groupId>
 | 
				
			||||||
 | 
					            <artifactId>spring-boot-starter-data-jpa</artifactId>
 | 
				
			||||||
 | 
					        </dependency>
 | 
				
			||||||
 | 
					        <dependency>
 | 
				
			||||||
 | 
					            <groupId>org.projectlombok</groupId>
 | 
				
			||||||
 | 
					            <artifactId>lombok</artifactId>
 | 
				
			||||||
 | 
					        </dependency>
 | 
				
			||||||
 | 
					        <dependency>
 | 
				
			||||||
 | 
					            <groupId>org.springframework.boot</groupId>
 | 
				
			||||||
 | 
					            <artifactId>spring-boot-starter-actuator</artifactId>
 | 
				
			||||||
 | 
					        </dependency>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <dependency>
 | 
				
			||||||
 | 
					            <groupId>org.springframework.boot</groupId>
 | 
				
			||||||
 | 
					            <artifactId>spring-boot-starter-security</artifactId>
 | 
				
			||||||
 | 
					        </dependency>
 | 
				
			||||||
    </dependencies>
 | 
					    </dependencies>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</project>
 | 
					</project>
 | 
				
			||||||
@ -56,7 +56,6 @@ public class EmployeeController {
 | 
				
			|||||||
                response.put("login", user.getLogin());
 | 
					                response.put("login", user.getLogin());
 | 
				
			||||||
                response.put("name", user.getName());
 | 
					                response.put("name", user.getName());
 | 
				
			||||||
                response.put("photo", user.getPhoto());
 | 
					                response.put("photo", user.getPhoto());
 | 
				
			||||||
                response.put("position", user.getPosition());
 | 
					 | 
				
			||||||
                response.put("lastVisit", user.getLastVisit());
 | 
					                response.put("lastVisit", user.getLastVisit());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return ResponseEntity.ok(response);
 | 
					                return ResponseEntity.ok(response);
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										19
									
								
								src/main/java/com/example/nto/entity/Authority.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								src/main/java/com/example/nto/entity/Authority.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
				
			|||||||
 | 
					package com.example.nto.entity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import lombok.Data;
 | 
				
			||||||
 | 
					import org.springframework.security.core.GrantedAuthority;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import javax.persistence.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Entity
 | 
				
			||||||
 | 
					@Data
 | 
				
			||||||
 | 
					@Table(name="authority")
 | 
				
			||||||
 | 
					public class Authority implements GrantedAuthority {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Id
 | 
				
			||||||
 | 
					    @GeneratedValue(strategy = GenerationType.AUTO)
 | 
				
			||||||
 | 
					    private Long id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Column(name = "authority")
 | 
				
			||||||
 | 
					    private String authority;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,6 +1,7 @@
 | 
				
			|||||||
package com.example.nto.entity;
 | 
					package com.example.nto.entity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import lombok.Data;
 | 
					import lombok.Data;
 | 
				
			||||||
 | 
					import lombok.Getter;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import javax.persistence.*;
 | 
					import javax.persistence.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -10,7 +11,11 @@ import javax.persistence.*;
 | 
				
			|||||||
public class Code {
 | 
					public class Code {
 | 
				
			||||||
    @Id
 | 
					    @Id
 | 
				
			||||||
    @GeneratedValue(strategy = GenerationType.IDENTITY)
 | 
					    @GeneratedValue(strategy = GenerationType.IDENTITY)
 | 
				
			||||||
    private long id;
 | 
					    private Long id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private long value;
 | 
					    @Column(name="name", nullable = false, unique = true)
 | 
				
			||||||
 | 
					    private Long value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Column(name = "value", nullable = false, unique = true)
 | 
				
			||||||
 | 
					    private String name;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -4,38 +4,49 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 | 
				
			|||||||
import lombok.*;
 | 
					import lombok.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import javax.persistence.*;
 | 
					import javax.persistence.*;
 | 
				
			||||||
 | 
					import java.sql.Timestamp;
 | 
				
			||||||
import java.time.LocalDateTime;
 | 
					import java.time.LocalDateTime;
 | 
				
			||||||
 | 
					import java.util.Set;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Data
 | 
					@Data
 | 
				
			||||||
@Entity
 | 
					@Entity
 | 
				
			||||||
@Table(name = "employee")
 | 
					@Table(name = "employee")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
@JsonPropertyOrder({"id", "login", "name", "photo", "position", "lastVisit"})
 | 
					 | 
				
			||||||
public class Employee {
 | 
					public class Employee {
 | 
				
			||||||
    @Id
 | 
					    @Id
 | 
				
			||||||
    @GeneratedValue(strategy = GenerationType.IDENTITY)
 | 
					    @GeneratedValue(strategy = GenerationType.IDENTITY)
 | 
				
			||||||
    private long id;
 | 
					    private Long id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Getter
 | 
					    @Column(name="login", nullable = false, unique = true)
 | 
				
			||||||
    @Column(nullable = false, unique = true)
 | 
					 | 
				
			||||||
    private String login;
 | 
					    private String login;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Getter
 | 
					    @Column(name="name", nullable = false)
 | 
				
			||||||
    @Column(nullable = false)
 | 
					 | 
				
			||||||
    private String name;
 | 
					    private String name;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Getter
 | 
					    @Column(name="password", nullable = false)
 | 
				
			||||||
    @Column(nullable = false)
 | 
					    private String password;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Column(name="photo")
 | 
				
			||||||
    private String photo;
 | 
					    private String photo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Getter
 | 
					    @Column(name = "description")
 | 
				
			||||||
    @Column(nullable = false)
 | 
					    private String description;
 | 
				
			||||||
    private String position;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Getter
 | 
					    @Column(name = "birth_date")
 | 
				
			||||||
    @Column(name = "last_visit", nullable = false)
 | 
					    private String birthDate;
 | 
				
			||||||
    private LocalDateTime lastVisit;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public Long getId() { return id; }
 | 
					    @Column(name = "avatar_url")
 | 
				
			||||||
 | 
					    private String avatarUrl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Column(name = "entered_at")
 | 
				
			||||||
 | 
					    private Timestamp joinedAt;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Column(name = "created_at", nullable = false)
 | 
				
			||||||
 | 
					    private Timestamp createdAt;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Column(name = "last_visit")
 | 
				
			||||||
 | 
					    private Timestamp lastVisit;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @OneToMany(fetch = FetchType.EAGER)
 | 
				
			||||||
 | 
					    private Set<Authority> authorities;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										39
									
								
								src/main/java/com/example/nto/entity/Enter.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								src/main/java/com/example/nto/entity/Enter.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,39 @@
 | 
				
			|||||||
 | 
					package com.example.nto.entity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import liquibase.pro.packaged.C;
 | 
				
			||||||
 | 
					import lombok.Data;
 | 
				
			||||||
 | 
					import lombok.Getter;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import javax.persistence.*;
 | 
				
			||||||
 | 
					import java.sql.Timestamp;
 | 
				
			||||||
 | 
					import java.time.LocalDateTime;
 | 
				
			||||||
 | 
					import java.util.Set;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Data
 | 
				
			||||||
 | 
					@Entity
 | 
				
			||||||
 | 
					@Table(name = "enter")
 | 
				
			||||||
 | 
					public class Enter {
 | 
				
			||||||
 | 
					    @Id
 | 
				
			||||||
 | 
					    @GeneratedValue(strategy = GenerationType.IDENTITY)
 | 
				
			||||||
 | 
					    private Long id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ManyToMany
 | 
				
			||||||
 | 
					    @JoinTable(
 | 
				
			||||||
 | 
					            name = "enter_employee", // Name of the join table
 | 
				
			||||||
 | 
					            joinColumns = @JoinColumn(name = "enter_id"), // Column for this entity
 | 
				
			||||||
 | 
					            inverseJoinColumns = @JoinColumn(name = "employee_id") // Column for the other entity
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					    private Set<Employee> employees;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ManyToMany
 | 
				
			||||||
 | 
					    @JoinTable(
 | 
				
			||||||
 | 
					            name = "enter_code", // Name of the join table
 | 
				
			||||||
 | 
					            joinColumns = @JoinColumn(name = "enter_id"), // Column for this entity
 | 
				
			||||||
 | 
					            inverseJoinColumns = @JoinColumn(name = "code_id") // Column for the other entity
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					    private Set<Code> codes;
 | 
				
			||||||
 | 
					    @Column(nullable = false)
 | 
				
			||||||
 | 
					    private Timestamp entered_at;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class AuthorityNotFoundException extends RuntimeException {
 | 
					 | 
				
			||||||
    public AuthorityNotFoundException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class CenterNotFoundException extends RuntimeException {
 | 
					 | 
				
			||||||
    public CenterNotFoundException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class EmailAlreadyExistsException extends RuntimeException {
 | 
					 | 
				
			||||||
    public EmailAlreadyExistsException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class InvalidBirthDateException extends RuntimeException {
 | 
					 | 
				
			||||||
    public InvalidBirthDateException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class InvalidDescriptionException extends RuntimeException {
 | 
					 | 
				
			||||||
    public InvalidDescriptionException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class InvalidNameException extends RuntimeException {
 | 
					 | 
				
			||||||
    public InvalidNameException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class InvalidPasswordException extends RuntimeException {
 | 
					 | 
				
			||||||
    public InvalidPasswordException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class NoRequestBodyException extends RuntimeException {
 | 
					 | 
				
			||||||
    public NoRequestBodyException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class NoRequestParamsException extends RuntimeException {
 | 
					 | 
				
			||||||
    public NoRequestParamsException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class OtherException extends RuntimeException {
 | 
					 | 
				
			||||||
    public OtherException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class UserHasNoCenterException extends RuntimeException {
 | 
					 | 
				
			||||||
    public UserHasNoCenterException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class UserNotFoundException extends RuntimeException {
 | 
					 | 
				
			||||||
    public UserNotFoundException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class UsernameAlreadyExistsException extends RuntimeException {
 | 
					 | 
				
			||||||
    public UsernameAlreadyExistsException(String message) {
 | 
					 | 
				
			||||||
        super(message);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,77 +0,0 @@
 | 
				
			|||||||
package com.example.nto.exception.handler;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import com.example.bootcamp.exception.*;
 | 
					 | 
				
			||||||
import liquibase.pro.packaged.E;
 | 
					 | 
				
			||||||
import org.springframework.http.HttpStatus;
 | 
					 | 
				
			||||||
import org.springframework.http.ResponseEntity;
 | 
					 | 
				
			||||||
import org.springframework.web.bind.annotation.ControllerAdvice;
 | 
					 | 
				
			||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@ControllerAdvice
 | 
					 | 
				
			||||||
public class GlobalExceptionHandler {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(CenterNotFoundException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleCenterNotFoundException(CenterNotFoundException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.NOT_FOUND);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(UserNotFoundException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleUserNotFoundException(UserNotFoundException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.NOT_FOUND);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(UserHasNoCenterException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleUserException(UserHasNoCenterException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.CONFLICT);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(NoRequestBodyException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleNoRequestBodyException(NoRequestBodyException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(EmailAlreadyExistsException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleEmailAlreadyExistsException(EmailAlreadyExistsException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.CONFLICT);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(NoRequestParamsException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleNoRequestParamsException(NoRequestParamsException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(InvalidBirthDateException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleInvalidBirthDateException(InvalidBirthDateException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(InvalidPasswordException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleInvalidPasswordException(InvalidPasswordException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(InvalidNameException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleInvalidNameException(InvalidNameException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(InvalidDescriptionException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleInvalidDescriptionException(InvalidDescriptionException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(OtherException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleOtherException(OtherException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(UsernameAlreadyExistsException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleUsernameAlreadyExistsException(UsernameAlreadyExistsException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.CONFLICT);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @ExceptionHandler(AuthorityNotFoundException.class)
 | 
					 | 
				
			||||||
    public ResponseEntity<String> handleAuthorityNotFoundException(AuthorityNotFoundException e) {
 | 
					 | 
				
			||||||
        return new ResponseEntity<>(e.getMessage(), HttpStatus.NOT_FOUND);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -3,8 +3,10 @@ package com.example.nto.repository;
 | 
				
			|||||||
import com.example.nto.entity.Employee;
 | 
					import com.example.nto.entity.Employee;
 | 
				
			||||||
import org.springframework.data.jpa.repository.JpaRepository;
 | 
					import org.springframework.data.jpa.repository.JpaRepository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.Optional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public interface EmployeeRepository extends JpaRepository<Employee, Long> {
 | 
					public interface EmployeeRepository extends JpaRepository<Employee, Long> {
 | 
				
			||||||
    Boolean existsByLogin(String login);
 | 
					    Boolean existsByLogin(String login);
 | 
				
			||||||
    Employee getEmployeeByLogin(String login);
 | 
					    Optional<Employee> findByLogin(String login);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -0,0 +1,9 @@
 | 
				
			|||||||
 | 
					package com.example.nto.repository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.example.nto.entity.Enter;
 | 
				
			||||||
 | 
					import org.springframework.data.jpa.repository.JpaRepository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public interface EnterRepository extends JpaRepository<Enter, Long> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Enter getByEmployee();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,5 +1,8 @@
 | 
				
			|||||||
package com.example.nto.service;
 | 
					package com.example.nto.service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public interface EmployeeService {
 | 
					public interface EmployeeService {
 | 
				
			||||||
    boolean checkLogin(String login);
 | 
					    boolean checkLogin(String login);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										8
									
								
								src/main/java/com/example/nto/service/EnterService.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/main/java/com/example/nto/service/EnterService.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
				
			|||||||
 | 
					package com.example.nto.service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.example.nto.entity.Enter;
 | 
				
			||||||
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public interface EnterService {
 | 
				
			||||||
 | 
					    Enter getEnterByLogin(String Login);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,19 @@
 | 
				
			|||||||
 | 
					package com.example.nto.service.impl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.example.nto.entity.Enter;
 | 
				
			||||||
 | 
					import com.example.nto.repository.EnterRepository;
 | 
				
			||||||
 | 
					import com.example.nto.service.EnterService;
 | 
				
			||||||
 | 
					import lombok.RequiredArgsConstructor;
 | 
				
			||||||
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Service
 | 
				
			||||||
 | 
					@RequiredArgsConstructor
 | 
				
			||||||
 | 
					public class EnterServiceImpl implements EnterService {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final EnterRepository enterRepository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public Enter getEnterByLogin(String Login) {
 | 
				
			||||||
 | 
					        return null;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,28 @@
 | 
				
			|||||||
 | 
					package com.example.nto.service.impl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.example.nto.entity.Employee;
 | 
				
			||||||
 | 
					import com.example.nto.repository.EmployeeRepository;
 | 
				
			||||||
 | 
					import lombok.RequiredArgsConstructor;
 | 
				
			||||||
 | 
					import org.springframework.security.core.userdetails.UserDetails;
 | 
				
			||||||
 | 
					import org.springframework.security.core.userdetails.UserDetailsService;
 | 
				
			||||||
 | 
					import org.springframework.security.core.userdetails.UsernameNotFoundException;
 | 
				
			||||||
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.Optional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Service
 | 
				
			||||||
 | 
					@RequiredArgsConstructor
 | 
				
			||||||
 | 
					public class UserDetailsServiceImpl implements UserDetailsService {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final EmployeeRepository employeeRepository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
 | 
				
			||||||
 | 
					        Employee optionalPerson = employeeRepository.findByLogin(s);
 | 
				
			||||||
 | 
					        if (optionalPerson.isEmpty()) {
 | 
				
			||||||
 | 
					            throw new UsernameNotFoundException("User not found");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return optionalPerson.get();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -9,18 +9,20 @@ spring:
 | 
				
			|||||||
      enabled: true
 | 
					      enabled: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  jpa:
 | 
					  jpa:
 | 
				
			||||||
    #generate-ddl: false
 | 
					    generate-ddl: false
 | 
				
			||||||
    generate-ddl: true
 | 
					    #generate-ddl: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    hibernate:
 | 
					    hibernate:
 | 
				
			||||||
      #ddl-auto: none
 | 
					      ddl-auto: none
 | 
				
			||||||
      ddl-auto: create-drop
 | 
					      #ddl-auto: create-drop
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Показываем запросы
 | 
					    # Показываем запросы
 | 
				
			||||||
    show-sql: true
 | 
					    show-sql: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Своевременный запуск data.sql
 | 
					  liquibase:
 | 
				
			||||||
    defer-datasource-initialization: true
 | 
					    enabled: true
 | 
				
			||||||
 | 
					    change-log: classpath:db.changelog/db.changelog-master.xml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  spring-doc:
 | 
					  spring-doc:
 | 
				
			||||||
    swagger-ui:
 | 
					    swagger-ui:
 | 
				
			||||||
 | 
				
			|||||||
@ -1,14 +0,0 @@
 | 
				
			|||||||
INSERT INTO employee (id, login, name, photo, position, last_visit)
 | 
					 | 
				
			||||||
VALUES
 | 
					 | 
				
			||||||
(1, 'pivanov', 'Иванов Петр Федорович', 'https://funnyducks.ru/upload/iblock/0cd/0cdeb7ec3ed6fddda0f90fccee05557d.jpg', 'Разработчик', '2024-02-12T08:30'),
 | 
					 | 
				
			||||||
(2, 'ipetrov', 'Петров Иван Константинович', 'https://funnyducks.ru/upload/iblock/0cd/0cdeb7ec3ed6fddda0f90fccee05557d.jpg', 'Аналитик', '2024-02-13T08:35'),
 | 
					 | 
				
			||||||
(3, 'asemenov', 'Семенов Анатолий Анатольевич', 'https://funnyducks.ru/upload/iblock/0cd/0cdeb7ec3ed6fddda0f90fccee05557d.jpg', 'Разработчик', '2024-02-13T08:31'),
 | 
					 | 
				
			||||||
(4, 'afedorov', 'Федоров Александр Сергеевич', 'https://funnyducks.ru/upload/iblock/0cd/0cdeb7ec3ed6fddda0f90fccee05557d.jpg', 'Тестировщик', '2024-02-12T08:36');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
INSERT INTO code (value)
 | 
					 | 
				
			||||||
VALUES
 | 
					 | 
				
			||||||
(1234567890123456789),
 | 
					 | 
				
			||||||
(9223372036854775807),
 | 
					 | 
				
			||||||
(1122334455667788990),
 | 
					 | 
				
			||||||
(998877665544332211),
 | 
					 | 
				
			||||||
(5566778899001122334);
 | 
					 | 
				
			||||||
@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
				
			||||||
 | 
					                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
				
			||||||
 | 
					                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
				
			||||||
 | 
					                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
 | 
				
			||||||
 | 
					        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <changeSet id="2025-01-30--0001-code" author="nzhavoronkov">
 | 
				
			||||||
 | 
					        <preConditions onFail="MARK_RAN">
 | 
				
			||||||
 | 
					            <not>
 | 
				
			||||||
 | 
					                <tableExists tableName="code"/>
 | 
				
			||||||
 | 
					            </not>
 | 
				
			||||||
 | 
					        </preConditions>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <createTable tableName="code">
 | 
				
			||||||
 | 
					            <column name="id" type="BIGINT" autoIncrement="true">
 | 
				
			||||||
 | 
					                <constraints primaryKey="true" nullable="false"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					            <column name="name" type="VARCHAR">
 | 
				
			||||||
 | 
					                <constraints nullable="false" unique="true"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					            <column name="value" type="Long">
 | 
				
			||||||
 | 
					                <constraints nullable="false"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					        </createTable>
 | 
				
			||||||
 | 
					    </changeSet>
 | 
				
			||||||
 | 
					</databaseChangeLog>
 | 
				
			||||||
@ -0,0 +1,37 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
				
			||||||
 | 
					                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
				
			||||||
 | 
					                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
				
			||||||
 | 
					                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
 | 
				
			||||||
 | 
					        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <changeSet id="2025-01-30--0002-employee" author="nzhavoronkov">
 | 
				
			||||||
 | 
					        <preConditions onFail="MARK_RAN">
 | 
				
			||||||
 | 
					            <not>
 | 
				
			||||||
 | 
					                <tableExists tableName="employee"/>
 | 
				
			||||||
 | 
					            </not>
 | 
				
			||||||
 | 
					        </preConditions>
 | 
				
			||||||
 | 
					        <createTable tableName="employee">
 | 
				
			||||||
 | 
					            <column name="id" type="BIGINT" autoIncrement="true">
 | 
				
			||||||
 | 
					                <constraints primaryKey="true" nullable="false"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					            <column name="name" type="VARCHAR(100)">
 | 
				
			||||||
 | 
					                <constraints nullable="false"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					            <column name="login" type="VARCHAR(100)">
 | 
				
			||||||
 | 
					                <constraints nullable="false"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					            <column name="password" type="VARCHAR(100)">
 | 
				
			||||||
 | 
					                <constraints nullable="false"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					            <column name="description" type="VARCHAR(200)"/>
 | 
				
			||||||
 | 
					            <column name="birth_date" type="VARCHAR(10)"/>
 | 
				
			||||||
 | 
					            <column name="avatar_url" type="VARCHAR"/>
 | 
				
			||||||
 | 
					            <column name="last_enter" type="TIMESTAMP"/>
 | 
				
			||||||
 | 
					            <column name="created_at" type="TIMESTAMP">
 | 
				
			||||||
 | 
					                <constraints nullable="false"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					        </createTable>
 | 
				
			||||||
 | 
					    </changeSet>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</databaseChangeLog>
 | 
				
			||||||
@ -0,0 +1,24 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
				
			||||||
 | 
					                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
				
			||||||
 | 
					                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
				
			||||||
 | 
					                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
 | 
				
			||||||
 | 
					        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <changeSet id="2025-02-05--0003-authority" author="nzhavoronkov">
 | 
				
			||||||
 | 
					        <preConditions onFail="MARK_RAN">
 | 
				
			||||||
 | 
					            <not>
 | 
				
			||||||
 | 
					                <tableExists tableName="authority"/>
 | 
				
			||||||
 | 
					            </not>
 | 
				
			||||||
 | 
					        </preConditions>
 | 
				
			||||||
 | 
					        <createTable tableName="authority">
 | 
				
			||||||
 | 
					            <column name="id" type="BIGINT" autoIncrement="true">
 | 
				
			||||||
 | 
					                <constraints primaryKey="true" nullable="false"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					            <column name="authority" type="VARCHAR(100)">
 | 
				
			||||||
 | 
					                <constraints nullable="false" unique="true"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					        </createTable>
 | 
				
			||||||
 | 
					    </changeSet>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</databaseChangeLog>
 | 
				
			||||||
@ -0,0 +1,30 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
				
			||||||
 | 
					                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
				
			||||||
 | 
					                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
				
			||||||
 | 
					                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
 | 
				
			||||||
 | 
					        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <changeSet id="2025-02-05--0004-employee-authorities" author="nzhavoronkov">
 | 
				
			||||||
 | 
					        <preConditions onFail="MARK_RAN">
 | 
				
			||||||
 | 
					            <not>
 | 
				
			||||||
 | 
					                <tableExists tableName="employee_authorities"/>
 | 
				
			||||||
 | 
					            </not>
 | 
				
			||||||
 | 
					        </preConditions>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <createTable tableName="employee_authorities">
 | 
				
			||||||
 | 
					            <column name="id" type="BIGINT" autoIncrement="true">
 | 
				
			||||||
 | 
					                <constraints primaryKey="true" nullable="false"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					            <column name="user_id" type="BIGINT">
 | 
				
			||||||
 | 
					                <constraints nullable="false" foreignKeyName="fk_userauth_employee" referencedTableName="employee"
 | 
				
			||||||
 | 
					                             referencedColumnNames="id"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					            <column name="authorities_id" type="BIGINT">
 | 
				
			||||||
 | 
					                <constraints nullable="false" foreignKeyName="fk_userauth_authority" referencedTableName="authority"
 | 
				
			||||||
 | 
					                             referencedColumnNames="id"/>
 | 
				
			||||||
 | 
					            </column>
 | 
				
			||||||
 | 
					        </createTable>
 | 
				
			||||||
 | 
					    </changeSet>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</databaseChangeLog>
 | 
				
			||||||
@ -0,0 +1,14 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
				
			||||||
 | 
					                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
				
			||||||
 | 
					                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
				
			||||||
 | 
					                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
 | 
				
			||||||
 | 
					        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <changeSet id="2025-01-30--0001-code-data" author="nzhavoronkov">
 | 
				
			||||||
 | 
					        <loadData tableName="code" file="db.changelog/data/csv/2025-01-30--0001-code-data.csv"
 | 
				
			||||||
 | 
					                  separator=";"
 | 
				
			||||||
 | 
					                  quotchar='"'
 | 
				
			||||||
 | 
					                  encoding="UTF-8"/>
 | 
				
			||||||
 | 
					    </changeSet>
 | 
				
			||||||
 | 
					</databaseChangeLog>
 | 
				
			||||||
@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
				
			||||||
 | 
					                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
				
			||||||
 | 
					                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
				
			||||||
 | 
					                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
 | 
				
			||||||
 | 
					        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <changeSet id="2025-01-30--0002-employee-data" author="nzhavoronkov">
 | 
				
			||||||
 | 
					        <sql>
 | 
				
			||||||
 | 
					            ALTER TABLE employee ALTER COLUMN created_at SET DEFAULT CURRENT_TIMESTAMP;
 | 
				
			||||||
 | 
					        </sql>
 | 
				
			||||||
 | 
					        <loadData tableName="employee" file="db.changelog/data/csv/2025-01-30--0002-employee-data.csv"
 | 
				
			||||||
 | 
					                  separator=";"
 | 
				
			||||||
 | 
					                  quotchar='"'
 | 
				
			||||||
 | 
					                  encoding="UTF-8"/>
 | 
				
			||||||
 | 
					    </changeSet>
 | 
				
			||||||
 | 
					</databaseChangeLog>
 | 
				
			||||||
@ -0,0 +1,14 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
				
			||||||
 | 
					                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
				
			||||||
 | 
					                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
				
			||||||
 | 
					                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
 | 
				
			||||||
 | 
					        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <changeSet id="2025-02-05--0003-authority-data" author="nzhavoronkov">
 | 
				
			||||||
 | 
					        <loadData tableName="authority" file="db.changelog/data/csv/2025-02-05--0003-authority-data.csv"
 | 
				
			||||||
 | 
					                  separator=";"
 | 
				
			||||||
 | 
					                  quotchar='"'
 | 
				
			||||||
 | 
					                  encoding="UTF-8"/>
 | 
				
			||||||
 | 
					    </changeSet>
 | 
				
			||||||
 | 
					</databaseChangeLog>
 | 
				
			||||||
@ -0,0 +1,14 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
				
			||||||
 | 
					                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
				
			||||||
 | 
					                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
				
			||||||
 | 
					                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
 | 
				
			||||||
 | 
					        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <changeSet id="2025-02-05--0003-empolyee-authorities-data" author="nzhavoronkov">
 | 
				
			||||||
 | 
					        <loadData tableName="employee_authorities" file="db.changelog/data/csv/2025-02-05--0003-employee-authorities-data.csv"
 | 
				
			||||||
 | 
					                  separator=";"
 | 
				
			||||||
 | 
					                  quotchar='"'
 | 
				
			||||||
 | 
					                  encoding="UTF-8"/>
 | 
				
			||||||
 | 
					    </changeSet>
 | 
				
			||||||
 | 
					</databaseChangeLog>
 | 
				
			||||||
@ -0,0 +1,14 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
				
			||||||
 | 
					                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
				
			||||||
 | 
					                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
				
			||||||
 | 
					                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
 | 
				
			||||||
 | 
					        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <changeSet id="2025-02-18--0005-enter-data" author="nzhavoronkov">
 | 
				
			||||||
 | 
					        <loadData tableName="enter" file="db.changelog/data/csv/2025-02-18--0005-enter-data.csv"
 | 
				
			||||||
 | 
					                  separator=";"
 | 
				
			||||||
 | 
					                  quotchar='"'
 | 
				
			||||||
 | 
					                  encoding="UTF-8"/>
 | 
				
			||||||
 | 
					    </changeSet>
 | 
				
			||||||
 | 
					</databaseChangeLog>
 | 
				
			||||||
@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					name;value
 | 
				
			||||||
 | 
					Вход "A";1234567890123456789
 | 
				
			||||||
 | 
					Вход "Реактор";9223372036854775807
 | 
				
			||||||
 | 
					Вход "Лаборатория";1122334455667788990
 | 
				
			||||||
 | 
					Вход "Навигация";998877665544332211
 | 
				
			||||||
 | 
					Вход "Б";5566778899001122334
 | 
				
			||||||
| 
		
		
			 Can't render this file because it contains an unexpected character in line 2 and column 10. 
		
	 | 
@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					name;login;password;description;avatar_url
 | 
				
			||||||
 | 
					Никита;nzh;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;sysadmin - is my passion;https://i.pinimg.com/736x/74/50/b2/7450b27aefa67d3ba126dab3023d3a4f.jpg
 | 
				
			||||||
 | 
					Ксюша;ksh;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;ui/ux - true love;https://s2.hostingkartinok.com/uploads/images/2013/08/9b22035204e381ee2b54d10b9251d9e1.png
 | 
				
			||||||
 | 
					Вася;vasya;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;https://i.pinimg.com/736x/45/76/20/45762041651b269c7375e4bc83137695.jpg
 | 
				
			||||||
 | 
					Таня;tanya;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTfk_JZXZ8eWUU-8A6Ls7Qn4pcYpE16rUHy7g&s
 | 
				
			||||||
 | 
					Максим;maksim;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQcj2Nr_VM4rvfLeHklb-JA_toVaDg7IFB4Nw&s
 | 
				
			||||||
 | 
					Васек;vasya1;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;https://i.pinimg.com/736x/45/76/20/45762041651b269c7375e4bc83137695.jpg
 | 
				
			||||||
 | 
					Танек;tanya1;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTfk_JZXZ8eWUU-8A6Ls7Qn4pcYpE16rUHy7g&s
 | 
				
			||||||
 | 
					Максимок;maksim1;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQcj2Nr_VM4rvfLeHklb-JA_toVaDg7IFB4Nw&s
 | 
				
			||||||
 | 
					Петя;petya;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRSwB8zx8dh25EpckaIBW8BRBzHCUNfLwiuhw&s
 | 
				
			||||||
 | 
					Петька;petya1;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRSwB8zx8dh25EpckaIBW8BRBzHCUNfLwiuhw&s
 | 
				
			||||||
 | 
					Катя;katya;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS_uvFIqpHNQ-DZP7XNbPyYmga5Z1KOxNQfZQ&s
 | 
				
			||||||
 | 
					Катька;katya1;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS_uvFIqpHNQ-DZP7XNbPyYmga5Z1KOxNQfZQ&s
 | 
				
			||||||
 | 
					Андрей;andrey;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;
 | 
				
			||||||
 | 
					Андрюха;andrey1;$2b$12$.XPrLwQtsr2UzI6M/KiqFO6UY.aUyRULerAd.cgjAeQOLj0pljmPG;;
 | 
				
			||||||
		
		
			
  | 
@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					authority
 | 
				
			||||||
 | 
					ROLE_USER
 | 
				
			||||||
 | 
					ROLE_ADMIN
 | 
				
			||||||
		
		
			
  | 
@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					user_id;authorities_id
 | 
				
			||||||
 | 
					1;2
 | 
				
			||||||
 | 
					2;2
 | 
				
			||||||
		
		
			
  | 
@ -0,0 +1,8 @@
 | 
				
			|||||||
 | 
					employee_id;code_id
 | 
				
			||||||
 | 
					1;1
 | 
				
			||||||
 | 
					1;3
 | 
				
			||||||
 | 
					1;4
 | 
				
			||||||
 | 
					2;2
 | 
				
			||||||
 | 
					2;3
 | 
				
			||||||
 | 
					2;2
 | 
				
			||||||
 | 
					2;5
 | 
				
			||||||
		
		
			
  | 
							
								
								
									
										16
									
								
								src/main/resources/db.changelog/db.changelog-master.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/main/resources/db.changelog/db.changelog-master.xml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,16 @@
 | 
				
			|||||||
 | 
					<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
 | 
				
			||||||
 | 
					                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
				
			||||||
 | 
					                   xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
 | 
				
			||||||
 | 
					                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd
 | 
				
			||||||
 | 
					        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
 | 
				
			||||||
 | 
					    <include file="/db.changelog/1.0/2025-01-30--0001-code.xml"/>
 | 
				
			||||||
 | 
					    <include file="/db.changelog/data/2025-01-30--0001-code-data.xml"/>
 | 
				
			||||||
 | 
					    <include file="/db.changelog/1.0/2025-02-05--0003-authority.xml"/>
 | 
				
			||||||
 | 
					    <include file="/db.changelog/data/2025-02-05--0003-authority-data.xml"/>
 | 
				
			||||||
 | 
					    <include file="/db.changelog/1.0/2025-01-30--0002-employee.xml"/>
 | 
				
			||||||
 | 
					    <include file="/db.changelog/data/2025-01-30--0002-employee-data.xml"/>
 | 
				
			||||||
 | 
					    <include file="/db.changelog/1.0/2025-02-18--0005-enter.xml"/>
 | 
				
			||||||
 | 
					    <include file="/db.changelog/data/2025-02-18--0005-enter-data.xml"/>
 | 
				
			||||||
 | 
					    <include file="/db.changelog/1.0/2025-02-05--0004-employee-authorities.xml"/>
 | 
				
			||||||
 | 
					    <include file="/db.changelog/data/2025-02-05--0004-employee-authorities-data.xml"/>
 | 
				
			||||||
 | 
					</databaseChangeLog>
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user