mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2024-11-16 12:20:12 +01:00
format
This commit is contained in:
parent
770b61bb7a
commit
6c963e1b6c
@ -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");
|
||||
|
@ -9,5 +9,4 @@ public class Dependency {
|
||||
private String moduleVersion;
|
||||
private String moduleLicense;
|
||||
private String moduleLicenseUrl;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user