// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/model/Likes.java
// @RelationshipEntity(type = "LIKES")
// public class Likes {
// 
// 	@GraphId
// 	private Long id;
// 
// 	@StartNode
// 	private Person person;
// 
// 	@EndNode
// 	private Product product;
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public Person getPerson() {
// 		return person;
// 	}
// 
// 	public void setPerson(Person person) {
// 		this.person = person;
// 	}
// 
// 	public Product getProduct() {
// 		return product;
// 	}
// 
// 	public void setProduct(Product product) {
// 		this.product = product;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "Likes{" + "id=" + id + ", person=" + person + ", product=" + product + '}';
// 	}
// }
// 
// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/model/Person.java
// @NodeEntity
// public class Person {
// 
// 	@GraphId
// 	private Long id;
// 	private String userName;
// 	private String firstName;
// 	private String lastName;
// 
// 	@Override
// 	public String toString() {
// 		return "Person{" + "id=" + id + ", userName='" + userName + '\'' + ", firstName='" + firstName + '\''
// 				+ ", lastName='" + lastName + '\'' + '}';
// 	}
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public String getUserName() {
// 		return userName;
// 	}
// 
// 	public void setUserName(String userName) {
// 		this.userName = userName;
// 	}
// 
// 	public String getFirstName() {
// 		return firstName;
// 	}
// 
// 	public void setFirstName(String firstName) {
// 		this.firstName = firstName;
// 	}
// 
// 	public String getLastName() {
// 		return lastName;
// 	}
// 
// 	public void setLastName(String lastName) {
// 		this.lastName = lastName;
// 	}
// }
// 
// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/model/Product.java
// @NodeEntity
// public class Product {
// 
// 	@GraphId
// 	private Long id;
// 
// 	@Override
// 	public String toString() {
// 		return "Product{" + "id=" + id + ", productId='" + productId + '\'' + ", name='" + name + '\'' + '}';
// 	}
// 
// 	@Indexed(unique = true)
// 	private String productId;
// 	private String name;
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public String getProductId() {
// 		return productId;
// 	}
// 
// 	public void setProductId(String productId) {
// 		this.productId = productId;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// }
// 
// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/repositories/LikesRepository.java
// @RepositoryRestResource(exported = false)
// public interface LikesRepository extends GraphRepository<Likes> {
// }
// 
// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/repositories/PersonRepository.java
// public interface PersonRepository extends GraphRepository<Person> {
// 	@Query("MATCH (person:Person) WHERE person.userName = {userName} RETURN person")
// 	Person findByUserName(@Param("userName") String userName);
// }
// 
// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/repositories/ProductRepository.java
// public interface ProductRepository extends GraphRepository<Product> {
// 	@Query("MATCH (product:Product) WHERE product.productId = {productId} RETURN product")
// 	Product findByProductId(@Param("productId") String productId);
// 
// 	@Query("MATCH (p:Person) WHERE p.userName = {userName} MATCH p-[:LIKES]->product<-[:LIKES]-slm-[:LIKES]->recommendations "
// 			+ "WHERE not(p = slm) and not (p--recommendations) return recommendations")
// 	Iterable<Product> recommendedProductsFor(@Param("userName") String userName);
// 
// 	@Query("MATCH (product:Product) WHERE product.productId = {productId} MATCH product<-[:LIKES]-slm-[:LIKES]->recommendations "
// 			+ "RETURN distinct recommendations")
// 	Iterable<Product> productsLikedByPeopleWhoLiked(@Param("productId") String productId);
// }


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.ExposesResourceFor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.idugalic.recommendations.model.Likes;
import com.idugalic.recommendations.model.Person;
import com.idugalic.recommendations.model.Product;
import com.idugalic.recommendations.repositories.LikesRepository;
import com.idugalic.recommendations.repositories.PersonRepository;
import com.idugalic.recommendations.repositories.ProductRepository;
package com.idugalic.recommendations.controllers;



@RestController
@ExposesResourceFor(Likes.class)
public class ApiController {

	@Autowired
// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/model/Likes.java
// @RelationshipEntity(type = "LIKES")
// public class Likes {
// 
// 	@GraphId
// 	private Long id;
// 
// 	@StartNode
// 	private Person person;
// 
// 	@EndNode
// 	private Product product;
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public Person getPerson() {
// 		return person;
// 	}
// 
// 	public void setPerson(Person person) {
// 		this.person = person;
// 	}
// 
// 	public Product getProduct() {
// 		return product;
// 	}
// 
// 	public void setProduct(Product product) {
// 		this.product = product;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "Likes{" + "id=" + id + ", person=" + person + ", product=" + product + '}';
// 	}
// }
// 
// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/model/Person.java
// @NodeEntity
// public class Person {
// 
// 	@GraphId
// 	private Long id;
// 	private String userName;
// 	private String firstName;
// 	private String lastName;
// 
// 	@Override
// 	public String toString() {
// 		return "Person{" + "id=" + id + ", userName='" + userName + '\'' + ", firstName='" + firstName + '\''
// 				+ ", lastName='" + lastName + '\'' + '}';
// 	}
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public String getUserName() {
// 		return userName;
// 	}
// 
// 	public void setUserName(String userName) {
// 		this.userName = userName;
// 	}
// 
// 	public String getFirstName() {
// 		return firstName;
// 	}
// 
// 	public void setFirstName(String firstName) {
// 		this.firstName = firstName;
// 	}
// 
// 	public String getLastName() {
// 		return lastName;
// 	}
// 
// 	public void setLastName(String lastName) {
// 		this.lastName = lastName;
// 	}
// }
// 
// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/model/Product.java
// @NodeEntity
// public class Product {
// 
// 	@GraphId
// 	private Long id;
// 
// 	@Override
// 	public String toString() {
// 		return "Product{" + "id=" + id + ", productId='" + productId + '\'' + ", name='" + name + '\'' + '}';
// 	}
// 
// 	@Indexed(unique = true)
// 	private String productId;
// 	private String name;
// 
// 	public Long getId() {
// 		return id;
// 	}
// 
// 	public void setId(Long id) {
// 		this.id = id;
// 	}
// 
// 	public String getProductId() {
// 		return productId;
// 	}
// 
// 	public void setProductId(String productId) {
// 		this.productId = productId;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// }
// 
// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/repositories/LikesRepository.java
// @RepositoryRestResource(exported = false)
// public interface LikesRepository extends GraphRepository<Likes> {
// }
// 
// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/repositories/PersonRepository.java
// public interface PersonRepository extends GraphRepository<Person> {
// 	@Query("MATCH (person:Person) WHERE person.userName = {userName} RETURN person")
// 	Person findByUserName(@Param("userName") String userName);
// }
// 
// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/repositories/ProductRepository.java
// public interface ProductRepository extends GraphRepository<Product> {
// 	@Query("MATCH (product:Product) WHERE product.productId = {productId} RETURN product")
// 	Product findByProductId(@Param("productId") String productId);
// 
// 	@Query("MATCH (p:Person) WHERE p.userName = {userName} MATCH p-[:LIKES]->product<-[:LIKES]-slm-[:LIKES]->recommendations "
// 			+ "WHERE not(p = slm) and not (p--recommendations) return recommendations")
// 	Iterable<Product> recommendedProductsFor(@Param("userName") String userName);
// 
// 	@Query("MATCH (product:Product) WHERE product.productId = {productId} MATCH product<-[:LIKES]-slm-[:LIKES]->recommendations "
// 			+ "RETURN distinct recommendations")
// 	Iterable<Product> productsLikedByPeopleWhoLiked(@Param("productId") String productId);
// }


// Path: microservices-recommendations/src/main/java/com/idugalic/recommendations/controllers/ApiController.java
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.ExposesResourceFor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.idugalic.recommendations.model.Likes;
import com.idugalic.recommendations.model.Person;
import com.idugalic.recommendations.model.Product;
import com.idugalic.recommendations.repositories.LikesRepository;
import com.idugalic.recommendations.repositories.PersonRepository;
import com.idugalic.recommendations.repositories.ProductRepository;

package com.idugalic.recommendations.controllers;



@RestController
@ExposesResourceFor(Likes.class)
public class ApiController {

	@Autowired
	ProductRepository productRepository;