Inital commit
This commit is contained in:
commit
9f44325590
32
.gitignore
vendored
Normal file
32
.gitignore
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
57
pom.xml
Normal file
57
pom.xml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>org.example</groupId>
|
||||||
|
<artifactId>NTO-2024</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.5.5</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-ui</artifactId>
|
||||||
|
<version>1.7.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-engine</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
9
src/main/java/com/example/nto/App.java
Normal file
9
src/main/java/com/example/nto/App.java
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package com.example.nto;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class App {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
package com.example.nto.controller;
|
||||||
|
|
||||||
|
public class EmployeeController {
|
||||||
|
}
|
15
src/main/java/com/example/nto/entity/Code.java
Normal file
15
src/main/java/com/example/nto/entity/Code.java
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package com.example.nto.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Code {
|
||||||
|
private long id;
|
||||||
|
private long value;
|
||||||
|
}
|
21
src/main/java/com/example/nto/entity/Employee.java
Normal file
21
src/main/java/com/example/nto/entity/Employee.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package com.example.nto.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Employee {
|
||||||
|
private long id;
|
||||||
|
private String login;
|
||||||
|
private String name;
|
||||||
|
private String photo;
|
||||||
|
private String position;
|
||||||
|
private LocalDateTime lastVisit;
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.example.nto.repository;
|
||||||
|
|
||||||
|
import com.example.nto.entity.Code;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface CodeRepository extends JpaRepository<Code, Long> {
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.example.nto.repository;
|
||||||
|
|
||||||
|
import com.example.nto.entity.Employee;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface EmployeeRepository extends JpaRepository<Employee, Long> {
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
package com.example.nto.service;
|
||||||
|
|
||||||
|
public interface EmployeeService {
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package com.example.nto.service.impl;
|
||||||
|
|
||||||
|
import com.example.nto.service.EmployeeService;
|
||||||
|
|
||||||
|
public class EmployeeServiceImpl implements EmployeeService {
|
||||||
|
}
|
28
src/main/resources/application.yml
Normal file
28
src/main/resources/application.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
spring:
|
||||||
|
|
||||||
|
datasource:
|
||||||
|
url: jdbc:h2:mem:testdb
|
||||||
|
|
||||||
|
h2:
|
||||||
|
console:
|
||||||
|
#enabled: false
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
jpa:
|
||||||
|
#generate-ddl: false
|
||||||
|
generate-ddl: true
|
||||||
|
|
||||||
|
hibernate:
|
||||||
|
#ddl-auto: none
|
||||||
|
ddl-auto: create-drop
|
||||||
|
|
||||||
|
# Показываем запросы
|
||||||
|
show-sql: true
|
||||||
|
|
||||||
|
# Своевременный запуск data.sql
|
||||||
|
defer-datasource-initialization: true
|
||||||
|
|
||||||
|
spring-doc:
|
||||||
|
swagger-ui:
|
||||||
|
path: /swagger-ui.html
|
||||||
|
operationsSorter: method
|
14
src/main/resources/data.sql
Normal file
14
src/main/resources/data.sql
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
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);
|
Loading…
x
Reference in New Issue
Block a user