-
Notifications
You must be signed in to change notification settings - Fork 0
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
Mihai.Poenaru
committed
Sep 24, 2019
1 parent
8bcc03c
commit 98fe92e
Showing
7 changed files
with
206 additions
and
0 deletions.
There are no files selected for viewing
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,33 @@ | ||
HELP.md | ||
target/ | ||
!.mvn/wrapper/maven-wrapper.jar | ||
!**/src/main/** | ||
!**/src/test/** | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
build/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
/mvnw.cmd | ||
/mvnw |
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,68 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.1.8.RELEASE</version> | ||
<relativePath/> <!-- lookup parent from repository --> | ||
</parent> | ||
<groupId>com.orange.springup</groupId> | ||
<artifactId>movie-retriever</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<name>movie-retriever</name> | ||
<description>Simple microservice for movie metadata retrieval</description> | ||
|
||
<properties> | ||
<java.version>1.8</java.version> | ||
<spring-cloud.version>Greenwich.SR3</spring-cloud.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-actuator</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-mongodb</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-openfeign</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-dependencies</artifactId> | ||
<version>${spring-cloud.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/orange/springup/movieretriever/MovieRetrieverApplication.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,15 @@ | ||
package com.orange.springup.movieretriever; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.openfeign.EnableFeignClients; | ||
|
||
@EnableFeignClients | ||
@SpringBootApplication | ||
public class MovieRetrieverApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(MovieRetrieverApplication.class, args); | ||
} | ||
|
||
} |
61 changes: 61 additions & 0 deletions
61
src/main/java/com/orange/springup/movieretriever/dtos/MovieDto.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,61 @@ | ||
|
||
package com.orange.springup.movieretriever.dtos; | ||
|
||
import java.util.List; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class MovieDto { | ||
|
||
@JsonProperty("Title") | ||
public String title; | ||
@JsonProperty("Year") | ||
public String year; | ||
@JsonProperty("Rated") | ||
public String rated; | ||
@JsonProperty("Released") | ||
public String released; | ||
@JsonProperty("Runtime") | ||
public String runtime; | ||
@JsonProperty("Genre") | ||
public String genre; | ||
@JsonProperty("Director") | ||
public String director; | ||
@JsonProperty("Writer") | ||
public String writer; | ||
@JsonProperty("Actors") | ||
public String actors; | ||
@JsonProperty("Plot") | ||
public String plot; | ||
@JsonProperty("Language") | ||
public String language; | ||
@JsonProperty("Country") | ||
public String country; | ||
@JsonProperty("Awards") | ||
public String awards; | ||
@JsonProperty("Poster") | ||
public String poster; | ||
@JsonProperty("Ratings") | ||
public List<RatingDto> ratingDtos = null; | ||
@JsonProperty("Metascore") | ||
public String metascore; | ||
@JsonProperty("imdbRating") | ||
public String imdbRating; | ||
@JsonProperty("imdbVotes") | ||
public String imdbVotes; | ||
@JsonProperty("imdbID") | ||
public String imdbID; | ||
@JsonProperty("Type") | ||
public String type; | ||
@JsonProperty("DVD") | ||
public String dVD; | ||
@JsonProperty("BoxOffice") | ||
public String boxOffice; | ||
@JsonProperty("Production") | ||
public String production; | ||
@JsonProperty("Website") | ||
public String website; | ||
@JsonProperty("Response") | ||
public String response; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/orange/springup/movieretriever/dtos/RatingDto.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,15 @@ | ||
|
||
package com.orange.springup.movieretriever.dtos; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class RatingDto { | ||
|
||
@JsonProperty("Source") | ||
public String source; | ||
@JsonProperty("Value") | ||
public String value; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/orange/springup/movieretriever/feign/client/OMDBClient.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,13 @@ | ||
package com.orange.springup.movieretriever.feign.client; | ||
|
||
import com.orange.springup.movieretriever.dtos.MovieDto; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
|
||
@FeignClient(name = "omdb-client", url = "http://www.omdbapi.com") | ||
public interface OMDBClient { | ||
|
||
@GetMapping("/?apiKey={key}&t={title}") | ||
MovieDto searchByTitle(@PathVariable("title") String title, @PathVariable("key") String key); | ||
} |
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 @@ | ||
|