Jörg Henke 2022-10-02 17:37:43 +02:00
parent cfe4edcf15
commit d003e8bccb
8 changed files with 37 additions and 33 deletions

View File

@ -12,18 +12,7 @@
<attribute name="gradle_used_by_scope" value="main,test"/> <attribute name="gradle_used_by_scope" value="main,test"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/java"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
<attributes>
<attribute name="test" value="true"/>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"> <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer">
<attributes> <attributes>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>CampOrganizer2</name> <name>camporganizer2</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>

View File

@ -1,2 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir= connection.project.dir=
eclipse.preferences.version=1 eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=false
show.console.view=false
show.executions.view=false

View File

@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.source=17

View File

@ -1,16 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="CampOrganizer2"> <wb-module deploy-name="camporganizer2">
<property name="context-root" value="camporganizer2"/>
<property name="context-root" value="CampOrganizer2"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/> </wb-module>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
</wb-module>
</project-modules> </project-modules>

View File

@ -6,8 +6,9 @@ import java.util.stream.Stream;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.jooq.Condition;
import org.jooq.DSLContext; import org.jooq.DSLContext;
import org.jooq.SelectWhereStep; import org.jooq.SelectConditionStep;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -27,8 +28,8 @@ public class IndexGateway {
@Autowired @Autowired
private DSLContext jooq; private DSLContext jooq;
public Stream<VCampRecord> getAllCamps() { public Stream<VCampRecord> getAllCamps(Condition condition) {
SelectWhereStep<VCampRecord> sql = jooq.selectFrom(V_CAMP); SelectConditionStep<VCampRecord> sql = jooq.selectFrom(V_CAMP).where(condition);
LOGGER.debug(sql.toString()); LOGGER.debug(sql.toString());
return sql.fetchStream(); return sql.fetchStream();
} }

View File

@ -1,9 +1,15 @@
package de.jottyfan.camporganizer.module.common; package de.jottyfan.camporganizer.module.common;
import static de.jottyfan.camporganizer.db.jooq.Tables.V_CAMP;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
import org.jooq.Condition;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -25,7 +31,8 @@ public class IndexService {
* @return the list of found camps * @return the list of found camps
*/ */
public List<VCampRecord> getAllCamps() { public List<VCampRecord> getAllCamps() {
Stream<VCampRecord> stream = gateway.getAllCamps(); Condition condition = V_CAMP.DEPART.greaterOrEqual(LocalDateTime.now());
Stream<VCampRecord> stream = gateway.getAllCamps(condition);
List<VCampRecord> list = new ArrayList<>(); List<VCampRecord> list = new ArrayList<>();
stream.forEach(o -> list.add(o)); stream.forEach(o -> list.add(o));
return list; return list;

View File

@ -10,7 +10,7 @@ server.port = 8081
server.servlet.context-path=/CampOrganizer2 server.servlet.context-path=/CampOrganizer2
# keycloak # keycloak
keycloak.auth-server-url = http://localhost:8080/ keycloak.auth-server-url = https://www.onkelwernerfreizeiten.de:8443/
keycloak.realm = ow keycloak.realm = ow
keycloak.resource = biblecamp keycloak.resource = biblecamp
keycloak.public-client = true keycloak.public-client = true