diff --git a/src/main/java/net/Broken/MainBot.java b/src/main/java/net/Broken/MainBot.java index 41b8891..fae51f9 100644 --- a/src/main/java/net/Broken/MainBot.java +++ b/src/main/java/net/Broken/MainBot.java @@ -1,10 +1,10 @@ package net.Broken; +import net.Broken.RestApi.ApiCommandLoader; import net.Broken.Tools.Command.CommandParser; import net.Broken.Tools.EmbedMessageUtils; import net.Broken.Tools.UserManager.UserRegister; import net.Broken.Tools.UserSpamUtils; -import net.Broken.RestApi.ApiCommandLoader; import net.dv8tion.jda.core.JDA; import net.dv8tion.jda.core.entities.ChannelType; import net.dv8tion.jda.core.entities.Message; @@ -18,7 +18,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.stereotype.Controller; -import java.security.SecureRandom; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/net/Broken/webView/GeneralWebView.java b/src/main/java/net/Broken/webView/GeneralWebView.java new file mode 100644 index 0000000..c16916e --- /dev/null +++ b/src/main/java/net/Broken/webView/GeneralWebView.java @@ -0,0 +1,13 @@ +package net.Broken.webView; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +public class GeneralWebView { + @RequestMapping("/") + public String music(Model model){ + return "index"; + } +} diff --git a/src/main/java/net/Broken/webView/MvcApplication.java b/src/main/java/net/Broken/webView/MvcApplication.java new file mode 100644 index 0000000..fdd27e3 --- /dev/null +++ b/src/main/java/net/Broken/webView/MvcApplication.java @@ -0,0 +1,33 @@ +package net.Broken.webView; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.resource.ContentVersionStrategy; +import org.springframework.web.servlet.resource.ResourceUrlEncodingFilter; +import org.springframework.web.servlet.resource.VersionResourceResolver; + +@Configuration +public class MvcApplication extends WebMvcConfigurerAdapter { + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + VersionResourceResolver versionResourceResolver = new VersionResourceResolver() + .addVersionStrategy(new ContentVersionStrategy(), "/**"); + + registry.addResourceHandler("/js/*.js") + .addResourceLocations("classpath:/static/js/") + .setCachePeriod(60 * 60 * 24 * 365) /* one year */ + .resourceChain(true) + .addResolver(versionResourceResolver); + } + @Bean + public ResourceUrlEncodingFilter resourceUrlEncodingFilter() { + return new ResourceUrlEncodingFilter(); + } + +} + + + diff --git a/src/main/resources/static/js/init.js b/src/main/resources/static/js/music.js similarity index 100% rename from src/main/resources/static/js/init.js rename to src/main/resources/static/js/music.js diff --git a/src/main/resources/static/index.html b/src/main/resources/templates/index.html similarity index 89% rename from src/main/resources/static/index.html rename to src/main/resources/templates/index.html index d71e1cf..c496afd 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/templates/index.html @@ -3,18 +3,19 @@
-