This commit is contained in:
@ -6,8 +6,9 @@ import java.util.stream.Stream;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.jooq.Condition;
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.SelectWhereStep;
|
||||
import org.jooq.SelectConditionStep;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -27,8 +28,8 @@ public class IndexGateway {
|
||||
@Autowired
|
||||
private DSLContext jooq;
|
||||
|
||||
public Stream<VCampRecord> getAllCamps() {
|
||||
SelectWhereStep<VCampRecord> sql = jooq.selectFrom(V_CAMP);
|
||||
public Stream<VCampRecord> getAllCamps(Condition condition) {
|
||||
SelectConditionStep<VCampRecord> sql = jooq.selectFrom(V_CAMP).where(condition);
|
||||
LOGGER.debug(sql.toString());
|
||||
return sql.fetchStream();
|
||||
}
|
||||
|
@ -1,9 +1,15 @@
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.jooq.Condition;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -25,7 +31,8 @@ public class IndexService {
|
||||
* @return the list of found camps
|
||||
*/
|
||||
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<>();
|
||||
stream.forEach(o -> list.add(o));
|
||||
return list;
|
||||
|
@ -10,7 +10,7 @@ server.port = 8081
|
||||
server.servlet.context-path=/CampOrganizer2
|
||||
|
||||
# keycloak
|
||||
keycloak.auth-server-url = http://localhost:8080/
|
||||
keycloak.auth-server-url = https://www.onkelwernerfreizeiten.de:8443/
|
||||
keycloak.realm = ow
|
||||
keycloak.resource = biblecamp
|
||||
keycloak.public-client = true
|
||||
|
Reference in New Issue
Block a user