Skip to content

Commit 08ed894

Browse files
committed
Configure application ports to avoid port conflicts
1 parent 84e1e2a commit 08ed894

File tree

7 files changed

+51
-4
lines changed

7 files changed

+51
-4
lines changed

movie-catalog-service/src/main/java/com/moviecatalogservice/resources/CatalogItem.java renamed to movie-catalog-service/src/main/java/com/moviecatalogservice/models/CatalogItem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.moviecatalogservice.resources;
1+
package com.moviecatalogservice.models;
22

33
public class CatalogItem {
44

movie-catalog-service/src/main/java/com/moviecatalogservice/resources/MovieCatalogResource.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.moviecatalogservice.resources;
22

3+
import com.moviecatalogservice.models.CatalogItem;
34
import org.springframework.web.bind.annotation.PathVariable;
45
import org.springframework.web.bind.annotation.RequestMapping;
56
import org.springframework.web.bind.annotation.RestController;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
server.port=8081
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.example.movieinfoservice.models;
2+
3+
public class Movie {
4+
5+
private String movieId;
6+
private String name;
7+
8+
public Movie() {
9+
}
10+
11+
public Movie(String movieId, String name) {
12+
this.movieId = movieId;
13+
this.name = name;
14+
}
15+
16+
public String getMovieId() {
17+
return movieId;
18+
}
19+
20+
public void setMovieId(String movieId) {
21+
this.movieId = movieId;
22+
}
23+
24+
public String getName() {
25+
return name;
26+
}
27+
28+
public void setName(String name) {
29+
this.name = name;
30+
}
31+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.example.movieinfoservice.resources;
2+
3+
import com.example.movieinfoservice.models.Movie;
4+
import org.springframework.web.bind.annotation.RequestMapping;
5+
import org.springframework.web.bind.annotation.RestController;
6+
7+
@RestController
8+
@RequestMapping("/movies")
9+
public class MovieResource {
10+
11+
@RequestMapping("/{movieId}")
12+
public Movie getMovieInfo(String movieId) {
13+
return new Movie(movieId, "Test name");
14+
}
15+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
server.port=8082
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
server.port=8083

0 commit comments

Comments
 (0)