Skip to content

Commit

Permalink
Feature/update iteration 2 (#30)
Browse files Browse the repository at this point in the history
* feat: added liquibase session lock and new docker files

* feat: project restructure

* feat: moved controllers to new package
  • Loading branch information
JordenReuter authored Apr 25, 2024
1 parent f7f52fc commit 5b741f1
Show file tree
Hide file tree
Showing 48 changed files with 181 additions and 176 deletions.
21 changes: 12 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-liquibase</artifactId>
</dependency>

<dependency>
<groupId>com.github.blagerweij</groupId>
<artifactId>liquibase-sessionlock</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
Expand Down Expand Up @@ -156,8 +159,8 @@
</goals>
<configuration>
<inputSpec>src/main/openapi/di-v1.yaml</inputSpec>
<apiPackage>gen.io.github.onecx.parameters.di.v1</apiPackage>
<modelPackage>gen.io.github.onecx.parameters.di.v1.model</modelPackage>
<apiPackage>gen.org.tkit.onecx.parameters.di.v1</apiPackage>
<modelPackage>gen.org.tkit.onecx.parameters.di.v1.model</modelPackage>
<modelNameSuffix>DTOV1</modelNameSuffix>
<skipValidateSpec>true</skipValidateSpec>
</configuration>
Expand All @@ -169,8 +172,8 @@
</goals>
<configuration>
<inputSpec>src/main/openapi/openapi-internal.yaml</inputSpec>
<apiPackage>gen.io.github.onecx.parameters.rs.internal</apiPackage>
<modelPackage>gen.io.github.onecx.parameters.rs.internal.model</modelPackage>
<apiPackage>gen.org.tkit.onecx.parameters.rs.internal</apiPackage>
<modelPackage>gen.org.tki.onecx.parameters.rs.internal.model</modelPackage>
</configuration>
</execution>
<execution>
Expand All @@ -180,8 +183,8 @@
</goals>
<configuration>
<inputSpec>src/main/openapi/openapi-v2.yaml</inputSpec>
<apiPackage>gen.io.github.onecx.parameters.rs.v2</apiPackage>
<modelPackage>gen.io.github.onecx.parameters.rs.v2.model</modelPackage>
<apiPackage>gen.org.tkit.onecx.parameters.rs.v2</apiPackage>
<modelPackage>gen.org.tkit.onecx.parameters.rs.v2.model</modelPackage>
<modelNameSuffix>DTOV2</modelNameSuffix>
</configuration>
</execution>
Expand All @@ -192,8 +195,8 @@
</goals>
<configuration>
<inputSpec>src/main/openapi/openapi-v3.yaml</inputSpec>
<apiPackage>gen.io.github.onecx.parameters.rs.v3</apiPackage>
<modelPackage>gen.io.github.onecx.parameters.rs.v3.model</modelPackage>
<apiPackage>gen.org.tkit.onecx.parameters.rs.v3</apiPackage>
<modelPackage>gen.org.tkit.onecx.parameters.rs.v3.model</modelPackage>
<modelNameSuffix>DTOV3</modelNameSuffix>
</configuration>
</execution>
Expand Down
10 changes: 2 additions & 8 deletions src/main/docker/Dockerfile.jvm
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
FROM registry.access.redhat.com/ubi9/openjdk-17:1.15

ENV LANGUAGE='en_US:en'
FROM ghcr.io/onecx/docker-quarkus-jvm:0.5.0

COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
COPY --chown=185 target/quarkus-app/*.jar /deployments/
COPY --chown=185 target/quarkus-app/app/ /deployments/app/
COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/

EXPOSE 8080
USER 185
ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
USER 185
12 changes: 2 additions & 10 deletions src/main/docker/Dockerfile.native
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.2
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
&& chown 1001:root /work
COPY --chown=1001:root target/*-runner /work/application
FROM ghcr.io/onecx/docker-quarkus-native:0.3.0

EXPOSE 8080
USER 1001

CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
COPY --chown=1001:root target/*-runner /work/application
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.criteria;
package org.tkit.onecx.parameters.domain.criteria;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.criteria;
package org.tkit.onecx.parameters.domain.criteria;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.criteria;
package org.tkit.onecx.parameters.domain.criteria;

import lombok.Getter;
import lombok.Setter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.daos;
package org.tkit.onecx.parameters.domain.daos;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -10,16 +10,15 @@
import jakarta.persistence.criteria.*;
import jakarta.transaction.Transactional;

import org.tkit.onecx.parameters.domain.criteria.ApplicationParameterSearchCriteria;
import org.tkit.onecx.parameters.domain.criteria.KeysSearchCriteria;
import org.tkit.onecx.parameters.domain.models.ApplicationParameter;
import org.tkit.onecx.parameters.domain.models.ApplicationParameter_;
import org.tkit.quarkus.jpa.daos.AbstractDAO;
import org.tkit.quarkus.jpa.daos.Page;
import org.tkit.quarkus.jpa.daos.PageResult;
import org.tkit.quarkus.jpa.exceptions.DAOException;

import io.github.onecx.parameters.domain.criteria.ApplicationParameterSearchCriteria;
import io.github.onecx.parameters.domain.criteria.KeysSearchCriteria;
import io.github.onecx.parameters.domain.models.ApplicationParameter;
import io.github.onecx.parameters.domain.models.ApplicationParameter_;

@ApplicationScoped
@Transactional(value = Transactional.TxType.NOT_SUPPORTED, rollbackOn = DAOException.class)
public class ApplicationParameterDAO extends AbstractDAO<ApplicationParameter> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.daos;
package org.tkit.onecx.parameters.domain.daos;

import java.util.List;

Expand All @@ -10,12 +10,11 @@
import jakarta.persistence.criteria.Root;
import jakarta.transaction.Transactional;

import org.tkit.onecx.parameters.domain.models.ApplicationParameterData;
import org.tkit.onecx.parameters.domain.models.ApplicationParameterData_;
import org.tkit.quarkus.jpa.daos.AbstractDAO;
import org.tkit.quarkus.jpa.exceptions.DAOException;

import io.github.onecx.parameters.domain.models.ApplicationParameterData;
import io.github.onecx.parameters.domain.models.ApplicationParameterData_;

@ApplicationScoped
@Transactional(value = Transactional.TxType.NOT_SUPPORTED, rollbackOn = DAOException.class)
public class ApplicationParameterDataDAO extends AbstractDAO<ApplicationParameterData> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.daos;
package org.tkit.onecx.parameters.domain.daos;

import java.time.LocalDateTime;
import java.util.ArrayList;
Expand All @@ -8,19 +8,18 @@
import jakarta.persistence.criteria.*;
import jakarta.transaction.Transactional;

import org.tkit.onecx.parameters.domain.criteria.ApplicationParameterHistorySearchCriteria;
import org.tkit.onecx.parameters.domain.models.ApplicationParameterHistory;
import org.tkit.onecx.parameters.domain.models.ApplicationParameterHistory_;
import org.tkit.onecx.parameters.domain.models.ApplicationParameter_;
import org.tkit.onecx.parameters.domain.models.ParameterHistoryCountTuple;
import org.tkit.quarkus.jpa.daos.AbstractDAO;
import org.tkit.quarkus.jpa.daos.Page;
import org.tkit.quarkus.jpa.daos.PageResult;
import org.tkit.quarkus.jpa.exceptions.DAOException;
import org.tkit.quarkus.jpa.models.AbstractTraceableEntity_;
import org.tkit.quarkus.jpa.models.TraceableEntity_;

import io.github.onecx.parameters.domain.criteria.ApplicationParameterHistorySearchCriteria;
import io.github.onecx.parameters.domain.models.ApplicationParameterHistory;
import io.github.onecx.parameters.domain.models.ApplicationParameterHistory_;
import io.github.onecx.parameters.domain.models.ApplicationParameter_;
import io.github.onecx.parameters.domain.models.ParameterHistoryCountTuple;

@ApplicationScoped
@Transactional(value = Transactional.TxType.NOT_SUPPORTED, rollbackOn = DAOException.class)
public class ApplicationParameterHistoryDAO extends AbstractDAO<ApplicationParameterHistory> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.daos;
package org.tkit.onecx.parameters.domain.daos;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.persistence.LockModeType;
Expand All @@ -8,12 +8,11 @@
import jakarta.persistence.criteria.Root;
import jakarta.transaction.Transactional;

import org.tkit.onecx.parameters.domain.models.Job;
import org.tkit.quarkus.jpa.daos.AbstractDAO;
import org.tkit.quarkus.jpa.exceptions.DAOException;
import org.tkit.quarkus.jpa.models.TraceableEntity_;

import io.github.onecx.parameters.domain.models.Job;

@ApplicationScoped
public class JobDAO extends AbstractDAO<Job> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.di.v1;
package org.tkit.onecx.parameters.domain.di.v1;

import java.util.ArrayList;
import java.util.HashMap;
Expand All @@ -11,16 +11,16 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tkit.onecx.parameters.domain.daos.ApplicationParameterDAO;
import org.tkit.onecx.parameters.domain.models.ApplicationParameter;
import org.tkit.quarkus.dataimport.DataImport;
import org.tkit.quarkus.dataimport.DataImportConfig;
import org.tkit.quarkus.dataimport.DataImportService;

import com.fasterxml.jackson.databind.ObjectMapper;

import gen.io.github.onecx.parameters.di.v1.model.DataImportDTOV1;
import gen.io.github.onecx.parameters.di.v1.model.DataImportParamDTOV1;
import io.github.onecx.parameters.domain.daos.ApplicationParameterDAO;
import io.github.onecx.parameters.domain.models.ApplicationParameter;
import gen.org.tkit.onecx.parameters.di.v1.model.DataImportDTOV1;
import gen.org.tkit.onecx.parameters.di.v1.model.DataImportParamDTOV1;

/**
* Import JSON format. Openapi: ./src/main/openapi/di-v1.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.models;
package org.tkit.onecx.parameters.domain.models;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.models;
package org.tkit.onecx.parameters.domain.models;

import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.models;
package org.tkit.onecx.parameters.domain.models;

import java.time.LocalDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.models;
package org.tkit.onecx.parameters.domain.models;

import jakarta.persistence.Entity;
import jakarta.persistence.Table;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.models;
package org.tkit.onecx.parameters.domain.models;

import java.time.LocalDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.domain.timer;
package org.tkit.onecx.parameters.domain.timer;

import java.time.Duration;
import java.time.LocalDateTime;
Expand All @@ -8,11 +8,11 @@
import jakarta.transaction.Transactional;

import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.tkit.onecx.parameters.domain.daos.ApplicationParameterHistoryDAO;
import org.tkit.onecx.parameters.domain.daos.JobDAO;
import org.tkit.onecx.parameters.domain.models.Job;
import org.tkit.quarkus.jpa.exceptions.DAOException;

import io.github.onecx.parameters.domain.daos.ApplicationParameterHistoryDAO;
import io.github.onecx.parameters.domain.daos.JobDAO;
import io.github.onecx.parameters.domain.models.Job;
import io.quarkus.scheduler.Scheduled;
import lombok.extern.slf4j.Slf4j;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.rs.external.v2;
package org.tkit.onecx.parameters.rs.external.v2.controllers;

import java.util.List;
import java.util.function.Function;
Expand All @@ -9,15 +9,16 @@
import jakarta.transaction.Transactional;
import jakarta.ws.rs.core.Response;

import gen.io.github.onecx.parameters.rs.v2.ExternalApi;
import gen.io.github.onecx.parameters.rs.v2.model.ApplicationParameterDTOV2;
import gen.io.github.onecx.parameters.rs.v2.model.ApplicationParameterTypeDTOV2;
import io.github.onecx.parameters.domain.daos.ApplicationParameterDAO;
import io.github.onecx.parameters.domain.daos.ApplicationParameterDataDAO;
import io.github.onecx.parameters.domain.models.ApplicationParameter;
import io.github.onecx.parameters.domain.models.ApplicationParameterData;
import io.github.onecx.parameters.rs.external.v2.mappers.ApplicationParameterDataMapperV2;
import io.github.onecx.parameters.rs.external.v2.mappers.ApplicationParameterMapperV2;
import org.tkit.onecx.parameters.domain.daos.ApplicationParameterDAO;
import org.tkit.onecx.parameters.domain.daos.ApplicationParameterDataDAO;
import org.tkit.onecx.parameters.domain.models.ApplicationParameter;
import org.tkit.onecx.parameters.domain.models.ApplicationParameterData;
import org.tkit.onecx.parameters.rs.external.v2.mappers.ApplicationParameterDataMapperV2;
import org.tkit.onecx.parameters.rs.external.v2.mappers.ApplicationParameterMapperV2;

import gen.org.tkit.onecx.parameters.rs.v2.ExternalApi;
import gen.org.tkit.onecx.parameters.rs.v2.model.ApplicationParameterDTOV2;
import gen.org.tkit.onecx.parameters.rs.v2.model.ApplicationParameterTypeDTOV2;

@ApplicationScoped
@Transactional(value = Transactional.TxType.NOT_SUPPORTED)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.github.onecx.parameters.rs.external.v2.mappers;
package org.tkit.onecx.parameters.rs.external.v2.mappers;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.tkit.onecx.parameters.domain.models.ApplicationParameterData;

import gen.io.github.onecx.parameters.rs.v2.model.ApplicationParameterDTOV2;
import io.github.onecx.parameters.domain.models.ApplicationParameterData;
import gen.org.tkit.onecx.parameters.rs.v2.model.ApplicationParameterDTOV2;

@Mapper
public interface ApplicationParameterDataMapperV2 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.github.onecx.parameters.rs.external.v2.mappers;
package org.tkit.onecx.parameters.rs.external.v2.mappers;

import java.util.List;

import org.mapstruct.*;
import org.tkit.onecx.parameters.domain.models.ApplicationParameter;

import gen.io.github.onecx.parameters.rs.v2.model.ApplicationParameterDTOV2;
import io.github.onecx.parameters.domain.models.ApplicationParameter;
import gen.org.tkit.onecx.parameters.rs.v2.model.ApplicationParameterDTOV2;

@Mapper
@MapperConfig(unmappedTargetPolicy = ReportingPolicy.ERROR)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.onecx.parameters.rs.external.v3;
package org.tkit.onecx.parameters.rs.external.v3.controllers;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -9,15 +9,15 @@
import jakarta.transaction.Transactional;
import jakarta.ws.rs.core.Response;

import org.tkit.onecx.parameters.domain.daos.ApplicationParameterDAO;
import org.tkit.onecx.parameters.domain.daos.ApplicationParameterHistoryDAO;
import org.tkit.onecx.parameters.domain.models.ApplicationParameterHistory;
import org.tkit.onecx.parameters.rs.external.v3.mappers.ApplicationParameterHistoryMapper;
import org.tkit.onecx.parameters.rs.internal.mappers.ExceptionMapper;
import org.tkit.quarkus.log.cdi.LogService;

import gen.io.github.onecx.parameters.rs.v3.ExternalApi;
import gen.io.github.onecx.parameters.rs.v3.model.ParametersBucketDTOV3;
import io.github.onecx.parameters.domain.daos.ApplicationParameterDAO;
import io.github.onecx.parameters.domain.daos.ApplicationParameterHistoryDAO;
import io.github.onecx.parameters.domain.models.ApplicationParameterHistory;
import io.github.onecx.parameters.rs.external.v3.mappers.ApplicationParameterHistoryMapper;
import io.github.onecx.parameters.rs.internal.mappers.ExceptionMapper;
import gen.org.tkit.onecx.parameters.rs.v3.ExternalApi;
import gen.org.tkit.onecx.parameters.rs.v3.model.ParametersBucketDTOV3;

@LogService
@ApplicationScoped
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.github.onecx.parameters.rs.external.v3.log;
package org.tkit.onecx.parameters.rs.external.v3.log;

import java.util.List;

import jakarta.enterprise.context.ApplicationScoped;

import org.tkit.quarkus.log.cdi.LogParam;

import gen.io.github.onecx.parameters.rs.v3.model.ParametersBucketDTOV3;
import gen.org.tkit.onecx.parameters.rs.v3.model.ParametersBucketDTOV3;

@ApplicationScoped
public class ExternalV3LogParam implements LogParam {
Expand Down
Loading

0 comments on commit 5b741f1

Please sign in to comment.