This repository was archived by the owner on Dec 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
java/com/contentstack/gqlspring Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -70,12 +70,10 @@ public String loadIndexPage(Model model) throws JsonProcessingException {
7070 .build ();
7171 JsonNode response = gqlInstance .fetch ().get ("data" ).get ("all_footer" ).get ("items" );
7272 System .out .println (response );
73- // ObjectMapper mapper = new ObjectMapper();
74- // List<FooterModel> footerModels = mapper.readValue(response.toString(),
75- // new TypeReference<List<FooterModel>>() {
76- // });
77- // System.out.println(footerModels);
78- model .addAttribute ("index" , response );
73+ ObjectMapper mapper = new ObjectMapper ();
74+ List <FooterModel > dataList = mapper .readValue (response .toString (), new TypeReference <List <FooterModel >>(){});
75+ System .out .println (dataList );
76+ model .addAttribute ("index" , dataList );
7977 return "index" ;
8078 }
8179
Original file line number Diff line number Diff line change 66/**
77 * The type Product.
88 */
9- @ Data
109public class FooterModel {
1110
1211 /**
1312 * The Title.
1413 */
15- @ JsonProperty
1614 String title ;
1715
16+ public String getTitle () {
17+ return title ;
18+ }
19+
20+ public void setTitle (String title ) {
21+ this .title = title ;
22+ }
23+
24+ @ Override
25+ public String toString () {
26+ return "FooterModel{" +
27+ "title='" + title + '\'' +
28+ '}' ;
29+ }
1830}
Original file line number Diff line number Diff line change 1818 < a href ="/ " class ="card-link ">
1919 < div class ="card-text "> Index</ div >
2020 < p th:text ="'content: ' + ${index.content} "> </ p >
21+ < p th:text ="'content: ' + ${content.title} "> </ p >
2122 </ a >
2223 </ div >
2324
You can’t perform that action at this time.
0 commit comments