Created
August 24, 2017 21:36
-
-
Save cliffgr/d8d3c8b90cfe7938809769b01da1c3c1 to your computer and use it in GitHub Desktop.
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
package com.apodeixoulis.Apodeixoulis.controller; | |
import com.apodeixoulis.Apodeixoulis.model.rating.Place; | |
import com.apodeixoulis.Apodeixoulis.model.rating.Rate; | |
import com.apodeixoulis.Apodeixoulis.model.user.UserResponse; | |
import com.apodeixoulis.Apodeixoulis.service.RateService; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.transaction.annotation.Transactional; | |
import org.springframework.validation.annotation.Validated; | |
import org.springframework.web.bind.annotation.PostMapping; | |
import org.springframework.web.bind.annotation.RequestBody; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import javax.persistence.EntityManager; | |
import javax.persistence.PersistenceContext; | |
import java.util.Set; | |
/** | |
* Created by cliff on 15/8/2017. | |
*/ | |
@RestController | |
@RequestMapping(value = "/api/rate") | |
public class RateController { | |
@Autowired | |
private RateService rateService; | |
@PersistenceContext | |
private EntityManager entityManager; | |
@PostMapping(value = "/insertplace") | |
@Transactional | |
public void insertUser(@Validated @RequestBody final Rate place) { | |
entityManager.merge(place); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment