diff --git a/pom.xml b/pom.xml index d0dc569..276a805 100644 --- a/pom.xml +++ b/pom.xml @@ -71,6 +71,11 @@ spring-boot-starter-test test + + org.springframework.boot + spring-boot-starter-thymeleaf + compile + net.jodah expiringmap diff --git a/src/main/java/cc/fascinated/Consts.java b/src/main/java/cc/fascinated/Consts.java index 09c39f3..aefb8b0 100644 --- a/src/main/java/cc/fascinated/Consts.java +++ b/src/main/java/cc/fascinated/Consts.java @@ -2,7 +2,6 @@ package cc.fascinated; import lombok.Getter; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Component; @Component diff --git a/src/main/java/cc/fascinated/Main.java b/src/main/java/cc/fascinated/Main.java index eeda6a9..44beb92 100644 --- a/src/main/java/cc/fascinated/Main.java +++ b/src/main/java/cc/fascinated/Main.java @@ -3,9 +3,7 @@ package cc.fascinated; import com.google.gson.Gson; import lombok.Getter; import lombok.SneakyThrows; -import lombok.experimental.Helper; import lombok.extern.log4j.Log4j2; -import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/main/java/cc/fascinated/api/controller/HomeController.java b/src/main/java/cc/fascinated/api/controller/HomeController.java new file mode 100644 index 0000000..0a85e68 --- /dev/null +++ b/src/main/java/cc/fascinated/api/controller/HomeController.java @@ -0,0 +1,18 @@ +package cc.fascinated.api.controller; + +import cc.fascinated.Consts; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +@RequestMapping(value = "/") +public class HomeController { + + @RequestMapping(value = "/") + public String home(Model model) { + model.addAttribute("url", Consts.getSITE_URL() + "/eeab5f8a-18dd-4d58-af78-2b3c4543da48"); + model.addAttribute("avatar_url", Consts.getSITE_URL() + "/avatar/eeab5f8a-18dd-4d58-af78-2b3c4543da48"); + return "index"; + } +} diff --git a/src/main/java/cc/fascinated/mojang/MojangAPIService.java b/src/main/java/cc/fascinated/mojang/MojangAPIService.java index 6ec5243..00247d1 100644 --- a/src/main/java/cc/fascinated/mojang/MojangAPIService.java +++ b/src/main/java/cc/fascinated/mojang/MojangAPIService.java @@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.net.URI; -import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; diff --git a/src/main/java/cc/fascinated/player/PlayerManagerService.java b/src/main/java/cc/fascinated/player/PlayerManagerService.java index a576d03..0b3cfce 100644 --- a/src/main/java/cc/fascinated/player/PlayerManagerService.java +++ b/src/main/java/cc/fascinated/player/PlayerManagerService.java @@ -8,8 +8,6 @@ import cc.fascinated.util.UUIDUtils; import lombok.extern.log4j.Log4j2; import net.jodah.expiringmap.ExpirationPolicy; import net.jodah.expiringmap.ExpiringMap; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import java.util.Map; diff --git a/src/main/java/cc/fascinated/player/impl/Player.java b/src/main/java/cc/fascinated/player/impl/Player.java index 3ebd7f0..1e8b406 100644 --- a/src/main/java/cc/fascinated/player/impl/Player.java +++ b/src/main/java/cc/fascinated/player/impl/Player.java @@ -7,7 +7,6 @@ import cc.fascinated.mojang.types.MojangSessionServerProfileProperties; import cc.fascinated.util.UUIDUtils; import com.google.gson.JsonObject; import lombok.Getter; -import org.springframework.beans.factory.annotation.Value; import java.util.UUID; diff --git a/src/main/java/cc/fascinated/player/impl/Skin.java b/src/main/java/cc/fascinated/player/impl/Skin.java index 34d1cea..f3f16bf 100644 --- a/src/main/java/cc/fascinated/player/impl/Skin.java +++ b/src/main/java/cc/fascinated/player/impl/Skin.java @@ -2,9 +2,8 @@ package cc.fascinated.player.impl; import cc.fascinated.Main; import com.fasterxml.jackson.annotation.JsonIgnore; -import lombok.*; -import org.springframework.stereotype.Service; -import org.springframework.web.bind.annotation.RequestParam; +import lombok.Getter; +import lombok.SneakyThrows; import java.net.URI; import java.net.http.HttpRequest; diff --git a/src/main/java/cc/fascinated/player/impl/SkinPart.java b/src/main/java/cc/fascinated/player/impl/SkinPart.java index 36d5064..c6789d7 100644 --- a/src/main/java/cc/fascinated/player/impl/SkinPart.java +++ b/src/main/java/cc/fascinated/player/impl/SkinPart.java @@ -6,7 +6,6 @@ import lombok.extern.log4j.Log4j2; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; -import java.awt.image.DataBufferByte; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html new file mode 100644 index 0000000..acfaa0e --- /dev/null +++ b/src/main/resources/templates/index.html @@ -0,0 +1,22 @@ + + + + Minecraft Helper + + + + + + + + +

Hello!

+

I don't feel like making this pretty.

+ +
+

Player Data: Player Data

+

Avatar Url: Avatar Url

+
+ + \ No newline at end of file