File tree Expand file tree Collapse file tree 9 files changed +65
-13
lines changed
src/main/java/org/woehlke/learn/learnneo4j Expand file tree Collapse file tree 9 files changed +65
-13
lines changed Original file line number Diff line number Diff line change 55import org .springframework .boot .SpringApplication ;
66import org .springframework .boot .autoconfigure .SpringBootApplication ;
77import org .springframework .context .annotation .ComponentScan ;
8+ import org .springframework .data .jpa .repository .config .EnableJpaRepositories ;
89import org .springframework .data .neo4j .repository .config .EnableNeo4jRepositories ;
910import org .springframework .transaction .annotation .EnableTransactionManagement ;
1011import org .woehlke .learn .learnneo4j .model .Category ;
1112import org .woehlke .learn .learnneo4j .model .category .CategoryRepository ;
1213
14+ @ EnableJpaRepositories ({"org.woehlke.learn.learnneo4j.components.db" })
1315@ EnableNeo4jRepositories ({"org.woehlke.learn.learnneo4j.model" ,"org.woehlke.learn.learnneo4j.components" })
1416@ EnableTransactionManagement
1517@ ComponentScan ({"org.woehlke.learn.learnneo4j.model" ,"org.woehlke.learn.learnneo4j.components" })
Original file line number Diff line number Diff line change 1+ package org .woehlke .learn .learnneo4j .components ;
2+
3+ import org .slf4j .Logger ;
4+ import org .slf4j .LoggerFactory ;
5+ import org .springframework .context .ApplicationListener ;
6+ import org .springframework .context .event .ContextRefreshedEvent ;
7+ import org .springframework .stereotype .Component ;
8+
9+ @ Component
10+ public class StartupListener implements ApplicationListener <ContextRefreshedEvent > {
11+
12+ private static Logger log = LoggerFactory .getLogger (StartupListener .class .getName ());
13+
14+ @ Override
15+ public void onApplicationEvent (ContextRefreshedEvent event ) {
16+ log .info (" =========================== " );
17+ log .info (" === Application Started === " );
18+ log .info (" =========================== " );
19+ }
20+ }
Original file line number Diff line number Diff line change @@ -44,4 +44,26 @@ public class Portinfo {
4444
4545 @ Lob
4646 private String portfile ;
47+
48+ @ Override
49+ public String toString () {
50+ return "Portinfo{" +
51+ "id=" + id +
52+ ", port='" + port + '\'' +
53+ ", version='" + version + '\'' +
54+ ", category='" + category + '\'' +
55+ ", variants='" + variants + '\'' +
56+ ", description='" + description + '\'' +
57+ ", homepage='" + homepage + '\'' +
58+ ", license='" + license + '\'' +
59+ ", maintainers='" + maintainers + '\'' +
60+ ", platforms='" + platforms + '\'' +
61+ ", info='" + info + '\'' +
62+ ", deps='" + deps + '\'' +
63+ ", rdeps='" + rdeps + '\'' +
64+ ", dependents='" + dependents + '\'' +
65+ ", variantsInDetail='" + variantsInDetail + '\'' +
66+ ", portfile='" + portfile + '\'' +
67+ '}' ;
68+ }
4769}
Original file line number Diff line number Diff line change 1111import org .woehlke .learn .learnneo4j .model .platform .PlatformController ;
1212
1313@ Controller
14- @ RequestMapping ("/db/Portinfo/ " )
14+ @ RequestMapping ("/db/Portinfo" )
1515public class PortinfoController {
1616
1717 private static Logger log = LoggerFactory .getLogger (PlatformController .class .getName ());
@@ -21,7 +21,7 @@ public String getTitle(){
2121 return "Portinfo" ;
2222 }
2323
24- @ GetMapping ("all" )
24+ @ GetMapping ("/ all" )
2525 public String greeting (Model model ) {
2626 model .addAttribute ("all" , portinfoService .findAll ());
2727 log .info ("db/portinfo/all" );
Original file line number Diff line number Diff line change 88import org .springframework .web .bind .annotation .GetMapping ;
99import org .springframework .web .bind .annotation .ModelAttribute ;
1010import org .springframework .web .bind .annotation .RequestMapping ;
11+ import org .woehlke .learn .learnneo4j .model .Category ;
1112
13+ import java .util .ArrayList ;
14+ import java .util .List ;
1215@ Controller
13- @ RequestMapping ("/node/category/ " )
16+ @ RequestMapping ("/node/category" )
1417public class CategoryController {
1518
1619 private static Logger log = LoggerFactory .getLogger (CategoryController .class .getName ());
@@ -27,9 +30,14 @@ public String getTitle(){
2730 return "all Categories" ;
2831 }
2932
30- @ GetMapping ("all" )
33+ @ GetMapping ("/ all" )
3134 public String all (Model model ) {
32- model .addAttribute ("all" , categoryService .findAll ());
35+ List <Category > all = new ArrayList <Category >();
36+ for (Category category : categoryService .findAll ()) {
37+ all .add (category );
38+ log .info (category .toString ());
39+ }
40+ model .addAttribute ("all" , all );
3341 log .info ("/node/category/all" );
3442 return "/node/category/all" ;
3543 }
Original file line number Diff line number Diff line change 1010import org .springframework .web .bind .annotation .RequestMapping ;
1111
1212@ Controller
13- @ RequestMapping ("/node/license/ " )
13+ @ RequestMapping ("/node/license" )
1414public class LicenseController {
1515
1616 private static Logger log = LoggerFactory .getLogger (LicenseController .class .getName ());
@@ -27,7 +27,7 @@ public String getTitle(){
2727 return "all Licenses" ;
2828 }
2929
30- @ GetMapping ("all" )
30+ @ GetMapping ("/ all" )
3131 public String greeting (Model model ) {
3232 model .addAttribute ("all" , licenseService .findAll ());
3333 log .info ("/node/license/all" );
Original file line number Diff line number Diff line change 1010import org .springframework .web .bind .annotation .RequestMapping ;
1111
1212@ Controller
13- @ RequestMapping ("node/maintainer/ " )
13+ @ RequestMapping ("/ node/maintainer" )
1414public class MaintainerController {
1515
1616 private static Logger log = LoggerFactory .getLogger (MaintainerController .class .getName ());
@@ -26,7 +26,7 @@ public String getTitle(){
2626 return "all Categories" ;
2727 }
2828
29- @ GetMapping ("all" )
29+ @ GetMapping ("/ all" )
3030 public String greeting (Model model ) {
3131 model .addAttribute ("all" , maintainerService .findAll ());
3232 log .info ("node/maintainer/all" );
Original file line number Diff line number Diff line change 1010import org .springframework .web .bind .annotation .RequestMapping ;
1111
1212@ Controller
13- @ RequestMapping ("/node/platform/ " )
13+ @ RequestMapping ("/node/platform" )
1414public class PlatformController {
1515
1616 private static Logger log = LoggerFactory .getLogger (PlatformController .class .getName ());
@@ -21,7 +21,7 @@ public String getTitle(){
2121 return "all Categories" ;
2222 }
2323
24- @ GetMapping ("all" )
24+ @ GetMapping ("/ all" )
2525 public String greeting (Model model ) {
2626 model .addAttribute ("all" , platformService .findAll ());
2727 log .info ("node/platform/all" );
Original file line number Diff line number Diff line change 1010import org .springframework .web .bind .annotation .RequestMapping ;
1111
1212@ Controller
13- @ RequestMapping ("/node/port/ " )
13+ @ RequestMapping ("/node/port" )
1414public class PortController {
1515
1616 private static Logger log = LoggerFactory .getLogger (PortController .class .getName ());
@@ -28,7 +28,7 @@ public String getTitle(){
2828 return "all Categories" ;
2929 }
3030
31- @ GetMapping ("all" )
31+ @ GetMapping ("/ all" )
3232 public String all (Model model ) {
3333 model .addAttribute ("all" , portService .findAll ());
3434 log .info ("node/port/all" );
You can’t perform that action at this time.
0 commit comments