commit 9f4432559016f27ba34682b27f6f58a2d637b5d7 Author: vladimir-shperling Date: Wed Oct 30 01:40:49 2024 +0700 Inital commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..98f5c59 --- /dev/null +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..88282ee --- /dev/null +++ b/pom.xml @@ -0,0 +1,57 @@ + + + 4.0.0 + + org.example + NTO-2024 + 1.0-SNAPSHOT + + + 11 + 11 + UTF-8 + + + + org.springframework.boot + spring-boot-starter-parent + 2.5.5 + + + + + org.projectlombok + lombok + + + org.springframework.boot + spring-boot-starter-web + + + com.h2database + h2 + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springdoc + springdoc-openapi-ui + 1.7.0 + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.springframework.boot + spring-boot-starter-test + test + + + + \ No newline at end of file diff --git a/src/main/java/com/example/nto/App.java b/src/main/java/com/example/nto/App.java new file mode 100644 index 0000000..d771a13 --- /dev/null +++ b/src/main/java/com/example/nto/App.java @@ -0,0 +1,9 @@ +package com.example.nto; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class App { + public static void main(String[] args) { + } +} diff --git a/src/main/java/com/example/nto/controller/EmployeeController.java b/src/main/java/com/example/nto/controller/EmployeeController.java new file mode 100644 index 0000000..fcb92ec --- /dev/null +++ b/src/main/java/com/example/nto/controller/EmployeeController.java @@ -0,0 +1,4 @@ +package com.example.nto.controller; + +public class EmployeeController { +} diff --git a/src/main/java/com/example/nto/entity/Code.java b/src/main/java/com/example/nto/entity/Code.java new file mode 100644 index 0000000..e1009f5 --- /dev/null +++ b/src/main/java/com/example/nto/entity/Code.java @@ -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; +} diff --git a/src/main/java/com/example/nto/entity/Employee.java b/src/main/java/com/example/nto/entity/Employee.java new file mode 100644 index 0000000..aa57aa4 --- /dev/null +++ b/src/main/java/com/example/nto/entity/Employee.java @@ -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; +} diff --git a/src/main/java/com/example/nto/repository/CodeRepository.java b/src/main/java/com/example/nto/repository/CodeRepository.java new file mode 100644 index 0000000..4ca3152 --- /dev/null +++ b/src/main/java/com/example/nto/repository/CodeRepository.java @@ -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 { +} diff --git a/src/main/java/com/example/nto/repository/EmployeeRepository.java b/src/main/java/com/example/nto/repository/EmployeeRepository.java new file mode 100644 index 0000000..e1265db --- /dev/null +++ b/src/main/java/com/example/nto/repository/EmployeeRepository.java @@ -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 { +} diff --git a/src/main/java/com/example/nto/service/EmployeeService.java b/src/main/java/com/example/nto/service/EmployeeService.java new file mode 100644 index 0000000..7b91091 --- /dev/null +++ b/src/main/java/com/example/nto/service/EmployeeService.java @@ -0,0 +1,4 @@ +package com.example.nto.service; + +public interface EmployeeService { +} diff --git a/src/main/java/com/example/nto/service/impl/EmployeeServiceImpl.java b/src/main/java/com/example/nto/service/impl/EmployeeServiceImpl.java new file mode 100644 index 0000000..2414533 --- /dev/null +++ b/src/main/java/com/example/nto/service/impl/EmployeeServiceImpl.java @@ -0,0 +1,6 @@ +package com.example.nto.service.impl; + +import com.example.nto.service.EmployeeService; + +public class EmployeeServiceImpl implements EmployeeService { +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..c6bfd72 --- /dev/null +++ b/src/main/resources/application.yml @@ -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 \ No newline at end of file diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql new file mode 100644 index 0000000..03720a9 --- /dev/null +++ b/src/main/resources/data.sql @@ -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); \ No newline at end of file