Skip to content

Commit

Permalink
add employee stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Zusel committed Jun 16, 2024
1 parent 65830a8 commit f52d1e0
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'
testImplementation 'org.springframework.security:spring-security-test'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
Expand All @@ -52,6 +55,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.thymeleaf:thymeleaf:3.1.2.RELEASE'
implementation 'org.xhtmlrenderer:flying-saucer-pdf:9.5.1'
implementation 'org.javers:javers-spring-boot-starter-sql:7.4.6'
}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package de.itstimetoforget.backend.rest.repository;

import de.itstimetoforget.backend.rest.entity.Customer;
import org.javers.spring.annotation.JaversSpringDataAuditable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
@JaversSpringDataAuditable
public interface CustomerRepository extends JpaRepository<Customer, Long> {

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package de.itstimetoforget.backend.rest.repository;

import de.itstimetoforget.backend.rest.entity.Employee;
import org.javers.spring.annotation.JaversSpringDataAuditable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
@JaversSpringDataAuditable
public interface EmployeeRepository extends JpaRepository<Employee, Long> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

import de.itstimetoforget.backend.rest.entity.Order;
import de.itstimetoforget.backend.rest.entity.OrderState;
import org.javers.spring.annotation.JaversSpringDataAuditable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@JaversSpringDataAuditable
public interface OrderRepository extends JpaRepository<Order, Long> {

@Query("SELECT co FROM Order co where co.state=:#{#state}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package de.itstimetoforget.backend.rest.repository;

import de.itstimetoforget.backend.rest.entity.Password;
import org.javers.spring.annotation.JaversSpringDataAuditable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
@JaversSpringDataAuditable
public interface PasswordRepository extends JpaRepository<Password, Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package de.itstimetoforget.backend.rest.security;

import org.javers.spring.auditable.AuthorProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

public class SpringSecurityAuthorProvider implements AuthorProvider {
@Override
public String provide() {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
return "";
}
}
1 change: 1 addition & 0 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ spring.datasource.username=${MARIADB_USERNAME}
spring.datasource.password=${MARIADB_PASSWORD}
server.port=${SERVER_PORT}
server.address=0.0.0.0

#logging.level.net.ttddyy.dsproxy.listener=debug

0 comments on commit f52d1e0

Please sign in to comment.