esoe 8 months ago
parent
commit
f301e28f89
  1. 15
      resource-service-api/pom.xml
  2. 26
      resource-service-api/src/main/java/ru/molokoin/resourceserviceapi/entities/Teacher.java
  3. 11
      resource-service-api/src/main/java/ru/molokoin/resourceserviceapi/repositories/TeachersRepositoryFace.java
  4. 8
      resource-service-api/src/main/resources/application.yaml

15
resource-service-api/pom.xml

@ -31,12 +31,25 @@
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId> <artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>annotationProcessor</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

26
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;
}

11
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<Teacher, Long>{
}

8
resource-service-api/src/main/resources/application.yaml

@ -3,3 +3,11 @@ server:
spring: spring:
application: application:
name: resource-service-api 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

Loading…
Cancel
Save