// Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/domain/Sentiment.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// 
// public class Sentiment {
// 
//     private String sentiment;
//     private String id;
//     
// 	public String getSentiment() {
// 		return sentiment;
// 	}
// 	public void setSentiment(String sentiment) {
// 		this.sentiment = sentiment;
// 	}
// 	public String getId() {
// 		return id;
// 	}
// 	public void setId(String id) {
// 		this.id = id;
// 	}
// 
// }
// 
// Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/facade/SentimentrFacade.java
// public class SentimentrFacade {
// 	
// 	private String sentimentrUri;
// 
// 	public SentimentrFacade()
// 	{
// 	}
// 	public SentimentrFacade(String sentimentrUri)
// 	{
// 		this.sentimentrUri = sentimentrUri;
// 	}
// 	
// 	public Sentiment getSentiment(String text)
// 	{
// 		RestTemplate restTemplate = new RestTemplate();
// 		Sentiment sentiment = restTemplate.getForObject(sentimentrUri+"/{text}", Sentiment.class, text);
// 		return sentiment;
// 	}
// 
// }


import io.pivotal.fe.sentimentr.client.domain.Sentiment;
import io.pivotal.fe.sentimentr.client.facade.SentimentrFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
package io.pivotal.fe.sentimentr.client.controller;



@RestController
public class SentimentrClientController {
	
    private SentimentrFacade sentimentrFacade;

    @Autowired
    public SentimentrClientController(SentimentrFacade sentimentrFacade) {
        this.sentimentrFacade = sentimentrFacade;
    }

	@RequestMapping("/sentiment/{text}")
	public Sentiment getSentiment(@PathVariable String text) {
		return sentimentrFacade.getSentiment(text);
	}

	@RequestMapping(value="/sentiment", method=RequestMethod.POST)
// Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/domain/Sentiment.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// 
// public class Sentiment {
// 
//     private String sentiment;
//     private String id;
//     
// 	public String getSentiment() {
// 		return sentiment;
// 	}
// 	public void setSentiment(String sentiment) {
// 		this.sentiment = sentiment;
// 	}
// 	public String getId() {
// 		return id;
// 	}
// 	public void setId(String id) {
// 		this.id = id;
// 	}
// 
// }
// 
// Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/facade/SentimentrFacade.java
// public class SentimentrFacade {
// 	
// 	private String sentimentrUri;
// 
// 	public SentimentrFacade()
// 	{
// 	}
// 	public SentimentrFacade(String sentimentrUri)
// 	{
// 		this.sentimentrUri = sentimentrUri;
// 	}
// 	
// 	public Sentiment getSentiment(String text)
// 	{
// 		RestTemplate restTemplate = new RestTemplate();
// 		Sentiment sentiment = restTemplate.getForObject(sentimentrUri+"/{text}", Sentiment.class, text);
// 		return sentiment;
// 	}
// 
// }


// Path: sentimentr-client/sentimentr-ui/src/main/java/io/pivotal/fe/sentimentr/client/controller/SentimentrClientController.java
import io.pivotal.fe.sentimentr.client.domain.Sentiment;
import io.pivotal.fe.sentimentr.client.facade.SentimentrFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

package io.pivotal.fe.sentimentr.client.controller;



@RestController
public class SentimentrClientController {
	
    private SentimentrFacade sentimentrFacade;

    @Autowired
    public SentimentrClientController(SentimentrFacade sentimentrFacade) {
        this.sentimentrFacade = sentimentrFacade;
    }

	@RequestMapping("/sentiment/{text}")
	public Sentiment getSentiment(@PathVariable String text) {
		return sentimentrFacade.getSentiment(text);
	}

	@RequestMapping(value="/sentiment", method=RequestMethod.POST)
	public Sentiment getsSentiment(@RequestBody String text) {