Refactor RolePlay application structure and enhance configuration
- Remove the RolePlayApplication class as part of the restructuring. - Update pom.xml to include new dependencies for YAML configuration and H2 database support. - Modify API package imports in ModelResource, SessionResource, and TurnResource to use the generated API package. - Update application.yml to configure H2 datasource and enable Liquibase migrations at startup.
This commit is contained in:
parent
f91604aea6
commit
ffb97f6b8e
21
pom.xml
21
pom.xml
@ -56,6 +56,14 @@
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-hibernate-validator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-config-yaml</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-jdbc-h2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-liquibase</artifactId>
|
||||
@ -92,6 +100,17 @@
|
||||
<artifactId>quarkus-maven-plugin</artifactId>
|
||||
<version>${quarkus.plugin.version}</version>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<skip>${quarkus.package.skip}</skip>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
@ -126,7 +145,7 @@
|
||||
<inputSpec>${project.basedir}/src/main/resources/openapi-roleplay-public-v1.yml</inputSpec>
|
||||
<generatorName>jaxrs-spec</generatorName>
|
||||
<output>${project.build.directory}/generated-sources/openapi</output>
|
||||
<apiPackage>de.neitzel.roleplay.fascade.api</apiPackage>
|
||||
<apiPackage>de.neitzel.roleplay.generated.api</apiPackage>
|
||||
<modelPackage>de.neitzel.roleplay.fascade.model</modelPackage>
|
||||
<configOptions>
|
||||
<interfaceOnly>true</interfaceOnly>
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
package de.neitzel.roleplay;
|
||||
|
||||
import io.quarkus.runtime.Quarkus;
|
||||
import io.quarkus.runtime.QuarkusApplication;
|
||||
import io.quarkus.runtime.annotations.QuarkusMain;
|
||||
|
||||
/**
|
||||
* Application entry point for the RolePlay service.
|
||||
*/
|
||||
@QuarkusMain
|
||||
public final class RolePlayApplication implements QuarkusApplication {
|
||||
|
||||
/**
|
||||
* Starts the Quarkus application.
|
||||
*
|
||||
* @param args command-line arguments
|
||||
*/
|
||||
public static void main(final String[] args) {
|
||||
Quarkus.run(RolePlayApplication.class, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs after the Quarkus runtime starts.
|
||||
*
|
||||
* @param args command-line arguments
|
||||
* @return the process exit code
|
||||
*/
|
||||
@Override
|
||||
public int run(final String... args) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package de.neitzel.roleplay.fascade;
|
||||
|
||||
import de.neitzel.roleplay.business.ModelService;
|
||||
import de.neitzel.roleplay.fascade.api.ModelsApi;
|
||||
import de.neitzel.roleplay.fascade.model.ModelListResponse;
|
||||
import de.neitzel.roleplay.generated.api.ModelsApi;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package de.neitzel.roleplay.fascade;
|
||||
|
||||
import de.neitzel.roleplay.business.SessionService;
|
||||
import de.neitzel.roleplay.fascade.api.SessionsApi;
|
||||
import de.neitzel.roleplay.fascade.model.CreateSessionRequest;
|
||||
import de.neitzel.roleplay.fascade.model.SessionResponse;
|
||||
import de.neitzel.roleplay.generated.api.SessionsApi;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.NotFoundException;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package de.neitzel.roleplay.fascade;
|
||||
|
||||
import de.neitzel.roleplay.business.SessionService;
|
||||
import de.neitzel.roleplay.fascade.api.TurnsApi;
|
||||
import de.neitzel.roleplay.fascade.model.TurnRequest;
|
||||
import de.neitzel.roleplay.fascade.model.TurnResponse;
|
||||
import de.neitzel.roleplay.generated.api.TurnsApi;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.NotFoundException;
|
||||
|
||||
@ -1,9 +1,20 @@
|
||||
quarkus:
|
||||
application:
|
||||
name: roleplay
|
||||
resteasy-reactive:
|
||||
scan:
|
||||
paths: de.neitzel.roleplay.fascade,de.neitzel.roleplay.business,de.neitzel.roleplay.common,de.neitzel.roleplay.data
|
||||
http:
|
||||
root-path: /
|
||||
datasource:
|
||||
db-kind: h2
|
||||
jdbc:
|
||||
url: jdbc:h2:mem:roleplay;DB_CLOSE_DELAY=-1
|
||||
username: sa
|
||||
password: ""
|
||||
liquibase:
|
||||
change-log: db/migration/changelog.xml
|
||||
migrate-at-start: false
|
||||
migrate-at-start: true
|
||||
rest-client:
|
||||
ollama-api:
|
||||
url: http://debian:11434
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user