-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
131 additions
and
40 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...a/com/pcf/flights/FlightMicroservice.java → ...cf/tripit/flights/FlightMicroservice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ava/com/pcf/hotels/HotelMicroservice.java → .../pcf/tripit/hotels/HotelMicroservice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
applications/tripit/src/main/java/com/pcf/tripit/MainController.java
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
applications/tripit/src/main/java/com/pcf/tripit/TripitApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
spring.mvc.view.prefix=/WEB-INF/ | ||
spring.mvc.view.suffix=.jsp | ||
hotels.ms.url=http://localhost:8081/hotels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
components/hotels/src/main/java/com/pcf/tripit/hotels/HotelController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
components/hotels/src/main/java/com/pcf/tripit/hotels/bookings/BookingController.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apply from: "../../common.gradle" | ||
|
||
dependencies { | ||
compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") | ||
compile('commons-lang:commons-lang:2.4') | ||
//compile("io.pivotal.spring.cloud:spring-cloud-services-starter-circuit-breaker:$SCSClientStartersVersion") | ||
} |
37 changes: 37 additions & 0 deletions
37
components/ui/src/main/java/com/pcf/tripit/MainController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.pcf.tripit; | ||
|
||
import com.pcf.tripit.hotelui.HotelClient; | ||
import com.pcf.tripit.hotelui.HotelInitialList; | ||
import com.pcf.tripit.hotelui.HotelUI; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Controller | ||
public class MainController { | ||
|
||
private HotelInitialList hotelInitialList; | ||
private HotelClient hotelClient; | ||
|
||
@Autowired | ||
public MainController(HotelInitialList hotelInitialList, HotelClient hotelClient) { | ||
this.hotelInitialList = hotelInitialList; | ||
this.hotelClient = hotelClient; | ||
} | ||
|
||
@GetMapping("/") | ||
public String message(Map<String, Object> model){ | ||
hotelInitialList.asList().forEach(hotelClient::create); | ||
return "index"; | ||
} | ||
|
||
/* @GetMapping("/setup") | ||
public String setDatabase(){ | ||
model.put("hotels", hotelClient.getAll()); | ||
return "hotel"; | ||
}*/ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters