1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-09-28 23:51:56 +02:00
This commit is contained in:
Anthony Stirling 2024-01-04 23:04:15 +00:00
parent 770b61bb7a
commit 6c963e1b6c
2 changed files with 13 additions and 13 deletions

View File

@ -1,26 +1,27 @@
package stirling.software.SPDF.controller.web;
import java.io.IOException;
import java.nio.file.Files;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.Hidden;
import stirling.software.SPDF.model.ApplicationProperties;
import stirling.software.SPDF.model.Dependency;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import java.io.IOException;
import java.nio.file.Files;
import java.util.List;
import java.util.Map;
@Controller
public class HomeWebController {
@ -39,7 +40,8 @@ public class HomeWebController {
try {
String json = new String(Files.readAllBytes(resource.getFile().toPath()));
ObjectMapper mapper = new ObjectMapper();
Map<String, List<Dependency>> data = mapper.readValue(json, new TypeReference<Map<String, List<Dependency>>>() {});
Map<String, List<Dependency>> data =
mapper.readValue(json, new TypeReference<Map<String, List<Dependency>>>() {});
model.addAttribute("dependencies", data.get("dependencies"));
} catch (IOException e) {
e.printStackTrace();
@ -47,7 +49,6 @@ public class HomeWebController {
return "licenses";
}
@GetMapping("/")
public String home(Model model) {
model.addAttribute("currentPage", "home");

View File

@ -9,5 +9,4 @@ public class Dependency {
private String moduleVersion;
private String moduleLicense;
private String moduleLicenseUrl;
}