Merge pull request 'Enable JSON output.' (#5) from feature/enable-json into master
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: java/labyrinth-server#5
This commit is contained in:
commit
7937f12508
2 changed files with 14 additions and 1 deletions
2
pom.xml
2
pom.xml
|
@ -19,7 +19,7 @@
|
||||||
<java.target.version>17</java.target.version>
|
<java.target.version>17</java.target.version>
|
||||||
<jetbrains-annotations.version>24.0.1</jetbrains-annotations.version>
|
<jetbrains-annotations.version>24.0.1</jetbrains-annotations.version>
|
||||||
<junit-jupiter.version>5.9.2</junit-jupiter.version>
|
<junit-jupiter.version>5.9.2</junit-jupiter.version>
|
||||||
<labyrinth-generator.version>0.0.5</labyrinth-generator.version>
|
<labyrinth-generator.version>0.0.6</labyrinth-generator.version>
|
||||||
<logback.version>1.4.6</logback.version>
|
<logback.version>1.4.6</logback.version>
|
||||||
<lombok.version>1.18.26</lombok.version>
|
<lombok.version>1.18.26</lombok.version>
|
||||||
<slf4j.version>2.0.7</slf4j.version>
|
<slf4j.version>2.0.7</slf4j.version>
|
||||||
|
|
|
@ -2,6 +2,7 @@ package ch.fritteli.labyrinth.server;
|
||||||
|
|
||||||
import ch.fritteli.labyrinth.generator.model.Labyrinth;
|
import ch.fritteli.labyrinth.generator.model.Labyrinth;
|
||||||
import ch.fritteli.labyrinth.generator.renderer.html.HTMLRenderer;
|
import ch.fritteli.labyrinth.generator.renderer.html.HTMLRenderer;
|
||||||
|
import ch.fritteli.labyrinth.generator.renderer.json.JsonRenderer;
|
||||||
import ch.fritteli.labyrinth.generator.renderer.pdf.PDFRenderer;
|
import ch.fritteli.labyrinth.generator.renderer.pdf.PDFRenderer;
|
||||||
import ch.fritteli.labyrinth.generator.renderer.text.TextRenderer;
|
import ch.fritteli.labyrinth.generator.renderer.text.TextRenderer;
|
||||||
import ch.fritteli.labyrinth.generator.serialization.SerializerDeserializer;
|
import ch.fritteli.labyrinth.generator.serialization.SerializerDeserializer;
|
||||||
|
@ -28,6 +29,18 @@ public enum OutputType {
|
||||||
false,
|
false,
|
||||||
"h",
|
"h",
|
||||||
"html"),
|
"html"),
|
||||||
|
JSON("application/json",
|
||||||
|
"json",
|
||||||
|
labyrinth -> JsonRenderer.newInstance().render(labyrinth).getBytes(StandardCharsets.UTF_8),
|
||||||
|
false,
|
||||||
|
"j",
|
||||||
|
"json"),
|
||||||
|
JSONFILE("application/json",
|
||||||
|
"json",
|
||||||
|
labyrinth -> JsonRenderer.newInstance().render(labyrinth).getBytes(StandardCharsets.UTF_8),
|
||||||
|
true,
|
||||||
|
"s",
|
||||||
|
"jsonfile"),
|
||||||
PDF("application/pdf",
|
PDF("application/pdf",
|
||||||
"pdf",
|
"pdf",
|
||||||
labyrinth -> PDFRenderer.newInstance().render(labyrinth).toByteArray(),
|
labyrinth -> PDFRenderer.newInstance().render(labyrinth).toByteArray(),
|
||||||
|
|
Loading…
Reference in a new issue