diff --git a/applications/flights-ms/src/main/java/com/pcf/flights/FlightMicroservice.java b/applications/flights-ms/src/main/java/com/pcf/tripit/flights/FlightMicroservice.java
similarity index 90%
rename from applications/flights-ms/src/main/java/com/pcf/flights/FlightMicroservice.java
rename to applications/flights-ms/src/main/java/com/pcf/tripit/flights/FlightMicroservice.java
index f27f923..2523d1d 100644
--- a/applications/flights-ms/src/main/java/com/pcf/flights/FlightMicroservice.java
+++ b/applications/flights-ms/src/main/java/com/pcf/tripit/flights/FlightMicroservice.java
@@ -1,4 +1,4 @@
-package com.pcf.flights;
+package com.pcf.tripit.flights;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/components/flights/src/main/resources/application.yml b/applications/flights-ms/src/main/resources/application.yml
similarity index 88%
rename from components/flights/src/main/resources/application.yml
rename to applications/flights-ms/src/main/resources/application.yml
index 961c7c4..d859205 100644
--- a/components/flights/src/main/resources/application.yml
+++ b/applications/flights-ms/src/main/resources/application.yml
@@ -6,7 +6,7 @@ spring:
name: flights-ms
jpa:
- hibernate.ddl-auto: create
+ generate-ddl: true
properties.hibernate.dialect: org.hibernate.dialect.MySQL5Dialect
datasource:
diff --git a/applications/hotels-ms/src/main/java/com/pcf/hotels/HotelMicroservice.java b/applications/hotels-ms/src/main/java/com/pcf/tripit/hotels/HotelMicroservice.java
similarity index 90%
rename from applications/hotels-ms/src/main/java/com/pcf/hotels/HotelMicroservice.java
rename to applications/hotels-ms/src/main/java/com/pcf/tripit/hotels/HotelMicroservice.java
index d1ad42a..12f5e57 100644
--- a/applications/hotels-ms/src/main/java/com/pcf/hotels/HotelMicroservice.java
+++ b/applications/hotels-ms/src/main/java/com/pcf/tripit/hotels/HotelMicroservice.java
@@ -1,4 +1,4 @@
-package com.pcf.hotels;
+package com.pcf.tripit.hotels;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/components/hotels/src/main/resources/application.yml b/applications/hotels-ms/src/main/resources/application.yml
similarity index 88%
rename from components/hotels/src/main/resources/application.yml
rename to applications/hotels-ms/src/main/resources/application.yml
index 2e5b154..261e929 100644
--- a/components/hotels/src/main/resources/application.yml
+++ b/applications/hotels-ms/src/main/resources/application.yml
@@ -6,7 +6,7 @@ spring:
name: hotels-ms
jpa:
- hibernate.ddl-auto: create
+ generate-ddl: true
properties.hibernate.dialect: org.hibernate.dialect.MySQL5Dialect
datasource:
diff --git a/applications/tripit/build.gradle b/applications/tripit/build.gradle
index 92c4d60..fa3f8f6 100644
--- a/applications/tripit/build.gradle
+++ b/applications/tripit/build.gradle
@@ -15,6 +15,7 @@ dependencyManagement {
}
dependencies {
+ compile project(':components:ui')
compile('org.springframework.boot:spring-boot-starter-web')
compile('taglibs:standard:1.1.2')
compile('javax.servlet:jstl:1.2')
diff --git a/applications/tripit/src/main/java/com/pcf/tripit/MainController.java b/applications/tripit/src/main/java/com/pcf/tripit/MainController.java
deleted file mode 100644
index a9b1a1e..0000000
--- a/applications/tripit/src/main/java/com/pcf/tripit/MainController.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.pcf.tripit;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-
-@Controller
-public class MainController {
- @GetMapping("/")
- public String message(){
- return "index";
- }
-
-}
diff --git a/applications/tripit/src/main/java/com/pcf/tripit/TripitApplication.java b/applications/tripit/src/main/java/com/pcf/tripit/TripitApplication.java
index ffd98ca..6e81ab0 100644
--- a/applications/tripit/src/main/java/com/pcf/tripit/TripitApplication.java
+++ b/applications/tripit/src/main/java/com/pcf/tripit/TripitApplication.java
@@ -1,13 +1,34 @@
package com.pcf.tripit;
+import com.pcf.tripit.hotelui.HotelClient;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.web.client.RestOperations;
+import org.springframework.web.client.RestTemplate;
@SpringBootApplication
public class TripitApplication {
+ @Value("${hotels.ms.url}")
+ private String url;
+
public static void main(String[] args) {
SpringApplication.run(TripitApplication.class, args);
}
+ //@Bean
+ /*public MovieClient movieClient(RestOperations restOperations) {
+ return new MovieClient("//movies-ms/movies", restOperations);
+ }*/
+
+ @Bean
+ public HotelClient hotelClient(RestOperations restOperations) {
+ return new HotelClient(url, restOperations);
+ }
+ @Bean
+ public RestOperations restOperations() {
+ return new RestTemplate();
+ }
}
diff --git a/applications/tripit/src/main/resources/application.properties b/applications/tripit/src/main/resources/application.properties
index e522006..9ada523 100644
--- a/applications/tripit/src/main/resources/application.properties
+++ b/applications/tripit/src/main/resources/application.properties
@@ -1,2 +1,3 @@
spring.mvc.view.prefix=/WEB-INF/
spring.mvc.view.suffix=.jsp
+hotels.ms.url=http://localhost:8081/hotels
diff --git a/applications/tripit/src/main/webapp/WEB-INF/hotel.jsp b/applications/tripit/src/main/webapp/WEB-INF/hotel.jsp
index 5b81cb3..784d97d 100644
--- a/applications/tripit/src/main/webapp/WEB-INF/hotel.jsp
+++ b/applications/tripit/src/main/webapp/WEB-INF/hotel.jsp
@@ -6,6 +6,11 @@
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+