Skip to content

Commit

Permalink
Moves DTOs into their own module
Browse files Browse the repository at this point in the history
  • Loading branch information
vanny96 committed Feb 5, 2023
1 parent 5b097c3 commit da14fd1
Show file tree
Hide file tree
Showing 60 changed files with 585 additions and 450 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish dto package to GitHub Packages
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Publish package
run: mvn --batch-mode deploy -Drevision=${{ github.event.release.name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 12 additions & 12 deletions infra/docker/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ services:
# - POSTGRES_PASSWORD=postgres
# - KEYCLOAK_HOST=https://keycloak

# keycloak:
# image: jboss/keycloak:16.1.1
# container_name: keycloak
# environment:
# DB_VENDOR: H2
# KEYCLOAK_USER: admin
# KEYCLOAK_PASSWORD: admin
# KEYCLOAK_IMPORT: "/opt/jboss/keycloak/realm-config/quarkus-realm.json"
# volumes:
# - ./keycloak:/opt/jboss/keycloak/realm-config
# ports:
# - "8081:8080"
keycloak:
image: jboss/keycloak:16.1.1
container_name: keycloak
environment:
DB_VENDOR: H2
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KEYCLOAK_IMPORT: "/opt/jboss/keycloak/realm-config/quarkus-realm.json"
volumes:
- ../keycloak:/opt/jboss/keycloak/realm-config
ports:
- "8081:8080"

volumes:
dbdata:
Expand Down
156 changes: 156 additions & 0 deletions leaderboards-app/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.lunatech.leaderboards</groupId>
<artifactId>leaderboards</artifactId>
<version>${revision}</version>
</parent>

<artifactId>leaderboards-app</artifactId>

<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm-panache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-flyway</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-graphql-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-keycloak-authorization</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-config-yaml</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-cache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-container-image-jib</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.lunatech.leaderboards</groupId>
<artifactId>leaderboards-dto</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<properties>
<skipITs>false</skipITs>
<quarkus.native.container-build>true</quarkus.native.container-build>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lunatech.leaderboard.client.graphql.lunagraph;
package com.lunatech.leaderboards.client.graphql.lunagraph;

import com.lunatech.leaderboard.client.graphql.lunagraph.model.LunagraphPersonModel;
import com.lunatech.leaderboards.client.graphql.lunagraph.model.LunagraphPersonModel;
import io.quarkus.arc.DefaultBean;
import io.quarkus.arc.profile.IfBuildProfile;
import io.smallrye.graphql.client.typesafe.api.TypesafeGraphQLClientBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lunatech.leaderboard.client.graphql.lunagraph;
package com.lunatech.leaderboards.client.graphql.lunagraph;

import com.lunatech.leaderboard.client.graphql.lunagraph.model.LunagraphPersonModel;
import com.lunatech.leaderboards.client.graphql.lunagraph.model.LunagraphPersonModel;
import org.eclipse.microprofile.graphql.Name;
import org.eclipse.microprofile.graphql.Query;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.client.graphql.lunagraph.model;
package com.lunatech.leaderboards.client.graphql.lunagraph.model;

import org.eclipse.microprofile.graphql.Enum;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.client.graphql.lunagraph.model;
package com.lunatech.leaderboards.client.graphql.lunagraph.model;


public record LunagraphPersonModel(String fullName, String emailAddress) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.lunatech.leaderboard.controller;
package com.lunatech.leaderboards.controller;

import com.lunatech.leaderboard.dto.game.GameDto;
import com.lunatech.leaderboard.entity.Game;
import com.lunatech.leaderboard.mapper.game.GameDtoMapper;
import com.lunatech.leaderboard.service.GameService;
import com.lunatech.leaderboards.dto.game.GameDto;
import com.lunatech.leaderboards.entity.Game;
import com.lunatech.leaderboards.mapper.game.GameDtoMapper;
import com.lunatech.leaderboards.service.GameService;
import io.quarkus.security.Authenticated;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.Content;
Expand All @@ -20,7 +20,6 @@
import javax.ws.rs.core.Response;
import java.net.URI;
import java.util.Collection;
import java.util.List;

@Path("/games")
@Produces(MediaType.APPLICATION_JSON)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.lunatech.leaderboard.controller;
package com.lunatech.leaderboards.controller;

import com.lunatech.leaderboard.dto.gamemode.GameModeDto;
import com.lunatech.leaderboard.dto.gamemode.GameModePostDto;
import com.lunatech.leaderboard.entity.GameMode;
import com.lunatech.leaderboard.mapper.gamemode.GameModeDtoMapper;
import com.lunatech.leaderboard.service.GameModeService;
import com.lunatech.leaderboards.dto.gamemode.GameModeDto;
import com.lunatech.leaderboards.dto.gamemode.GameModePostDto;
import com.lunatech.leaderboards.entity.GameMode;
import com.lunatech.leaderboards.mapper.gamemode.GameModeDtoMapper;
import com.lunatech.leaderboards.service.GameModeService;
import io.quarkus.security.Authenticated;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.Content;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.lunatech.leaderboard.controller;
package com.lunatech.leaderboards.controller;

import com.lunatech.leaderboard.dto.match.MatchDto;
import com.lunatech.leaderboard.dto.match.MatchPostDto;
import com.lunatech.leaderboard.entity.Match;
import com.lunatech.leaderboard.entity.User;
import com.lunatech.leaderboard.mapper.match.MatchDtoMapper;
import com.lunatech.leaderboard.service.MatchService;
import com.lunatech.leaderboards.dto.match.MatchDto;
import com.lunatech.leaderboards.dto.match.MatchPostDto;
import com.lunatech.leaderboards.entity.Match;
import com.lunatech.leaderboards.entity.User;
import com.lunatech.leaderboards.mapper.match.MatchDtoMapper;
import com.lunatech.leaderboards.service.MatchService;
import io.quarkus.security.Authenticated;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.Content;
Expand All @@ -14,15 +14,13 @@
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
import org.eclipse.microprofile.openapi.annotations.responses.APIResponseSchema;

import javax.annotation.security.RolesAllowed;
import javax.inject.Inject;
import javax.transaction.Transactional;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.net.URI;
import java.util.Collection;
import java.util.List;

@Path("/games/{gameId}/gamemodes/{gameModeId}/matches")
@Produces(MediaType.APPLICATION_JSON)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.lunatech.leaderboard.controller;
package com.lunatech.leaderboards.controller;

import com.lunatech.leaderboard.dto.user.UserDto;
import com.lunatech.leaderboard.dto.user.UserPostDto;
import com.lunatech.leaderboard.entity.User;
import com.lunatech.leaderboard.mapper.user.UserDtoMapper;
import com.lunatech.leaderboards.dto.user.UserDto;
import com.lunatech.leaderboards.dto.user.UserPostDto;
import com.lunatech.leaderboards.entity.User;
import com.lunatech.leaderboards.mapper.user.UserDtoMapper;
import io.quarkus.security.Authenticated;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.Content;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.controller.provider.exceptionmapper;
package com.lunatech.leaderboards.controller.provider.exceptionmapper;

import javax.inject.Inject;
import javax.ws.rs.NotFoundException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.controller.provider.exceptionmapper;
package com.lunatech.leaderboards.controller.provider.exceptionmapper;

import org.yaml.snakeyaml.reader.ReaderException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.controller.provider.exceptionmapper;
package com.lunatech.leaderboards.controller.provider.exceptionmapper;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.controller.provider.filter;
package com.lunatech.leaderboards.controller.provider.filter;

import io.quarkus.oidc.runtime.OidcJwtCallerPrincipal;
import io.quarkus.security.identity.SecurityIdentity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.entity;
package com.lunatech.leaderboards.entity;

import io.quarkus.hibernate.orm.panache.PanacheEntityBase;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.entity;
package com.lunatech.leaderboards.entity;

import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import io.quarkus.panache.common.Parameters;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.entity;
package com.lunatech.leaderboards.entity;

import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.entity;
package com.lunatech.leaderboards.entity;

import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import org.hibernate.annotations.Where;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.entity;
package com.lunatech.leaderboards.entity;

import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lunatech.leaderboard.entity;
package com.lunatech.leaderboards.entity;

import io.quarkus.hibernate.orm.panache.PanacheEntityBase;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.lunatech.leaderboard.mapper;
package com.lunatech.leaderboards.mapper;

import java.util.Collection;
import java.util.stream.Collectors;

public interface DtoMapper<ENTITY, REQUEST_DTO, RESPONSE_DTO> {
ENTITY toEntity(REQUEST_DTO dto);
Expand Down
Loading

0 comments on commit da14fd1

Please sign in to comment.