diff --git a/resource-service-api/pom.xml b/resource-service-api/pom.xml index 96196b5..92a6274 100644 --- a/resource-service-api/pom.xml +++ b/resource-service-api/pom.xml @@ -31,12 +31,25 @@ spring-boot-starter-test test - org.springframework.boot spring-boot-devtools runtime + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.postgresql + postgresql + runtime + + + org.projectlombok + lombok + annotationProcessor + diff --git a/resource-service-api/src/main/java/ru/molokoin/resourceserviceapi/entities/Teacher.java b/resource-service-api/src/main/java/ru/molokoin/resourceserviceapi/entities/Teacher.java new file mode 100644 index 0000000..6cca95b --- /dev/null +++ b/resource-service-api/src/main/java/ru/molokoin/resourceserviceapi/entities/Teacher.java @@ -0,0 +1,26 @@ +package ru.molokoin.resourceserviceapi.entities; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@AllArgsConstructor +@Entity +@Data +public class Teacher { + @Id + @GeneratedValue(strategy=GenerationType.AUTO) + private long id; + @Column(length=50) + private String first_name;//Имя + private String second_name;//Фамилия + private String last_name;//Отчество + private String employee_id; + private String snils; +} diff --git a/resource-service-api/src/main/java/ru/molokoin/resourceserviceapi/repositories/TeachersRepositoryFace.java b/resource-service-api/src/main/java/ru/molokoin/resourceserviceapi/repositories/TeachersRepositoryFace.java new file mode 100644 index 0000000..7ff4873 --- /dev/null +++ b/resource-service-api/src/main/java/ru/molokoin/resourceserviceapi/repositories/TeachersRepositoryFace.java @@ -0,0 +1,11 @@ +package ru.molokoin.resourceserviceapi.repositories; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +import ru.molokoin.resourceserviceapi.entities.Teacher; + +@Repository +public interface TeachersRepositoryFace extends CrudRepository{ + +} diff --git a/resource-service-api/src/main/resources/application.yaml b/resource-service-api/src/main/resources/application.yaml index 701120b..2107639 100644 --- a/resource-service-api/src/main/resources/application.yaml +++ b/resource-service-api/src/main/resources/application.yaml @@ -3,3 +3,11 @@ server: spring: application: name: resource-service-api + jpa: + hibernate: + ddl-auto: update + database-platform: org.hibernate.dialect.PostgreSQLDialect + datasource: + url: "jdbc:postgresql://postgres-service:5432/tech-services" + username: tech-services + password: password