given files
This commit is contained in:
commit
f919d1db7c
32 changed files with 1947 additions and 0 deletions
235
database/pom.xml
Normal file
235
database/pom.xml
Normal file
|
|
@ -0,0 +1,235 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>fr.epita.assistants</groupId>
|
||||
<artifactId>database</artifactId>
|
||||
<version>1.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
|
||||
<compiler-plugin.version>3.13.0</compiler-plugin.version>
|
||||
<maven.compiler.parameters>true</maven.compiler.parameters>
|
||||
|
||||
<versions.maven-surefire-plugin>2.22.2</versions.maven-surefire-plugin>
|
||||
<versions.maven-jar-plugin>3.4.1</versions.maven-jar-plugin>
|
||||
<versions.maven-install-plugin>3.1.2</versions.maven-install-plugin>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
|
||||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
|
||||
<quarkus.platform.version>3.16.1</quarkus.platform.version>
|
||||
|
||||
|
||||
<skipITs>true</skipITs>
|
||||
|
||||
<surefire.reportsDirectory>${project.build.directory}/surefire-reports</surefire.reportsDirectory>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${quarkus.platform.group-id}</groupId>
|
||||
<artifactId>${quarkus.platform.artifact-id}</artifactId>
|
||||
<version>${quarkus.platform.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-resteasy</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-resteasy-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-arc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-quartz</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-smallrye-openapi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.30</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${versions.maven-surefire-plugin}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tngtech.archunit</groupId>
|
||||
<artifactId>archunit-junit5</artifactId>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.classgraph</groupId>
|
||||
<artifactId>classgraph</artifactId>
|
||||
<version>4.8.179</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-junit5</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.smallrye.reactive</groupId>
|
||||
<artifactId>smallrye-reactive-messaging-in-memory</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.awaitility</groupId>
|
||||
<artifactId>awaitility</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>3.26.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-jdbc-postgresql</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-hibernate-orm-panache</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>${versions.maven-jar-plugin}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-flyway</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>fully.qualified.MainClass</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>io.quarkus</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>
|
||||
<parameters>${maven.compiler.parameters}</parameters>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${versions.maven-surefire-plugin}</version>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||
<maven.home>${maven.home}</maven.home>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>fetch-bom</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.quarkus.platform</groupId>
|
||||
<artifactId>quarkus-bom-quarkus-platform-properties</artifactId>
|
||||
<version>3.17.5</version>
|
||||
<type>properties</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>native</id>
|
||||
|
||||
<activation>
|
||||
<property>
|
||||
<name>native</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>${versions.maven-surefire-plugin}</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>
|
||||
<properties>
|
||||
<quarkus.package.type>native</quarkus.package.type>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
24
database/src/main/resources/application.properties
Normal file
24
database/src/main/resources/application.properties
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# DEV
|
||||
%dev.quarkus.http.port=8082
|
||||
%dev.quarkus.hibernate-orm.database.default-schema=${epita.group.id}
|
||||
%dev.quarkus.datasource.jdbc.url=jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:courses}
|
||||
%dev.quarkus.flyway.create-schemas=true
|
||||
%dev.quarkus.flyway.schemas=${epita.group.id}
|
||||
|
||||
%dev.quarkus.swagger-ui.enable=true
|
||||
quarkus.swagger-ui.always-include=true
|
||||
quarkus.swagger-ui.theme=material
|
||||
|
||||
# DB
|
||||
quarkus.datasource.username=${DB_USERNAME:postgres}
|
||||
quarkus.datasource.password=${DB_PASSWORD:postgres}
|
||||
quarkus.datasource.jdbc.url=jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:courses}
|
||||
quarkus.datasource.jdbc.transaction-isolation-level=read-uncommitted
|
||||
|
||||
epita.group.id=courses
|
||||
epita.random=0
|
||||
|
||||
quarkus.hibernate-orm.database.generation=${DATABASE_DB_GENERATION:update}
|
||||
|
||||
quarkus.devservices.enabled=false
|
||||
quarkus.http.cors=true
|
||||
186
endpoints/pom.xml
Normal file
186
endpoints/pom.xml
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
<?xml version="1.0"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>fr.epita.assistants</groupId>
|
||||
<artifactId>endpoints</artifactId>
|
||||
<version>1.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
|
||||
<compiler-plugin.version>3.13.0</compiler-plugin.version>
|
||||
<maven.compiler.parameters>true</maven.compiler.parameters>
|
||||
|
||||
<versions.maven-surefire-plugin>3.0.0-M5</versions.maven-surefire-plugin>
|
||||
<versions.maven-jar-plugin>3.4.1</versions.maven-jar-plugin>
|
||||
<versions.maven-install-plugin>3.1.2</versions.maven-install-plugin>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
|
||||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
|
||||
<quarkus.platform.version>3.17.5</quarkus.platform.version>
|
||||
|
||||
<skipITs>true</skipITs>
|
||||
|
||||
<surefire.reportsDirectory>${project.build.directory}/surefire-reports</surefire.reportsDirectory>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${quarkus.platform.group-id}</groupId>
|
||||
<artifactId>${quarkus.platform.artifact-id}</artifactId>
|
||||
<version>${quarkus.platform.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.30</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.microprofile.openapi</groupId>
|
||||
<artifactId>microprofile-openapi-api</artifactId>
|
||||
<version>4.0.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-smallrye-openapi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-junit5</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>3.26.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit-platform</artifactId>
|
||||
<version>${versions.maven-surefire-plugin}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-api</artifactId>
|
||||
<version>3.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>${versions.maven-jar-plugin}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>${versions.maven-install-plugin}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.7.0</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>
|
||||
<goal>native-image-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<parameters>true</parameters>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${versions.maven-surefire-plugin}</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>${versions.maven-surefire-plugin}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<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>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>native</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>native</name>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<skipITs>false</skipITs>
|
||||
<quarkus.native.enabled>true</quarkus.native.enabled>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package fr.epita.assistants.presentation.rest;
|
||||
|
||||
import jakarta.ws.rs.*;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
@Path("/")
|
||||
@Consumes(MediaType.TEXT_PLAIN)
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public class HelloWorldEndpoint {
|
||||
@Path("/")
|
||||
@GET
|
||||
public String helloWorld() {
|
||||
return "Hello World!";
|
||||
}
|
||||
}
|
||||
7
endpoints/src/main/resources/application.properties
Normal file
7
endpoints/src/main/resources/application.properties
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
%dev.quarkus.http.port=8082
|
||||
%dev.quarkus.swagger-ui.enable=true
|
||||
|
||||
quarkus.log.category."org.apache.kafka".level=WARN
|
||||
quarkus.devservices.enabled=false
|
||||
|
||||
quarkus.http.cors=true
|
||||
80
endpoints/src/main/resources/openapi.yaml
Normal file
80
endpoints/src/main/resources/openapi.yaml
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
---
|
||||
openapi: 3.1.0
|
||||
tags:
|
||||
- name: Greeting
|
||||
- name: String Operations
|
||||
servers:
|
||||
- url: http://localhost:8082/
|
||||
components:
|
||||
schemas:
|
||||
HelloResponse:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: string
|
||||
example: "hello test"
|
||||
ReverseRequest:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: string
|
||||
example: "hello\ntest"
|
||||
ReverseResponse:
|
||||
type: object
|
||||
properties:
|
||||
original:
|
||||
type: string
|
||||
example: "hello\ntest"
|
||||
reversed:
|
||||
type: string
|
||||
example: "tset\nolleh"
|
||||
paths:
|
||||
/hello/{name}:
|
||||
get:
|
||||
summary: Greet by name
|
||||
description: "Returns a greeting message in the format `hello {name}` using\
|
||||
\ the provided name."
|
||||
tags:
|
||||
- Greeting
|
||||
parameters:
|
||||
- name: name
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: Greeting message returned successfully.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/HelloResponse"
|
||||
"400":
|
||||
description: "Bad request: The name parameter is null or empty."
|
||||
/reverse:
|
||||
post:
|
||||
summary: Reverse a string
|
||||
description: "Accepts a JSON request containing a string, reverses the string,\
|
||||
\ and returns both the original and reversed versions."
|
||||
tags:
|
||||
- String Operations
|
||||
requestBody:
|
||||
description: JSON object containing the string to be reversed.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ReverseRequest"
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: Reversed string returned successfully.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ReverseResponse"
|
||||
"400":
|
||||
description: "Bad request: Request body is null or the string content is\
|
||||
\ null or empty."
|
||||
info:
|
||||
title: endpoints API
|
||||
version: "1.0"
|
||||
0
yakamon/.env
Normal file
0
yakamon/.env
Normal file
21
yakamon/.gitignore
vendored
Normal file
21
yakamon/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
*.class
|
||||
|
||||
.idea/
|
||||
target/
|
||||
|
||||
*.log
|
||||
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
hs_err_pid*
|
||||
replay_pid*
|
||||
|
||||
viewer/
|
||||
|
||||
# Put here other files you want to ignore
|
||||
374
yakamon/pom.xml
Normal file
374
yakamon/pom.xml
Normal file
|
|
@ -0,0 +1,374 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>fr.epita.assistants</groupId>
|
||||
<artifactId>yakamon</artifactId>
|
||||
<version>1.0.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
|
||||
<compiler-plugin.version>3.13.0</compiler-plugin.version>
|
||||
<maven.compiler.parameters>true</maven.compiler.parameters>
|
||||
|
||||
<versions.maven-surefire-plugin>3.0.0-M5
|
||||
</versions.maven-surefire-plugin>
|
||||
<versions.maven-jar-plugin>3.4.1</versions.maven-jar-plugin>
|
||||
<versions.maven-install-plugin>3.1.2</versions.maven-install-plugin>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8
|
||||
</project.reporting.outputEncoding>
|
||||
|
||||
<quarkus.platform.group-id>io.quarkus.platform
|
||||
</quarkus.platform.group-id>
|
||||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
|
||||
<quarkus.platform.version>3.17.5</quarkus.platform.version>
|
||||
|
||||
<skipITs>true</skipITs>
|
||||
<surefire.reportsDirectory>
|
||||
${project.build.directory}../../target/surefire-reports
|
||||
</surefire.reportsDirectory>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${quarkus.platform.group-id}</groupId>
|
||||
<artifactId>${quarkus.platform.artifact-id}</artifactId>
|
||||
<version>${quarkus.platform.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-junit5</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest-jackson-deployment</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-arc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.36</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.smallrye.reactive</groupId>
|
||||
<artifactId>smallrye-reactive-messaging-in-memory</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.awaitility</groupId>
|
||||
<artifactId>awaitility</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>3.26.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpmime</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest-kotlin</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus.platform</groupId>
|
||||
<artifactId>quarkus-bom</artifactId>
|
||||
<version>${quarkus.platform.version}</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-junit5-properties</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.opentest4j</groupId>
|
||||
<artifactId>opentest4j</artifactId>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apiguardian</groupId>
|
||||
<artifactId>apiguardian-api</artifactId>
|
||||
<version>1.1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-params</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit-platform</artifactId>
|
||||
<version>${versions.maven-surefire-plugin}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>common-java5</artifactId>
|
||||
<version>3.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-shared-utils</artifactId>
|
||||
<version>3.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
<artifactId>junit-platform-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
<artifactId>junit-platform-launcher</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-api</artifactId>
|
||||
<version>3.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus.platform</groupId>
|
||||
<artifactId>quarkus-maven-plugin</artifactId>
|
||||
<version>3.17.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>${versions.maven-jar-plugin}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>${versions.maven-install-plugin}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest-kotlin-deployment</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
<artifactId>junit-platform-commons</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-repository-metadata</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-registry</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>classworlds</groupId>
|
||||
<artifactId>classworlds</artifactId>
|
||||
<version>1.1-alpha-2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-maven-plugin</artifactId>
|
||||
<version>3.17.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-smallrye-openapi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tngtech.archunit</groupId>
|
||||
<artifactId>archunit-junit5</artifactId>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.classgraph</groupId>
|
||||
<artifactId>classgraph</artifactId>
|
||||
<version>4.8.179</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.7.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
</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-smallrye-metrics</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>fully.qualified.MainClass</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>io.quarkus</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>
|
||||
<parameters>${maven.compiler.parameters}</parameters>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.36</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${versions.maven-surefire-plugin}</version>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<java.util.logging.manager>
|
||||
org.jboss.logmanager.LogManager
|
||||
</java.util.logging.manager>
|
||||
<maven.home>${maven.home}</maven.home>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>fetch-bom</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.quarkus.platform</groupId>
|
||||
<artifactId>quarkus-bom-quarkus-platform-properties
|
||||
</artifactId>
|
||||
<version>3.17.5</version>
|
||||
<type>properties</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>native</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>native</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>${versions.maven-surefire-plugin}</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>
|
||||
<properties>
|
||||
<quarkus.package.type>native</quarkus.package.type>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package fr.epita.assistants.yakamon.presentation.rest;
|
||||
|
||||
import jakarta.ws.rs.*;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
@Path("/hello")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
@Consumes(MediaType.TEXT_PLAIN)
|
||||
public class HelloWorldResource {
|
||||
|
||||
@GET
|
||||
@Path("/")
|
||||
public String helloWorld() {
|
||||
return "Hello, world!";
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/{name}")
|
||||
public String helloWorld(@PathParam("name") String name) {
|
||||
return "Hello " + name + "!";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package fr.epita.assistants.yakamon.utils;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum Direction {
|
||||
UP(new Point(0, -1)),
|
||||
RIGHT(new Point(1, 0)),
|
||||
DOWN(new Point(0, 1)),
|
||||
LEFT(new Point(-1, 0));
|
||||
|
||||
private final Point point;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package fr.epita.assistants.yakamon.utils;
|
||||
|
||||
public enum ElementType {
|
||||
BUG,
|
||||
DARK,
|
||||
ELECTRIC,
|
||||
FAIRY,
|
||||
FIGHTING,
|
||||
FIRE,
|
||||
FLYING,
|
||||
GHOST,
|
||||
GRASS,
|
||||
GROUND,
|
||||
ICE,
|
||||
NORMAL,
|
||||
POISON,
|
||||
PSYCHIC,
|
||||
ROCK,
|
||||
STEEL,
|
||||
WATER,
|
||||
DRAGON,
|
||||
STELLAR
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package fr.epita.assistants.yakamon.utils;
|
||||
|
||||
import jakarta.ws.rs.WebApplicationException;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import static jakarta.ws.rs.core.Response.Status;
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ErrorCode {
|
||||
EXAMPLE_ERROR(Status.INTERNAL_SERVER_ERROR, "This is an error example");
|
||||
|
||||
private final Response.Status errorCode;
|
||||
|
||||
private final String errorMessage;
|
||||
|
||||
public WebApplicationException getException() {
|
||||
return new WebApplicationException(Response.status(errorCode).entity(new ErrorInfo(errorMessage)).build());
|
||||
}
|
||||
|
||||
public void throwException() {
|
||||
throw getException();
|
||||
}
|
||||
|
||||
public void throwException(String prefix) {
|
||||
throw new WebApplicationException(Response.status(errorCode).entity(new ErrorInfo(prefix + ": " + errorMessage)).build());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package fr.epita.assistants.yakamon.utils;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class ErrorInfo {
|
||||
private String message;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package fr.epita.assistants.yakamon.utils;
|
||||
|
||||
import fr.epita.assistants.yakamon.utils.tile.ItemType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class Item {
|
||||
ItemType itemType;
|
||||
Integer quantity;
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package fr.epita.assistants.yakamon.utils;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
public class Point {
|
||||
private int posX;
|
||||
private int posY;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package fr.epita.assistants.yakamon.utils.tile;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
include = JsonTypeInfo.As.PROPERTY,
|
||||
property = "type",
|
||||
visible = true
|
||||
)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = ItemType.class, name = "ITEM"),
|
||||
@JsonSubTypes.Type(value = YakamonType.class, name = "YAKAMON")
|
||||
})
|
||||
public interface Collectible {
|
||||
|
||||
@JsonProperty("type")
|
||||
CollectibleType getCollectibleType();
|
||||
|
||||
@JsonProperty("value")
|
||||
String getValue();
|
||||
|
||||
@JsonIgnore
|
||||
CollectibleInfo getCollectibleInfo();
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package fr.epita.assistants.yakamon.utils.tile;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public abstract class CollectibleInfo {
|
||||
|
||||
private Character value;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package fr.epita.assistants.yakamon.utils.tile;
|
||||
|
||||
public enum CollectibleType {
|
||||
ITEM,
|
||||
YAKAMON;
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package fr.epita.assistants.yakamon.utils.tile;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public final class CollectibleUtils {
|
||||
private CollectibleUtils() {
|
||||
|
||||
}
|
||||
|
||||
private static final Map<Character, Collectible> lookup = new HashMap<>();
|
||||
|
||||
static {
|
||||
for (ItemType r : ItemType.values()) {
|
||||
lookup.put(r.getCollectibleInfo().getValue(), r);
|
||||
}
|
||||
for (YakamonType y : YakamonType.values()) {
|
||||
lookup.put(y.getCollectibleInfo().getValue(), y);
|
||||
}
|
||||
}
|
||||
|
||||
public static Collectible getCollectible(Character c) {
|
||||
return lookup.get(c);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package fr.epita.assistants.yakamon.utils.tile;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class ItemInfo extends CollectibleInfo {
|
||||
public ItemInfo(Character value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package fr.epita.assistants.yakamon.utils.tile;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
@AllArgsConstructor
|
||||
public enum ItemType implements Collectible {
|
||||
YAKABALL(new ItemInfo('Y')),
|
||||
SCROOGE(new ItemInfo('S')),
|
||||
NONE(new ItemInfo('N'));
|
||||
|
||||
private final CollectibleInfo collectibleInfo;
|
||||
|
||||
@Override
|
||||
public CollectibleInfo getCollectibleInfo() {
|
||||
return collectibleInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CollectibleType getCollectibleType() {
|
||||
return CollectibleType.ITEM;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static ItemType jsonCreator(JsonNode node) {
|
||||
String value = node.get("value").asText();
|
||||
return ItemType.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package fr.epita.assistants.yakamon.utils.tile;
|
||||
|
||||
import fr.epita.assistants.yakamon.utils.ElementType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum TerrainType {
|
||||
GRASS('G', true, Collections.EMPTY_SET),
|
||||
MOUNTAIN('M', false, Set.of(ElementType.ROCK, ElementType.FLYING)),
|
||||
ROCK('R', true, Collections.EMPTY_SET),
|
||||
SAND('S', true, Collections.EMPTY_SET),
|
||||
WATER('W', false, Set.of(ElementType.WATER, ElementType.FLYING)),
|
||||
LAVA('L', false, Set.of(ElementType.FIRE, ElementType.FLYING));
|
||||
|
||||
private final Character value;
|
||||
private final Boolean walkable;
|
||||
private final Set<ElementType> compatibleType;
|
||||
|
||||
private static final Map<Character, TerrainType> lookup;
|
||||
|
||||
static {
|
||||
lookup = new HashMap<>();
|
||||
for (TerrainType terrainType : TerrainType.values()) {
|
||||
lookup.put(terrainType.value, terrainType);
|
||||
}
|
||||
}
|
||||
|
||||
public static TerrainType getTerrain(Character c) {
|
||||
return lookup.get(c);
|
||||
}
|
||||
|
||||
public boolean isWalkable() {
|
||||
return walkable;
|
||||
}
|
||||
|
||||
public boolean isWalkable(ElementType element) {
|
||||
return walkable || compatibleType.contains(element);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package fr.epita.assistants.yakamon.utils.tile;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class TileType {
|
||||
|
||||
private TerrainType terrainType;
|
||||
|
||||
private Collectible collectible;
|
||||
|
||||
@JsonCreator
|
||||
public TileType(
|
||||
@JsonProperty("collectible") Collectible type
|
||||
) {
|
||||
this.collectible = type;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package fr.epita.assistants.yakamon.utils.tile;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class YakamonInfo extends CollectibleInfo {
|
||||
|
||||
public YakamonInfo(Character value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
private Integer yakadexId;
|
||||
|
||||
public YakamonInfo withYakadexId(Integer id) {
|
||||
this.yakadexId = id;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package fr.epita.assistants.yakamon.utils.tile;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
@AllArgsConstructor
|
||||
public enum YakamonType implements Collectible {
|
||||
GROUVAN(new YakamonInfo('g').withYakadexId(13)),
|
||||
GURVALIN(new YakamonInfo('v').withYakadexId(12)),
|
||||
YAKOSHII(new YakamonInfo('i').withYakadexId(11)),
|
||||
KOYAKO(new YakamonInfo('k').withYakadexId(10)),
|
||||
NICOTALI(new YakamonInfo('n').withYakadexId(9)),
|
||||
LUCARYON(new YakamonInfo('u').withYakadexId(8)),
|
||||
LUCARYA(new YakamonInfo('l').withYakadexId(7)),
|
||||
BASTIEDON(new YakamonInfo('b').withYakadexId(6)),
|
||||
RAYQUAÏSSA(new YakamonInfo('r').withYakadexId(5)),
|
||||
LOUICUNE(new YakamonInfo('o').withYakadexId(4)),
|
||||
ACUMON(new YakamonInfo('a').withYakadexId(3)),
|
||||
YACUMON(new YakamonInfo('c').withYakadexId(2)),
|
||||
YAKIMON(new YakamonInfo('y').withYakadexId(1));
|
||||
|
||||
private final CollectibleInfo collectibleInfo;
|
||||
|
||||
@Override
|
||||
public CollectibleType getCollectibleType() {
|
||||
return CollectibleType.YAKAMON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public CollectibleInfo getCollectibleInfo() {
|
||||
return collectibleInfo;
|
||||
}
|
||||
@JsonCreator
|
||||
public static YakamonType jsonCreator(JsonNode node) {
|
||||
String value = node.get("value").asText();
|
||||
return YakamonType.valueOf(value);
|
||||
}
|
||||
}
|
||||
13
yakamon/src/main/resources/application.properties
Normal file
13
yakamon/src/main/resources/application.properties
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
%dev.quarkus.http.port=8081
|
||||
quarkus.datasource.db-kind=postgresql
|
||||
quarkus.datasource.username=postgres
|
||||
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/yakamon?currentSchema=public
|
||||
quarkus.transaction-manager.default-transaction-timeout=3000s
|
||||
quarkus.hibernate-orm.log.queries-slower-than-ms=200
|
||||
quarkus.http.cors=true
|
||||
quarkus.http.cors.origins=*
|
||||
quarkus.hibernate-orm.database.generation=drop-and-create
|
||||
quarkus.hibernate-orm.sql-load-script=db/init_db.sql
|
||||
|
||||
quarkus.devservices.enabled=true
|
||||
%test.quarkus.devservices.enabled=false
|
||||
17
yakamon/src/main/resources/db/init_db.sql
Normal file
17
yakamon/src/main/resources/db/init_db.sql
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
DELETE FROM yakadex_entry;
|
||||
|
||||
INSERT INTO yakadex_entry (id, name, first_type, second_type, description, evolution_id, evolve_threshold, caught)
|
||||
VALUES
|
||||
(3, 'Acumon', 'STELLAR', null, 'Silent and distant, it drifts among the stars. Its light feels warm, yet no one knows what thoughts hide behind its glow.', null, null,false),
|
||||
(2, 'Yacumon', 'FIRE', 'DARK', 'Hardened by its falls, it learned to smile even in the dark. Its flames burn quieter, but its will is sharper than ever.', 3, 8, false),
|
||||
(1, 'Yakimon', 'FIRE', 'FAIRY', 'It runs anywhere without ever worrying, it may fall but always come backup, nothing seems to alter its joyful spirit.', 2, 2, false),
|
||||
(4, 'Louicune', 'WATER', null, 'This mythical creature is the embodiment of the compassion of a pure spring of water, it is said it come on occasion to save desperate people drowning.', null, null, false),
|
||||
(5, 'Rayquaïssa', 'DRAGON', 'FLYING', 'He is said to have lived for hundreds of millions of years. Legends remain of how it put to rest the clash between Kyogre and Grouvan.', null, null, false),
|
||||
(6, 'Bastiedon', 'ROCK', 'STEEL', 'Steel-faced, unmovable Yakamon that looks defensive but is actually just stubborn, overthinking everything behind an indestructible wall of “I’ve got this.”', null, null, false),
|
||||
(8, 'Lucaryon', 'FAIRY','POISON','She has mastered her aura to an even higher level, making her faster, stronger, and deadlier in battle.', null, null, false),
|
||||
(7, 'Lucarya', 'FAIRY', null, 'She can sense and control aura, letting her anticipate her opponents’ moves.', 8, 78, false),
|
||||
(9, 'Nicotali', 'DARK', null, 'Active only at night, Nicotali silently watches its surroundings.', null, null, false),
|
||||
(11, 'Yakoshii', 'GRASS', 'PSYCHIC', 'A silent thread in nature''s loom, it turns the shadows into bloom.', null, null, false),
|
||||
(10, 'Koyako', 'GRASS', null, 'Born from the forest''s gentle hum, it dreams beneath the morning sun.', 11, 6, false),
|
||||
(13, 'Grouvan', 'GROUND', 'PSYCHIC', 'Quite friendly after all, he is eager to save people from despair.', null, null, false),
|
||||
(12, 'Gurvalin', 'GROUND', null, 'Lost in this adventure, he is trying to find his way. He is not afraid of potential enemies.', 13, 15, false);
|
||||
11
yakamon/src/main/resources/maps/debug.epimap
Normal file
11
yakamon/src/main/resources/maps/debug.epimap
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
7GN7SN5WN
|
||||
7GS7SS5RS
|
||||
7GY7SY5RY
|
||||
2GN1Gb1Gv1Gn1Gl1Go1Gr1Gy1Gk1Gb1Gv1Gn1Gl1Go1Gr1Gy1Gk1GN
|
||||
9MN9GN1GN
|
||||
9MN9WN1WN
|
||||
9MN9WN2WN
|
||||
9RN9WN1MN
|
||||
9WN1WN2MN7WN
|
||||
9WN9WN1WN
|
||||
2WN1Wb1Wv1Wn1Wl1Wo1Wr1Wy1Wk1Wb1Wv1Wn1Wl1Wo1Wr1Wy1Wk1WN
|
||||
11
yakamon/src/main/resources/maps/walkable.epimap
Normal file
11
yakamon/src/main/resources/maps/walkable.epimap
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
9GN6RN6SN
|
||||
9GN6RN6SN
|
||||
9GN6RN6SN
|
||||
9GN6RN6SN
|
||||
9GN6RN6SN
|
||||
9GN6RN6SN
|
||||
9GN6RN6SN
|
||||
9GN6RN6SN
|
||||
9GN6RN6SN
|
||||
9GN6RN6SN
|
||||
9GN6RN6SN
|
||||
42
yakamon/src/main/resources/maps/yakalos.epimap
Normal file
42
yakamon/src/main/resources/maps/yakalos.epimap
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
4GN2MN4GN3RN7GN1SN5MN1SN7GN1SN5WN1SN1GN
|
||||
1Gy3GN2MN1GN1Go4GN1RN1RS5RN1GN1SN5MN1SN1GN4SN2GN7SN1GN
|
||||
1GN1GS2GN2MN1GS3GN2MN1GY1RN4SN3RN8SN2WN1SN3GN1GS1SN2MN1SN2GN
|
||||
4GN2MN4GN2MN1GN1RN1SN2WN3SN1RN2GN1RN3GN1SN3WN1SN1GN1Gk2GN1SN2MN1SN2GN
|
||||
4GN2MN4GN2MN1GN1RN2SN3WN1SN2RN1GN2RN2GN5SN4GN1SN2MN1SN2GN
|
||||
1RN8GN1GS4RN6SN3RN1Rl4RN8GN1SN2MN1SN2GN
|
||||
1RN1GN7MN1GN4RN5MN1SN8RN1RY3SN3RN1GN1SN2MN1SN2GN
|
||||
1RN1GN7MN1GN1RN2GN1SS5MN1SN1RN1SS7SN7RN1SN2MN1SN2GN
|
||||
3RN2GN1Gv4GN1RN2GN1SN5MN9SN1Sk5SN2RN4SN2GN
|
||||
2SN9RN2GN9SN1SS3SN3WN6SN5RN2GN
|
||||
1WN1SN1RN5GN1RN7GN5SN9WN2SN6SN2RN2GN
|
||||
1WN1SN2RN1GN2MN1GN1RN1GN2MN3GN4SN9WN1MN3WN3SN2MN1SN2RN1GS1GN
|
||||
1WN1SN2RN1GN2MN1GN1RN1GN2MN1GY1GN1GS1SN9WN1MN2WN1MN5WN1SN2MN1SN2RN2GN
|
||||
1WN1SN2RN1GN2MN1GN1RN1GN2MN3GN1SN8WN1MN2WN1MN6WN1SN2MN1SN1RN3GN
|
||||
1WN1SN1RN1RS1GN2MN1GN1RN1GN2MN3GN1SN6WN3MN4WN5WN1SS2MN1SN1RN1GN1Gk1GN
|
||||
1WN1SN2RN1GN2MN1GN1RN6GN1SN9WN1Wo1WN3MN4WN4SN1RN3GN
|
||||
1WN1SN2RN1GN2MN1Gk1RN3GN2MN1GS2SN9WN1MN3WN1MN3WN2SN3RN3GN
|
||||
1WN1SN2RN1GN2MN1GN1RN3GN2MN1GN2SN5WN2MN1WN1MN2WN1Mr1WN1MN3WN2SN3RN3GN
|
||||
1WN1SN2RN1GN2MN1GY1RN1GN4MN1GN1SN1SS7WN1MN5WN1MN3WN2SN2RN1RS3GN
|
||||
1WN1SN1RS1RN1GN2MN1Gv1RN1GN4MN1GN3SN6WN1MN2WN1WN2MN4WN2SN1RN1GN2MN2GN
|
||||
1WN1SN2RN1GN2MN1GN1RS6GN3SN6WN4MN6WN2SN1RY1GN2MN2GN
|
||||
1WN1SN1RN1Rl1GN2MN1GN1RN4SN3GN3SN9WN6WN2SN1RN1GS2MN2GN
|
||||
1WN1SN2RN4GN1RY1SN2MN1SN3GN1Gv2SN9WN5WN3SN1RN1GN2MN2GN
|
||||
1WN1SN7RN1SN2MN1SN4GN1SN2WN4SN2WN4SN1Sl4SN1SS1RN1GN2MN2GN
|
||||
1WN1SN3RN1Rn3RN1SN2MN1SN4GN1SN2WN1SN1Sv2SN2WN3SN3GN3SN3RN4GN
|
||||
1WN1SN7RN1SN2MN1SN1GS3GN1SN2WN3SN2WN1SN6GN1SN1WN4SN1RN1GN1Gv1GN
|
||||
1WN1SN1RN5SN1RN1SN2MN1SN3GN2SN2WN2SN2WN2SN6GN1SN4WN1SN1RN1GS2GN
|
||||
1WN3SN3WN1SN1RN6SN1SY1SN2WN2SN1SS2WN1SN7GN6SN1RN3GN
|
||||
1WN2SN4WN6SN2WN2SN3WN2SN2WN1SN9GN4GN1RN3GN
|
||||
1WN2SN3WN8SN1WN6SN3WN1SN1GY2GN1RN1GS9RN1RN2GN
|
||||
1WN2SN2WN4SN4MN8SN2WN1SN2GN4RN3MN2RN1Gb6GN
|
||||
1WN6SN1SS1SN4MN3SN1WN4SN2WN1SN1GN1Rl4RN3MN9RN
|
||||
1WN6SN1Sl1SN4MN3SN3WN2SN2WN1SN1GN4RN4LN4LN2RN2MN1RN
|
||||
1WN8SN4MN3SN4WN1SN2WN1SN1GN1RN2MN9LN1Ly1LN2MN1RN
|
||||
1WN1SN1WN9SN1SS4SN3WN1SN3WN1SN1RN2MN4LN1Ly4LN2LN2MN1RN
|
||||
1WN1SN2WN7SN1SY1SN2RN6SN3WN1SN1RS2MN9LN2LN2MN1RN
|
||||
1WN2SN2WN4SN3WN2SN3RN1Rb2RN1SN2WN2SN1RN2MN9LN2LN2MN1RN
|
||||
1WN1SN4WN1SN1GS2SN3WN2SN5RN1SY2WN1SN1GN1RN2MN9LN1Ly1LN2MN1RN
|
||||
1WN1SN4WN1SN2GN2SN3WN7SN1WN1SN2GN1Rn2MN5LN6LN2MN1RN
|
||||
1WN1SN4WN1SN3GN3SN1WN1SN5MN1SN1WN1SN1GN2MN7LN6LN2MN1RN
|
||||
1WN2SN2WN1SN6GN3SN5MN1SN1WN1SN1GN2MN2LN9MN2LN2MN1RN
|
||||
1WN5SN8GN7SN1WN2SN2MN2LN9MN2LN2MN1RN
|
||||
537
yakamon/src/main/resources/openapi.yaml
Normal file
537
yakamon/src/main/resources/openapi.yaml
Normal file
|
|
@ -0,0 +1,537 @@
|
|||
---
|
||||
openapi: 3.1.0
|
||||
tags:
|
||||
- name: Game
|
||||
- name: Inventory
|
||||
- name: Player
|
||||
- name: Team
|
||||
- name: Yakadex
|
||||
components:
|
||||
schemas:
|
||||
CollectResponse:
|
||||
type: object
|
||||
properties:
|
||||
tileType:
|
||||
$ref: "#/components/schemas/TileType"
|
||||
Collectible:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
$ref: "#/components/schemas/CollectibleType"
|
||||
value:
|
||||
type: string
|
||||
CollectibleType:
|
||||
type: string
|
||||
enum:
|
||||
- ITEM
|
||||
- YAKAMON
|
||||
Direction:
|
||||
type: string
|
||||
enum:
|
||||
- UP
|
||||
- RIGHT
|
||||
- DOWN
|
||||
- LEFT
|
||||
ElementType:
|
||||
type: string
|
||||
enum:
|
||||
- BUG
|
||||
- DARK
|
||||
- ELECTRIC
|
||||
- FAIRY
|
||||
- FIGHTING
|
||||
- FIRE
|
||||
- FLYING
|
||||
- GHOST
|
||||
- GRASS
|
||||
- GROUND
|
||||
- ICE
|
||||
- NORMAL
|
||||
- POISON
|
||||
- PSYCHIC
|
||||
- ROCK
|
||||
- STEEL
|
||||
- WATER
|
||||
- DRAGON
|
||||
- STELLAR
|
||||
FeedRequest:
|
||||
type: object
|
||||
properties:
|
||||
quantity:
|
||||
type: integer
|
||||
format: int32
|
||||
InventoryResponse:
|
||||
type: object
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Item"
|
||||
Item:
|
||||
type: object
|
||||
properties:
|
||||
itemType:
|
||||
$ref: "#/components/schemas/ItemType"
|
||||
quantity:
|
||||
type: integer
|
||||
format: int32
|
||||
ItemType:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum:
|
||||
- ITEM
|
||||
value:
|
||||
type: string
|
||||
enum:
|
||||
- YAKABALL
|
||||
- SCROOGE
|
||||
- NONE
|
||||
LocalDateTime:
|
||||
type: string
|
||||
format: date-time
|
||||
examples:
|
||||
- 2022-03-10T12:15:50
|
||||
MoveRequest:
|
||||
type: object
|
||||
properties:
|
||||
direction:
|
||||
$ref: "#/components/schemas/Direction"
|
||||
MoveResponse:
|
||||
type: object
|
||||
properties:
|
||||
posX:
|
||||
type: integer
|
||||
format: int32
|
||||
posY:
|
||||
type: integer
|
||||
format: int32
|
||||
PlayerResponse:
|
||||
type: object
|
||||
properties:
|
||||
uuid:
|
||||
$ref: "#/components/schemas/UUID"
|
||||
name:
|
||||
type: string
|
||||
posX:
|
||||
type: integer
|
||||
format: int32
|
||||
posY:
|
||||
type: integer
|
||||
format: int32
|
||||
lastMove:
|
||||
$ref: "#/components/schemas/LocalDateTime"
|
||||
lastCollect:
|
||||
$ref: "#/components/schemas/LocalDateTime"
|
||||
lastCatch:
|
||||
$ref: "#/components/schemas/LocalDateTime"
|
||||
lastFeed:
|
||||
$ref: "#/components/schemas/LocalDateTime"
|
||||
RenameRequest:
|
||||
type: object
|
||||
properties:
|
||||
newNickname:
|
||||
type: string
|
||||
StartRequest:
|
||||
type: object
|
||||
properties:
|
||||
mapPath:
|
||||
type: string
|
||||
playerName:
|
||||
type: string
|
||||
StartResponse:
|
||||
type: object
|
||||
properties:
|
||||
tiles:
|
||||
type: array
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/TileType"
|
||||
TerrainType:
|
||||
type: string
|
||||
enum:
|
||||
- GRASS
|
||||
- MOUNTAIN
|
||||
- ROCK
|
||||
- SAND
|
||||
- WATER
|
||||
- LAVA
|
||||
TileType:
|
||||
type: object
|
||||
properties:
|
||||
terrainType:
|
||||
$ref: "#/components/schemas/TerrainType"
|
||||
collectible:
|
||||
$ref: "#/components/schemas/Collectible"
|
||||
UUID:
|
||||
type: string
|
||||
format: uuid
|
||||
pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"
|
||||
YakadexEntryResponse:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int32
|
||||
name:
|
||||
type: string
|
||||
firstType:
|
||||
$ref: "#/components/schemas/ElementType"
|
||||
secondType:
|
||||
$ref: "#/components/schemas/ElementType"
|
||||
evolveThreshold:
|
||||
type: integer
|
||||
format: int32
|
||||
evolutionId:
|
||||
type: integer
|
||||
format: int32
|
||||
caught:
|
||||
type: boolean
|
||||
description:
|
||||
type: string
|
||||
YakadexResponse:
|
||||
type: object
|
||||
properties:
|
||||
entries:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/YakadexEntryResponse"
|
||||
YakamonResponse:
|
||||
type: object
|
||||
properties:
|
||||
uuid:
|
||||
$ref: "#/components/schemas/UUID"
|
||||
nickname:
|
||||
type: string
|
||||
yakadexId:
|
||||
type: integer
|
||||
format: int32
|
||||
energyPoints:
|
||||
type: integer
|
||||
format: int32
|
||||
YakamonTeamResponse:
|
||||
type: object
|
||||
properties:
|
||||
yakamons:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/YakamonResponse"
|
||||
paths:
|
||||
/catch:
|
||||
post:
|
||||
summary: Catch Yakamon
|
||||
description: Attempt to catch a Yakamon at the player's current position.
|
||||
tags:
|
||||
- Player
|
||||
responses:
|
||||
"200":
|
||||
description: Yakamon successfully caught.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/YakamonResponse"
|
||||
"400":
|
||||
description: "No Yakamon at the current position, not enough Yakaballs,\
|
||||
\ team is full or the game is not running."
|
||||
"429":
|
||||
description: Player has recently caught a yakamon and must wait.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/collect:
|
||||
post:
|
||||
summary: Collect resources
|
||||
description: |-
|
||||
Collect the available resource on the player's current tile and sends back
|
||||
the updated tile. The player **must** not have collected too recently.
|
||||
You **must** send back the updated tile.
|
||||
tags:
|
||||
- Player
|
||||
responses:
|
||||
"200":
|
||||
description: Resource successfully collected into the inventory.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/CollectResponse"
|
||||
"400":
|
||||
description: Invalid tile or the game is not running.
|
||||
"429":
|
||||
description: Player has recently collected and must wait before collecting
|
||||
again.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/inventory:
|
||||
get:
|
||||
summary: Retrieve all information about the player's inventory
|
||||
description: Fetch all available items in the player's inventory.
|
||||
tags:
|
||||
- Inventory
|
||||
responses:
|
||||
"200":
|
||||
description: Inventory successfully retrieved.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/InventoryResponse"
|
||||
"400":
|
||||
description: The game is not running.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/move:
|
||||
post:
|
||||
summary: Move player
|
||||
description: "Move the player in the specified direction (left, right, up, or\
|
||||
\ down). The requested direction **must** be valid and the player **must**\
|
||||
\ not have moved too recently."
|
||||
tags:
|
||||
- Player
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/MoveRequest"
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: Player successfully moved.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/MoveResponse"
|
||||
"400":
|
||||
description: Invalid direction or the game is not running.
|
||||
"429":
|
||||
description: Player has recently moved and must wait before moving again.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/player:
|
||||
get:
|
||||
summary: Retrieve player information
|
||||
description: Fetch information about the current player.
|
||||
tags:
|
||||
- Player
|
||||
responses:
|
||||
"200":
|
||||
description: Player information successfully retrieved.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/PlayerResponse"
|
||||
"400":
|
||||
description: The game is not running.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/start:
|
||||
post:
|
||||
summary: Start the game
|
||||
description: Clear all the database tables. Initialize and start the game.
|
||||
tags:
|
||||
- Game
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/StartRequest"
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: The game started successfully.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/StartResponse"
|
||||
"400":
|
||||
description: Invalid `path` or invalid `name` provided.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/team:
|
||||
get:
|
||||
summary: Retrieve the yakamons in the player's team
|
||||
description: Fetch all yakamons currently in the player's team.
|
||||
tags:
|
||||
- Team
|
||||
responses:
|
||||
"200":
|
||||
description: Player's team successfully retrieved.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/YakamonTeamResponse"
|
||||
"400":
|
||||
description: The game is not running.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/team/{uuid}/evolve:
|
||||
post:
|
||||
summary: Evolve a yakamon from the player's team
|
||||
description: Evolve a yakamon from the player's team. The yakamon **must** have
|
||||
enough energy points to evolve to the next form.
|
||||
tags:
|
||||
- Team
|
||||
parameters:
|
||||
- name: uuid
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/components/schemas/UUID"
|
||||
responses:
|
||||
"200":
|
||||
description: Yakamon successfully evolved.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/YakamonResponse"
|
||||
"400":
|
||||
description: The game is not running or the yakamon needs more energy points
|
||||
to evolve.
|
||||
"404":
|
||||
description: The yakamon was not found in the team or reached its maximum
|
||||
evolution tier.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/team/{uuid}/feed:
|
||||
post:
|
||||
summary: Feed a yakamon in the player's team
|
||||
description: Feed a yakamon in the player's team. The player **must** have enough
|
||||
``Scrooge`` in his inventory.
|
||||
tags:
|
||||
- Team
|
||||
parameters:
|
||||
- name: uuid
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/components/schemas/UUID"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FeedRequest"
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: Yakamon successfully fed.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/YakamonResponse"
|
||||
"400":
|
||||
description: "Not enough Scrooge, invalid amount (.i.e <= 0) or the game\
|
||||
\ is not running."
|
||||
"404":
|
||||
description: The yakamon was not found in the team.
|
||||
"429":
|
||||
description: Player has recently fed a yakamon and must wait before feed
|
||||
one again.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/team/{uuid}/release:
|
||||
delete:
|
||||
summary: Release a yakamon into the wild
|
||||
description: Remove a yakamon from the player's team.
|
||||
tags:
|
||||
- Team
|
||||
parameters:
|
||||
- name: uuid
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/components/schemas/UUID"
|
||||
responses:
|
||||
"204":
|
||||
description: Yakamon successfully released.
|
||||
"400":
|
||||
description: The game is not running.
|
||||
"403":
|
||||
description: The player cannot release the last yakamon that can walk on
|
||||
the player's current tile.
|
||||
"404":
|
||||
description: The yakamon was not found in the team.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/team/{uuid}/rename:
|
||||
patch:
|
||||
summary: Rename a yakamon in the player's team
|
||||
description: Change the nickname of a yakamon in the player's team. The nickname
|
||||
**must** not be blank nor null and its length **must** be less or equal to
|
||||
20 characters.
|
||||
tags:
|
||||
- Team
|
||||
parameters:
|
||||
- name: uuid
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/components/schemas/UUID"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/RenameRequest"
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: The updated yakamon.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/YakamonResponse"
|
||||
"400":
|
||||
description: The game is not running or the new nickname is invalid.
|
||||
"404":
|
||||
description: The yakamon was not found.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/yakadex:
|
||||
get:
|
||||
summary: Retrieve all information about yakamon
|
||||
description: Fetch information about every yakamon available in the game.
|
||||
tags:
|
||||
- Yakadex
|
||||
parameters:
|
||||
- name: only_missing
|
||||
in: query
|
||||
schema:
|
||||
type: boolean
|
||||
responses:
|
||||
"200":
|
||||
description: Yakadex successfully retrieved.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/YakadexResponse"
|
||||
"400":
|
||||
description: The game is not running.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
/yakadex/{id}:
|
||||
get:
|
||||
summary: Retrieve all information about a yakamon
|
||||
description: Fetch all information about the yakamon with the specified ID.
|
||||
tags:
|
||||
- Yakadex
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
responses:
|
||||
"200":
|
||||
description: Yakamon successfully retrieved.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/YakadexEntryResponse"
|
||||
"400":
|
||||
description: The game is not running.
|
||||
"404":
|
||||
description: This yakamon does not exist.
|
||||
servers:
|
||||
- url: http://localhost:8081
|
||||
info:
|
||||
title: yakamon API
|
||||
version: 1.0.0
|
||||
Loading…
Add table
Add a link
Reference in a new issue