Create TimeRecord, Timetrackaccount and Role

Move Entities in correct packages
This commit is contained in:
Marcel Schwarz 2020-04-28 23:04:14 +02:00
parent 945316ae67
commit 56a3ddad27
13 changed files with 42 additions and 32 deletions

View File

@ -14,7 +14,6 @@ repositories {
} }
dependencies { dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.springframework.boot:spring-boot-starter-actuator'

View File

@ -0,0 +1,7 @@
package de.hft.geotime.record;
import org.springframework.data.repository.CrudRepository;
public interface RecordRepository extends CrudRepository<TimeRecord, Long> {
}

View File

@ -1,4 +1,4 @@
package de.hft.geotime.entities; package de.hft.geotime.record;
public enum RecordType { public enum RecordType {
BREAK, BREAK,

View File

@ -1,9 +1,9 @@
package de.hft.geotime.entities; package de.hft.geotime.record;
import de.hft.geotime.timetrackaccount.TimetrackAccount;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.hibernate.type.TimeType;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;

View File

@ -1,9 +0,0 @@
package de.hft.geotime.repositories;
import de.hft.geotime.entities.Role;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@RepositoryRestResource
public interface RoleRepository extends PagingAndSortingRepository<Role, Long> {
}

View File

@ -1,15 +0,0 @@
package de.hft.geotime.repositories;
import de.hft.geotime.entities.User;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import javax.websocket.server.PathParam;
import java.util.List;
@RepositoryRestResource
public interface UserRepository extends PagingAndSortingRepository<User, Long> {
List<User> findByUsername(@PathParam("username") String username);
}

View File

@ -1,4 +1,4 @@
package de.hft.geotime.entities; package de.hft.geotime.role;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;

View File

@ -0,0 +1,7 @@
package de.hft.geotime.role;
import org.springframework.data.repository.CrudRepository;
public interface RoleRepository extends CrudRepository<Role, Long> {
}

View File

@ -1,5 +1,6 @@
package de.hft.geotime.entities; package de.hft.geotime.timetrackaccount;
import de.hft.geotime.user.User;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -0,0 +1,7 @@
package de.hft.geotime.timetrackaccount;
import org.springframework.data.repository.CrudRepository;
public interface TimetrackAccountRepository extends CrudRepository<TimetrackAccount, Long> {
}

View File

@ -1,5 +1,7 @@
package de.hft.geotime.entities; package de.hft.geotime.user;
import de.hft.geotime.role.Role;
import de.hft.geotime.timetrackaccount.TimetrackAccount;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -0,0 +1,12 @@
package de.hft.geotime.user;
import org.springframework.data.repository.CrudRepository;
import javax.websocket.server.PathParam;
import java.util.List;
public interface UserRepository extends CrudRepository<User, Long> {
List<User> findByUsername(@PathParam("username") String username);
}

View File

@ -1,5 +1,4 @@
server.port=80 server.port=80
spring.data.rest.basePath=/api
spring.datasource.hikari.initialization-fail-timeout=0 spring.datasource.hikari.initialization-fail-timeout=0
spring.datasource.hikari.max-lifetime=300000 spring.datasource.hikari.max-lifetime=300000
spring.profiles.active=prod spring.profiles.active=prod