Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"info": {
"_postman_id": "cda15b4e-eec8-431d-8578-9d4e070899b6",
"name": "JavaBrains- Springboot micro services level-1",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "865546"
},
"item": [
{
"name": "movie-catalog-service",
"item": [
{
"name": "MovieCatelog",
"request": {
"method": "GET",
"header": []
},
"response": []
}
]
},
{
"name": "movie-info-service",
"item": []
},
{
"name": "ratings-data-service",
"item": []
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"info": {
"_postman_id": "7ef40e57-378b-418e-92fc-1d22fd82dba1",
"name": "movie-catalog-service",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "865546"
},
"item": [
{
"name": "MovieCatelog",
"request": {
"method": "GET",
"header": []
},
"response": []
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ public class CatalogResource {

@RequestMapping("/{userId}")
public List<CatalogItem> getCatalog(@PathVariable("userId") String userId) {

UserRating userRating = restTemplate.getForObject("http://ratings-data-service/ratingsdata/user/" + userId, UserRating.class);

return userRating.getRatings().stream()

UserRating userRating = restTemplate.getForObject("https://ratings-data-service/ratingsdata/user/" + userId, UserRating.class);
return userRating.getRatings().stream()
.map(rating -> {
Movie movie = restTemplate.getForObject("http://movie-info-service/movies/" + rating.getMovieId(), Movie.class);
Movie movie = restTemplate.getForObject("https://movie-info-service/movies/" + rating.getMovieId(), Movie.class);
return new CatalogItem(movie.getName(), movie.getDescription(), rating.getRating());
})
.collect(Collectors.toList());

}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"info": {
"_postman_id": "7141b34c-7930-46cc-967d-36c31cb708af",
"name": "movie-info-service",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "865546"
},
"item": [
{
"name": "movies by movie Id",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "localhost:8082/movies/1",
"host": [
"localhost"
],
"port": "8082",
"path": [
"movies",
"1"
]
}
},
"response": []
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"info": {
"_postman_id": "55451066-7971-4f63-bf0e-28522dd4c0b1",
"name": "ratings-data-service",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "865546"
},
"item": [
{
"name": "rating by movie id",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "localhost:8083/ratingsdata/movies/1",
"host": [
"localhost"
],
"port": "8083",
"path": [
"ratingsdata",
"movies",
"1"
]
}
},
"response": []
},
{
"name": "user ratings by userid",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "localhost:8083/user/1",
"host": [
"localhost"
],
"port": "8083",
"path": [
"user",
"1"
]
}
},
"response": []
}
]
}