Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai.Poenaru committed Sep 24, 2019
1 parent 8bcc03c commit 98fe92e
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .gitignore
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
68 changes: 68 additions & 0 deletions pom.xml
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>
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);
}

}
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;
}
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;
}
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);
}
1 change: 1 addition & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 98fe92e

Please sign in to comment.